diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/.distignore b/wp-content/upgrade-temp-backup/plugins/activitypub/.distignore deleted file mode 100644 index 871e8074..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/.distignore +++ /dev/null @@ -1,41 +0,0 @@ -.DS_Store -.editorconfig -.git -.gitignore -.github -.travis.yml -.codeclimate.yml -.data -.svnignore -.wordpress-org -.php_cs -Gruntfile.js -LINGUAS -Makefile -README.md -readme.md -CODE_OF_CONDUCT.md -FEDERATION.md -SECURITY.md -LICENSE.md -_site -_config.yml -bin -composer.json -composer.lock -docker-compose.yml -docker-compose-test.yml -Dockerfile -gulpfile.js -package.json -node_modules -npm-debug.log -phpcs.xml -package.json -package-lock.json -phpunit.xml -phpunit.xml.dist -tests -node_modules -vendor -src 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 521a3795..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/activitypub.php +++ /dev/null @@ -1,215 +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 ); - -\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\Users::init(); - Rest\Outbox::init(); - Rest\Inbox::init(); - Rest\Followers::init(); - Rest\Following::init(); - Rest\Webfinger::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__ . '\Collection\Followers', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Admin', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Hashtag', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Shortcodes', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Mention', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Health_Check', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Scheduler', '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(); -} -\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 = 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() { - $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 07aadcad..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/css/activitypub-admin.css +++ /dev/null @@ -1,199 +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; -} 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 f6a75afe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/js/activitypub-admin.js +++ /dev/null @@ -1,20 +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 8dcb824d..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-index.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 4e87a6f4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '2a185b1c488886051601'); 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 89618f03..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={843:(e,t,n)=>{const r=window.wp.blocks,o=window.wp.element,l=window.wp.primitives,a=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.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"}));function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:null;return n?`${e}${arguments.length>3&&void 0!==arguments[3]?arguments[3]:""} { ${t}: ${n}; }\n`:""}function E(e,t,n,r){return g(e,"background-color",t)+g(e,"color",n)+g(e,"background-color",r,":hover")+g(e,"background-color",r,":focus")}function k(e){let{selector:t,style:n,backgroundColor:r}=e;const l=function(e,t,n){const r=`${e} .components-button`,o=("string"==typeof(l=n)?h(l):l?.color?.background||null)||t?.color?.background;var l;return E(r,_(t?.elements?.link?.color?.text),o,_(t?.elements?.link?.[":hover"]?.color?.text))}(t,n,r);return(0,o.createElement)("style",null,l)}const{namespace:O}=window._activityPubOptions,x={avatar:"",resource:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function C(e){if(!e)return x;const t={...x,...e};return t.avatar=t?.icon?.url,t}function S(e){let{profile:t,popupStyles:n,userId:r}=e;const{avatar:l,name:a,resource:c}=t;return(0,o.createElement)("div",{className:"activitypub-profile"},(0,o.createElement)("img",{className:"activitypub-profile__avatar",src:l}),(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:c},c)),(0,o.createElement)(N,{profile:t,popupStyles:n,userId:r}))}function N(e){let{profile:t,popupStyles:n,userId:r}=e;const[l,a]=(0,o.useState)(!1),c=(0,s.sprintf)((0,s.__)("Follow %s","activitypub"),t?.name);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.Button,{className:"activitypub-profile__follow",onClick:()=>a(!0)},(0,s.__)("Follow","activitypub")),l&&(0,o.createElement)(u.Modal,{className:"activitypub-profile__confirm",onRequestClose:()=>a(!1),title:c},(0,o.createElement)(P,{profile:t,userId:r}),(0,o.createElement)("style",null,n)))}function $(e){try{return new URL(e),!0}catch(e){return!1}}function P(e){let{profile:t,userId:n}=e;const{resource:r}=t,l=(0,s.__)("Follow","activitypub"),a=(0,s.__)("Loading...","activitypub"),c=(0,s.__)("Opening...","activitypub"),i=(0,s.__)("Error","activitypub"),p=(0,s.__)("Invalid","activitypub"),[m,v]=(0,o.useState)(l),[h,_]=(0,o.useState)(f),g=(0,y.useCopyToClipboard)(r,(()=>{_(w),setTimeout((()=>_(f)),1e3)})),[E,k]=(0,o.useState)(""),x=(0,o.useCallback)((()=>{let e;if(!$(E)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&$(`https://${t[1]}`)}(E))return v(p),e=setTimeout((()=>v(l)),2e3),()=>clearTimeout(e);const t=`/${O}/users/${n}/remote-follow?resource=${E}`;v(a),d()({path:t}).then((e=>{let{url:t}=e;v(c),setTimeout((()=>{window.open(t,"_blank"),v(l)}),200)})).catch((()=>{v(i),setTimeout((()=>v(l)),2e3)}))}),[E]);return(0,o.createElement)("div",{className:"activitypub-follow-me__dialog"},(0,o.createElement)("div",{className:"apmfd__section"},(0,o.createElement)("h4",null,(0,s.__)("My Profile","activitypub")),(0,o.createElement)("div",{className:"apfmd-description"},(0,s.__)("Copy and paste my profile into the search field of your favorite fediverse app or server.","activitypub")),(0,o.createElement)("div",{className:"apfmd__button-group"},(0,o.createElement)("input",{type:"text",value:r,readOnly:!0}),(0,o.createElement)(u.Button,{ref:g},(0,o.createElement)(b,{icon:h}),(0,s.__)("Copy","activitypub")))),(0,o.createElement)("div",{className:"apmfd__section"},(0,o.createElement)("h4",null,(0,s.__)("Your Profile","activitypub")),(0,o.createElement)("div",{className:"apfmd-description"},(0,o.createInterpolateElement)((0,s.__)("Or, if you know your own profile, we can start things that way! (eg https://example.com/yourusername or yourusername@example.com)","activitypub"),{code:(0,o.createElement)("code",null)})),(0,o.createElement)("div",{className:"apfmd__button-group"},(0,o.createElement)("input",{type:"text",value:E,onKeyDown:e=>{"Enter"===e?.code&&x()},onChange:e=>k(e.target.value)}),(0,o.createElement)(u.Button,{onClick:x},m))))}function z(e){let{selectedUser:t,style:n,backgroundColor:r,id:l,useId:a=!1,profileData:c=!1}=e;const[i,s]=(0,o.useState)(C()),u="site"===t?0:t,p=function(e){return E(".apfmd__button-group .components-button",_(e?.elements?.link?.color?.text)||"#111","#fff",_(e?.elements?.link?.[":hover"]?.color?.text)||"#333")}(n),m=a?{id:l}:{};function v(e){s(C(e))}return(0,o.useEffect)((()=>{if(c)return v(c);(function(e){const t={headers:{Accept:"application/activity+json"},path:`/${O}/users/${e}`};return d()(t)})(u).then(v)}),[u,c]),(0,o.createElement)("div",m,(0,o.createElement)(k,{selector:`#${l}`,style:n,backgroundColor:r}),(0,o.createElement)(S,{profile:i,userId:u,popupStyles:p}))}(0,r.registerBlockType)("activitypub/follow-me",{edit:function(e){let{attributes:t,setAttributes:n}=e;const r=(0,i.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),l=function(){const e=m?.users?(0,p.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,o.useMemo)((()=>{if(!e)return[];const t=m?.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:a}=t;return(0,o.useEffect)((()=>{l.length&&(l.find((e=>{let{value:t}=e;return t===a}))||n({selectedUser:l[0].value}))}),[a,l]),(0,o.createElement)("div",r,l.length>1&&(0,o.createElement)(i.InspectorControls,{key:"setting"},(0,o.createElement)(u.PanelBody,{title:(0,s.__)("Followers Options","activitypub")},(0,o.createElement)(u.SelectControl,{label:(0,s.__)("Select User","activitypub"),value:t.selectedUser,options:l,onChange:e=>n({selectedUser:e})}))),(0,o.createElement)(z,c({},t,{id:r.id})))},save:()=>null,icon:a})}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var l=n[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,n,o,l)=>{if(!n){var a=1/0;for(u=0;u=l)&&Object.keys(r.O).every((e=>r.O[e](n[i])))?n.splice(i--,1):(c=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[n,o,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 n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={127:0,740:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,l,[a,c,i]=n,s=0;if(a.some((t=>0!==e[t]))){for(o in c)r.o(c,o)&&(r.m[o]=c[o]);if(i)var u=i(r)}for(t&&t(n);sr(843)));o=r.O(o)})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-index.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-index.css deleted file mode 100644 index 0a435681..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.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}.activitypub-profile__confirm.components-modal__frame{background-color:#f7f7f7;color:#333}.activitypub-profile__confirm.components-modal__frame .components-modal__header-heading,.activitypub-profile__confirm.components-modal__frame h4{color:#333;letter-spacing:inherit;word-spacing:inherit}.activitypub-follow-me__dialog{max-width:30em}.activitypub-follow-me__dialog h4{line-height:1;margin:0}.activitypub-follow-me__dialog .apmfd__section{margin-bottom:2em}.activitypub-follow-me__dialog .apfmd-description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub-follow-me__dialog .apfmd__button-group{display:flex;justify-content:flex-end}.activitypub-follow-me__dialog .apfmd__button-group svg{height:21px;margin-right:.5em;width:21px}.activitypub-follow-me__dialog .apfmd__button-group input{flex:1;padding-left:1em;padding-right:1em} 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 3d8b16e1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '17a158ceced1355cc8ea'); 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 7e0a8070..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={810:(e,t,r)=>{function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:null;return r?`${e}${arguments.length>3&&void 0!==arguments[3]?arguments[3]:""} { ${t}: ${r}; }\n`:""}function _(e,t,r,n){return w(e,"background-color",t)+w(e,"color",r)+w(e,"background-color",n,":hover")+w(e,"background-color",n,":focus")}function h(e){let{selector:t,style:r,backgroundColor:n}=e;const l=function(e,t,r){const n=`${e} .components-button`,o=("string"==typeof(l=r)?y(l):l?.color?.background||null)||t?.color?.background;var l;return _(n,b(t?.elements?.link?.color?.text),o,b(t?.elements?.link?.[":hover"]?.color?.text))}(t,r,n);return(0,o.createElement)("style",null,l)}const{namespace:E}=window._activityPubOptions,g={avatar:"",resource:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function k(e){if(!e)return g;const t={...g,...e};return t.avatar=t?.icon?.url,t}function O(e){let{profile:t,popupStyles:r,userId:n}=e;const{avatar:l,name:a,resource:c}=t;return(0,o.createElement)("div",{className:"activitypub-profile"},(0,o.createElement)("img",{className:"activitypub-profile__avatar",src:l}),(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:c},c)),(0,o.createElement)(x,{profile:t,popupStyles:r,userId:n}))}function x(e){let{profile:t,popupStyles:r,userId:n}=e;const[l,a]=(0,o.useState)(!1),c=(0,s.sprintf)((0,s.__)("Follow %s","activitypub"),t?.name);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.Button,{className:"activitypub-profile__follow",onClick:()=>a(!0)},(0,s.__)("Follow","activitypub")),l&&(0,o.createElement)(u.Modal,{className:"activitypub-profile__confirm",onRequestClose:()=>a(!1),title:c},(0,o.createElement)(N,{profile:t,userId:n}),(0,o.createElement)("style",null,r)))}function C(e){try{return new URL(e),!0}catch(e){return!1}}function N(e){let{profile:t,userId:r}=e;const{resource:n}=t,l=(0,s.__)("Follow","activitypub"),a=(0,s.__)("Loading...","activitypub"),c=(0,s.__)("Opening...","activitypub"),p=(0,s.__)("Error","activitypub"),y=(0,s.__)("Invalid","activitypub"),[b,w]=(0,o.useState)(l),[_,h]=(0,o.useState)(m),g=(0,f.useCopyToClipboard)(n,(()=>{h(d),setTimeout((()=>h(m)),1e3)})),[k,O]=(0,o.useState)(""),x=(0,o.useCallback)((()=>{let e;if(!C(k)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&C(`https://${t[1]}`)}(k))return w(y),e=setTimeout((()=>w(l)),2e3),()=>clearTimeout(e);const t=`/${E}/users/${r}/remote-follow?resource=${k}`;w(a),i()({path:t}).then((e=>{let{url:t}=e;w(c),setTimeout((()=>{window.open(t,"_blank"),w(l)}),200)})).catch((()=>{w(p),setTimeout((()=>w(l)),2e3)}))}),[k]);return(0,o.createElement)("div",{className:"activitypub-follow-me__dialog"},(0,o.createElement)("div",{className:"apmfd__section"},(0,o.createElement)("h4",null,(0,s.__)("My Profile","activitypub")),(0,o.createElement)("div",{className:"apfmd-description"},(0,s.__)("Copy and paste my profile into the search field of your favorite fediverse app or server.","activitypub")),(0,o.createElement)("div",{className:"apfmd__button-group"},(0,o.createElement)("input",{type:"text",value:n,readOnly:!0}),(0,o.createElement)(u.Button,{ref:g},(0,o.createElement)(v,{icon:_}),(0,s.__)("Copy","activitypub")))),(0,o.createElement)("div",{className:"apmfd__section"},(0,o.createElement)("h4",null,(0,s.__)("Your Profile","activitypub")),(0,o.createElement)("div",{className:"apfmd-description"},(0,o.createInterpolateElement)((0,s.__)("Or, if you know your own profile, we can start things that way! (eg https://example.com/yourusername or yourusername@example.com)","activitypub"),{code:(0,o.createElement)("code",null)})),(0,o.createElement)("div",{className:"apfmd__button-group"},(0,o.createElement)("input",{type:"text",value:k,onKeyDown:e=>{"Enter"===e?.code&&x()},onChange:e=>O(e.target.value)}),(0,o.createElement)(u.Button,{onClick:x},b))))}function S(e){let{selectedUser:t,style:r,backgroundColor:n,id:l,useId:a=!1,profileData:c=!1}=e;const[u,s]=(0,o.useState)(k()),p="site"===t?0:t,m=function(e){return _(".apfmd__button-group .components-button",b(e?.elements?.link?.color?.text)||"#111","#fff",b(e?.elements?.link?.[":hover"]?.color?.text)||"#333")}(r),d=a?{id:l}:{};function v(e){s(k(e))}return(0,o.useEffect)((()=>{if(c)return v(c);(function(e){const t={headers:{Accept:"application/activity+json"},path:`/${E}/users/${e}`};return i()(t)})(p).then(v)}),[p,c]),(0,o.createElement)("div",d,(0,o.createElement)(h,{selector:`#${l}`,style:r,backgroundColor:n}),(0,o.createElement)(O,{profile:u,userId:p,popupStyles:m}))}let $=1;a()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-follow-me-block-wrapper"),(e=>{const t=JSON.parse(e.dataset.attrs);(0,o.render)((0,o.createElement)(S,n({},t,{id:"activitypub-follow-me-block-"+$++,useId:!0})),e)}))}))}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,r,o,l)=>{if(!r){var a=1/0;for(s=0;s=l)&&Object.keys(n.O).every((e=>n.O[e](r[i])))?r.splice(i--,1):(c=!1,l0&&e[s-1][2]>l;s--)e[s]=e[s-1];e[s]=[r,o,l]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={529:0,740:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var o,l,[a,c,i]=r,u=0;if(a.some((t=>0!==e[t]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);if(i)var s=i(n)}for(t&&t(r);un(810)));o=n.O(o)})(); \ 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 40f86715..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' => '1cbd9cbfcbd7fc813429'); 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 972f56b5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.js +++ /dev/null @@ -1,3 +0,0 @@ -(()=>{var e={184:(e,t)=>{var a;!function(){"use strict";var n={}.hasOwnProperty;function l(){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 n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.wp.element,n=window.wp.primitives,l=(0,t.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(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"}));function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.preventDefault(),!a&&r(l)}},n)}const d={outlined:"outlined",minimal:"minimal"};function f(e){let{compact:a,nextLabel:n,page:l,pageClick:r,perPage:o,prevLabel:i,total:c,variant:s=d.outlined}=e;const p=((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,n)=>e>=1&&e<=t&&n.lastIndexOf(e)===a));for(let e=a.length-2;e>=0;e--)a[e]===a[e+1]&&a.splice(e+1,1);return a})(l,Math.ceil(c/o)),u=b()("alignwide wp-block-query-pagination is-content-justification-space-between is-layout-flex wp-block-query-pagination-is-layout-flex",`is-${s}`,{"is-compact":a});return(0,t.createElement)("nav",{className:u},i&&(0,t.createElement)(w,{key:"prev",page:l-1,pageClick:r,active:1===l,"aria-label":i,className:"wp-block-query-pagination-previous block-editor-block-list__block"},i),!a&&(0,t.createElement)("div",{className:"block-editor-block-list__block wp-block wp-block-query-pagination-numbers"},p.map((e=>(0,t.createElement)(w,{key:e,page:e,pageClick:r,active:e===l,className:"page-numbers"},e)))),n&&(0,t.createElement)(w,{key:"next",page:l+1,pageClick:r,active:l===Math.ceil(c/o),"aria-label":n,className:"wp-block-query-pagination-next block-editor-block-list__block"},n))}const{namespace:g}=window._activityPubOptions;function y(e){let{selectedUser:a,per_page:n,order:l,title:o,page:i,setPage:p,className:m="",followLinks:b=!0,followerData:w=!1}=e;const d="site"===a?0:a,[y,k]=(0,s.useState)([]),[E,_]=(0,s.useState)(0),[x,C]=(0,s.useState)(0),[S,O]=function(){const[e,t]=(0,s.useState)(1);return[e,t]}(),N=i||S,P=p||O,L=(0,t.createInterpolateElement)(/* translators: arrow for previous followers link */ -(0,c.__)(" Less","activitypub"),{span:(0,t.createElement)("span",{class:"wp-block-query-pagination-previous-arrow is-arrow-arrow","aria-hidden":"true"})}),j=(0,t.createInterpolateElement)(/* translators: arrow for next followers link */ -(0,c.__)("More ","activitypub"),{span:(0,t.createElement)("span",{class:"wp-block-query-pagination-next-arrow is-arrow-arrow","aria-hidden":"true"})}),M=(e,t)=>{k(e),C(t),_(Math.ceil(t/n))};return(0,s.useEffect)((()=>{if(w&&1===N)return M(w.followers,w.total);const e=function(e,t,a,n){const l=`/${g}/users/${e}/followers`,r={per_page:t,order:a,page:n,context:"full"};return(0,v.addQueryArgs)(l,r)}(d,n,l,N);u()({path:e}).then((e=>M(e.orderedItems,e.totalItems))).catch((()=>{}))}),[d,n,l,N,w]),(0,t.createElement)("div",{className:"activitypub-follower-block "+m},(0,t.createElement)("h3",null,o),(0,t.createElement)("ul",null,y&&y.map((e=>(0,t.createElement)("li",{key:e.url},(0,t.createElement)(h,r({},e,{followLinks:b})))))),E>1&&(0,t.createElement)(f,{page:N,perPage:n,total:x,pageClick:P,nextLabel:j,prevLabel:L,compact:"is-style-compact"===m}))}function h(e){let{name:a,icon:n,url:l,preferredUsername:i,followLinks:c=!0}=e;const s=`@${i}`,p={};return c||(p.onClick=e=>e.preventDefault()),(0,t.createElement)(o.ExternalLink,r({className:"activitypub-link",href:l,title:s},p),(0,t.createElement)("img",{width:"40",height:"40",src:n.url,class:"avatar activitypub-avatar"}),(0,t.createElement)("span",{class:"activitypub-actor"},(0,t.createElement)("strong",{className:"activitypub-name"},a),(0,t.createElement)("span",{class:"sep"},"/"),(0,t.createElement)("span",{class:"activitypub-handle"},s)))}const k=window.wp.data,E=window._activityPubOptions?.enabled;(0,e.registerBlockType)("activitypub/followers",{edit:function(e){let{attributes:a,setAttributes:n}=e;const{order:l,per_page:s,selectedUser:p,title:u}=a,v=(0,i.useBlockProps)(),[m,b]=(0,t.useState)(1),w=[{label:(0,c.__)("New to old","activitypub"),value:"desc"},{label:(0,c.__)("Old to new","activitypub"),value:"asc"}],d=function(){const e=E?.users?(0,k.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,t.useMemo)((()=>{if(!e)return[];const t=E?.site?[{label:(0,c.__)("Whole Site","activitypub"),value:"site"}]:[];return e.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),t)}),[e])}(),f=e=>t=>{b(1),n({[e]:t})};return(0,t.useEffect)((()=>{d.length&&(d.find((e=>{let{value:t}=e;return t===p}))||n({selectedUser:d[0].value}))}),[p,d]),(0,t.createElement)("div",v,(0,t.createElement)(i.InspectorControls,{key:"setting"},(0,t.createElement)(o.PanelBody,{title:(0,c.__)("Followers Options","activitypub")},(0,t.createElement)(o.TextControl,{label:(0,c.__)("Title","activitypub"),help:(0,c.__)("Title to display above the list of followers. Blank for none.","activitypub"),value:u,onChange:e=>n({title:e})}),d.length>1&&(0,t.createElement)(o.SelectControl,{label:(0,c.__)("Select User","activitypub"),value:p,options:d,onChange:f("selectedUser")}),(0,t.createElement)(o.SelectControl,{label:(0,c.__)("Sort","activitypub"),value:l,options:w,onChange:f("order")}),(0,t.createElement)(o.RangeControl,{label:(0,c.__)("Number of Followers","activitypub"),value:s,onChange:f("per_page"),min:1,max:10}))),(0,t.createElement)(y,r({},a,{page:m,setPage:b,followLinks:!1})))},save:()=>null,icon:l})})()})(); \ No newline at end of file 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 6a045bb0..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' => 'f0e21057f7ec615290d6'); 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 3d0cbc1f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.js +++ /dev/null @@ -1,3 +0,0 @@ -(()=>{var e,t={189:(e,t,a)=>{"use strict";const r=window.wp.element;function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.preventDefault(),!t&&l(n)}},a)}const v={outlined:"outlined",minimal:"minimal"};function f(e){let{compact:t,nextLabel:a,page:n,pageClick:l,perPage:o,prevLabel:i,total:c,variant:s=v.outlined}=e;const p=((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})(n,Math.ceil(c/o)),f=u()("alignwide wp-block-query-pagination is-content-justification-space-between is-layout-flex wp-block-query-pagination-is-layout-flex",`is-${s}`,{"is-compact":t});return(0,r.createElement)("nav",{className:f},i&&(0,r.createElement)(m,{key:"prev",page:n-1,pageClick:l,active:1===n,"aria-label":i,className:"wp-block-query-pagination-previous block-editor-block-list__block"},i),!t&&(0,r.createElement)("div",{className:"block-editor-block-list__block wp-block wp-block-query-pagination-numbers"},p.map((e=>(0,r.createElement)(m,{key:e,page:e,pageClick:l,active:e===n,className:"page-numbers"},e)))),a&&(0,r.createElement)(m,{key:"next",page:n+1,pageClick:l,active:n===Math.ceil(c/o),"aria-label":a,className:"wp-block-query-pagination-next block-editor-block-list__block"},a))}const b=window.wp.components,{namespace:d}=window._activityPubOptions;function w(e){let{selectedUser:t,per_page:a,order:o,title:p,page:u,setPage:m,className:v="",followLinks:b=!0,followerData:w=!1}=e;const y="site"===t?0:t,[k,h]=(0,l.useState)([]),[E,O]=(0,l.useState)(0),[x,_]=(0,l.useState)(0),[N,j]=function(){const[e,t]=(0,l.useState)(1);return[e,t]}(),S=u||N,C=m||j,L=(0,r.createInterpolateElement)(/* translators: arrow for previous followers link */ -(0,s.__)(" Less","activitypub"),{span:(0,r.createElement)("span",{class:"wp-block-query-pagination-previous-arrow is-arrow-arrow","aria-hidden":"true"})}),q=(0,r.createInterpolateElement)(/* translators: arrow for next followers link */ -(0,s.__)("More ","activitypub"),{span:(0,r.createElement)("span",{class:"wp-block-query-pagination-next-arrow is-arrow-arrow","aria-hidden":"true"})}),P=(e,t)=>{h(e),_(t),O(Math.ceil(t/a))};return(0,l.useEffect)((()=>{if(w&&1===S)return P(w.followers,w.total);const e=function(e,t,a,r){const n=`/${d}/users/${e}/followers`,l={per_page:t,order:a,page:r,context:"full"};return(0,c.addQueryArgs)(n,l)}(y,a,o,S);i()({path:e}).then((e=>P(e.orderedItems,e.totalItems))).catch((()=>{}))}),[y,a,o,S,w]),(0,r.createElement)("div",{className:"activitypub-follower-block "+v},(0,r.createElement)("h3",null,p),(0,r.createElement)("ul",null,k&&k.map((e=>(0,r.createElement)("li",{key:e.url},(0,r.createElement)(g,n({},e,{followLinks:b})))))),E>1&&(0,r.createElement)(f,{page:S,perPage:a,total:x,pageClick:C,nextLabel:q,prevLabel:L,compact:"is-style-compact"===v}))}function g(e){let{name:t,icon:a,url:l,preferredUsername:o,followLinks:i=!0}=e;const c=`@${o}`,s={};return i||(s.onClick=e=>e.preventDefault()),(0,r.createElement)(b.ExternalLink,n({className:"activitypub-link",href:l,title:c},s),(0,r.createElement)("img",{width:"40",height:"40",src:a.url,class:"avatar activitypub-avatar"}),(0,r.createElement)("span",{class:"activitypub-actor"},(0,r.createElement)("strong",{className:"activitypub-name"},t),(0,r.createElement)("span",{class:"sep"},"/"),(0,r.createElement)("span",{class:"activitypub-handle"},c)))}const y=window.wp.domReady;a.n(y)()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-follower-block"),(e=>{const t=JSON.parse(e.dataset.attrs);(0,r.render)((0,r.createElement)(w,t),e)}))}))},184:(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={638:0,962: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(189)));n=r.O(n)})(); \ No newline at end of file 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 6c598662..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-activity.php +++ /dev/null @@ -1,223 +0,0 @@ - 'as:manuallyApprovesFollowers', - 'PropertyValue' => 'schema:PropertyValue', - 'schema' => 'http://schema.org#', - 'pt' => 'https://joinpeertube.org/ns#', - 'toot' => 'http://joinmastodon.org/ns#', - 'webfinger' => 'https://webfinger.net/#', - 'litepub' => 'http://litepub.social/ns#', - 'lemmy' => 'https://join-lemmy.org/ns#', - 'value' => 'schema:value', - 'Hashtag' => 'as:Hashtag', - 'featured' => array( - '@id' => 'toot:featured', - '@type' => '@id', - ), - 'featuredTags' => array( - '@id' => 'toot:featuredTags', - '@type' => '@id', - ), - 'alsoKnownAs' => array( - '@id' => 'as:alsoKnownAs', - '@type' => '@id', - ), - 'moderators' => array( - '@id' => 'lemmy:moderators', - '@type' => '@id', - ), - 'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods', - 'discoverable' => 'toot:discoverable', - 'indexable' => 'toot:indexable', - 'sensitive' => 'as:sensitive', - 'resource' => 'webfinger:resource', - ), - ); - - /** - * The object's unique global identifier - * - * @see https://www.w3.org/TR/activitypub/#obj-id - * - * @var string - */ - protected $id; - - /** - * @var string - */ - protected $type = 'Activity'; - - /** - * 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 = self::CONTEXT; - - /** - * Describes the direct object of the activity. - * For instance, in the activity "John added a movie to his - * wishlist", the object of the activity is the movie added. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object-term - * - * @var string - * | Base_Objectr - * | Link - * | null - */ - protected $object; - - /** - * Describes one or more entities that either performed or are - * expected to perform the activity. - * Any single activity can have multiple actors. - * The actor MAY be specified using an indirect Link. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-actor - * - * @var string - * | \ActivityPhp\Type\Extended\AbstractActor - * | array - * | 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 ) { - $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() ) { - $this->set( 'id', $object->get_id() . '#activity' ); - } - } -} 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 fabd653c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-actor.php +++ /dev/null @@ -1,139 +0,0 @@ - '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 - * - * @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 a75ed16d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-base-object.php +++ /dev/null @@ -1,678 +0,0 @@ - - * | 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 ) { - $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->$key; - } - - /** - * 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 ); - $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 ); - $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. - * - * @return array An array built from the Object. - */ - public function to_array() { - $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(); - } - - // if value is still empty, ignore it for the array and continue. - if ( isset( $value ) ) { - $array[ snake_to_camel_case( $key ) ] = $value; - } - } - - // replace 'context' key with '@context' and move it to the top. - if ( array_key_exists( 'context', $array ) ) { - $context = $array['context']; - unset( $array['context'] ); - $array = array_merge( array( '@context' => $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. - * - * @return string The JSON string. - */ - public function to_json() { - $array = $this->to_array(); - - return \wp_json_encode( $array, \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT ); - } -} 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 462a75af..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activity-dispatcher.php +++ /dev/null @@ -1,125 +0,0 @@ -post_author = Users::BLOG_USER_ID; - - if ( is_single_user() ) { - self::send_activity( $wp_post, $type ); - } else { - self::send_announce( $wp_post, $type ); - } - } - - /** - * Send Activities to followers and mentioned users. - * - * @param WP_Post $wp_post The ActivityPub Post. - * @param string $type The Activity-Type. - * - * @return void - */ - public static function send_activity( WP_Post $wp_post, $type ) { - if ( is_user_disabled( $wp_post->post_author ) ) { - return; - } - - $object = Post::transform( $wp_post )->to_object(); - - $activity = new Activity(); - $activity->set_type( $type ); - $activity->set_object( $object ); - - $follower_inboxes = Followers::get_inboxes( $wp_post->post_author ); - $mentioned_inboxes = Mention::get_inboxes( $activity->get_cc() ); - - $inboxes = array_merge( $follower_inboxes, $mentioned_inboxes ); - $inboxes = array_unique( $inboxes ); - - $json = $activity->to_json(); - - foreach ( $inboxes as $inbox ) { - safe_remote_post( $inbox, $json, $wp_post->post_author ); - } - } - - /** - * Send Announces to followers and mentioned users. - * - * @param WP_Post $wp_post The ActivityPub Post. - * @param string $type The Activity-Type. - * - * @return void - */ - public static function send_announce( WP_Post $wp_post, $type ) { - if ( ! in_array( $type, array( 'Create', 'Update' ), true ) ) { - return; - } - - if ( is_user_disabled( Users::BLOG_USER_ID ) ) { - return; - } - - $object = Post::transform( $wp_post )->to_object(); - - $activity = new Activity(); - $activity->set_type( 'Announce' ); - // to pre-fill attributes like "published" and "id" - $activity->set_object( $object ); - // send only the id - $activity->set_object( $object->get_id() ); - - $follower_inboxes = Followers::get_inboxes( $wp_post->post_author ); - $mentioned_inboxes = Mention::get_inboxes( $activity->get_cc() ); - - $inboxes = array_merge( $follower_inboxes, $mentioned_inboxes ); - $inboxes = array_unique( $inboxes ); - - $json = $activity->to_json(); - - foreach ( $inboxes as $inbox ) { - safe_remote_post( $inbox, $json, $wp_post->post_author ); - } - } -} 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 24228f43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activitypub.php +++ /dev/null @@ -1,331 +0,0 @@ -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 ( ! isset( $args['class'] ) || ! \is_array( $args['class'] ) ) { - $args['class'] = array( 'u-photo' ); - } else { - $args['class'][] = 'u-photo'; - $args['class'] = \array_unique( $args['class'] ); - } - $args['url'] = $avatar; - $args['class'][] = 'avatar-activitypub'; - } - - 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 ); - } - - /** - * 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 ) { - $remote_comment_link = get_comment_meta( $comment->comment_ID, 'source_url', true ); - if ( $remote_comment_link ) { - $comment_link = esc_url( $remote_comment_link ); - } - return $comment_link; - } - - /** - * 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 . '/users/$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 ); - } - } - - /** - * 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(), - ) - ) - ); - } -} 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 f8afc8d2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-admin.php +++ /dev/null @@ -1,275 +0,0 @@ - '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', - 'article', - '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', 'pages' ), - ) - ); - \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_User::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_User::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(), '1.0.0' ); - wp_enqueue_script( 'activitypub-admin-styles', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false ); - } - } -} 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 02f96591..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-blocks.php +++ /dev/null @@ -1,151 +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', 'resource' ) - ); - } - $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( $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-debug.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-debug.php deleted file mode 100644 index 36f8bda5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-debug.php +++ /dev/null @@ -1,36 +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 ) { - $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_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 74a6f9ec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-health-check.php +++ /dev/null @@ -1,377 +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' ), - ); - - $tests['direct']['activitypub_test_system_cron'] = array( - 'label' => __( 'System Cron Test', 'activitypub' ), - 'test' => array( self::class, 'test_system_cron' ), - ); - - 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 = \wp_get_current_user(); - - if ( ! is_user_type_disabled( 'blog' ) ) { - $account = get_webfinger_resource( $user->ID ); - } elseif ( ! is_user_type_disabled( 'user' ) ) { - $account = get_webfinger_resource( Users::BLOG_USER_ID ); - } else { - $account = ''; - } - - $url = Webfinger::resolve( $account ); - 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 f9140bed..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-http.php +++ /dev/null @@ -1,111 +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 int $user_id The WordPress User-ID - * - * @return array|WP_Error The GET Response or an WP_ERROR - */ - public static function get( $url ) { - do_action( 'activitypub_pre_http_get', $url ); - - $date = \gmdate( 'D, d M Y H:i:s T' ); - $signature = Signature::generate_signature( Users::APPLICATION_USER_ID, 'get', $url, $date ); - - $wp_version = \get_bloginfo( '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 ); - - return $response; - } -} 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 d55e5f20..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-mention.php +++ /dev/null @@ -1,169 +0,0 @@ -$#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['url'] ) ) { - $username = ltrim( $result[0], '@' ); - if ( ! empty( $metadata['name'] ) ) { - $username = $metadata['name']; - } - if ( ! empty( $metadata['preferredUsername'] ) ) { - $username = $metadata['preferredUsername']; - } - return \sprintf( '@%s', esc_url( $metadata['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 cd13f8d2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-migration.php +++ /dev/null @@ -1,179 +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(); - } - - /** - * Updates the custom template to use shortcodes instead of the deprecated templates. - * - * @return void - */ - private static function migrate_from_0_16() { - // Get the custom template. - $old_content = \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT ); - - // If the old content exists but is a blank string, we're going to need a flag to updated it even - // after setting it to the default contents. - $need_update = false; - - // If the old contents is blank, use the defaults. - if ( '' === $old_content ) { - $old_content = ACTIVITYPUB_CUSTOM_POST_CONTENT; - $need_update = true; - } - - // Set the new content to be the old content. - $content = $old_content; - - // Convert old templates to shortcodes. - $content = \str_replace( '%title%', '[ap_title]', $content ); - $content = \str_replace( '%excerpt%', '[ap_excerpt]', $content ); - $content = \str_replace( '%content%', '[ap_content]', $content ); - $content = \str_replace( '%permalink%', '[ap_permalink type="html"]', $content ); - $content = \str_replace( '%shortlink%', '[ap_shortlink type="html"]', $content ); - $content = \str_replace( '%hashtags%', '[ap_hashtags]', $content ); - $content = \str_replace( '%tags%', '[ap_hashtags]', $content ); - - // Store the new template if required. - if ( $content !== $old_content || $need_update ) { - \update_option( 'activitypub_custom_post_content', $content ); - } - } -} 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 63f92732..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-scheduler.php +++ /dev/null @@ -1,169 +0,0 @@ -post_type, $post_types, true ) ) { - return; - } - - $type = false; - - if ( 'publish' === $new_status && 'publish' !== $old_status ) { - $type = 'Create'; - } elseif ( 'publish' === $new_status ) { - $type = 'Update'; - } elseif ( 'trash' === $new_status ) { - $type = 'Delete'; - } - - if ( ! $type ) { - return; - } - - \wp_schedule_single_event( - \time(), - 'activitypub_send_activity', - array( $post, $type ) - ); - - \wp_schedule_single_event( - \time(), - sprintf( - 'activitypub_send_%s_activity', - \strtolower( $type ) - ), - array( $post ) - ); - } - - /** - * Update followers - * - * @return void - */ - public static function update_followers() { - $number = 5; - - if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { - $number = 50; - } - - $followers = Followers::get_outdated_followers( $number ); - - foreach ( $followers as $follower ) { - $meta = get_remote_metadata_by_actor( $follower->get_url(), 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; - } - - $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(); - } else { - Followers::add_error( $follower->get__id(), $meta ); - } - } else { - $follower->reset_errors(); - } - } - } - - /** - * Schedule migration if DB-Version is not up to date. - * - * @return void - */ - public static function schedule_migration() { - if ( ! \wp_next_scheduled( 'activitypub_schedule_migration' ) && ! Migration::is_latest_version() ) { - \wp_schedule_single_event( \time(), 'activitypub_schedule_migration' ); - } - } -} 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 43be17b0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-shortcodes.php +++ /dev/null @@ -1,576 +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 ( '' === $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 ); - - /** This filter is documented in wp-includes/formatting.php */ - $excerpt_more = \apply_filters( '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 = \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 ''; - } - - $name = \get_the_author_meta( 'display_name', $item->post_author ); - - 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 ''; - } - - $url = \get_the_author_meta( 'user_url', $item->post_author ); - - 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 1789dd67..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-signature.php +++ /dev/null @@ -1,490 +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_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' => 403 ) ); - } - - 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' => 403 ) ); - } - - $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' => 403 ) ); - } - - $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' => 403 ) ); - } - - if ( \in_array( 'digest', $signed_headers, true ) && isset( $body ) ) { - if ( is_array( $headers['digest'] ) ) { - $headers['digest'] = $headers['digest'][0]; - } - $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' => 403 ) ); - } - } - - $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' => 403 ) ); - } - 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. - */ - 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 $actor; - } - 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' => 403 ) ); - } - - /** - * 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 ( '(expires)' === $header ) { - if ( ! empty( $signature_block['(expires)'] ) && \intval( $signature_block['(expires)'] ) < \time() ) { - // expired in past - return false; - } - } - 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 b6b0a64e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-webfinger.php +++ /dev/null @@ -1,203 +0,0 @@ -get_resource(); - } - - /** - * Resolve a WebFinger resource - * - * @param string $resource The WebFinger resource - * - * @return string|WP_Error The URL or WP_Error - */ - public static function resolve( $resource ) { - if ( ! preg_match( '/^@?' . ACTIVITYPUB_USERNAME_REGEXP . '$/i', $resource, $m ) ) { - return null; - } - $transient_key = 'activitypub_resolve_' . ltrim( $resource, '@' ); - - $link = \get_transient( $transient_key ); - if ( $link ) { - return $link; - } - - $url = \add_query_arg( 'resource', 'acct:' . ltrim( $resource, '@' ), 'https://' . $m[2] . '/.well-known/webfinger' ); - if ( ! \wp_http_validate_url( $url ) ) { - $response = new WP_Error( 'invalid_webfinger_url', null, $url ); - \set_transient( $transient_key, $response, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $response; - } - - // try to access author URL - $response = \wp_remote_get( - $url, - array( - 'headers' => array( 'Accept' => 'application/jrd+json' ), - 'redirection' => 2, - 'timeout' => 2, - ) - ); - - if ( \is_wp_error( $response ) ) { - $link = new WP_Error( 'webfinger_url_not_accessible', null, $url ); - \set_transient( $transient_key, $link, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $link; - } - - $body = \wp_remote_retrieve_body( $response ); - $body = \json_decode( $body, true ); - - if ( empty( $body['links'] ) ) { - $link = new WP_Error( 'webfinger_url_invalid_response', null, $url ); - \set_transient( $transient_key, $link, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $link; - } - - foreach ( $body['links'] as $link ) { - if ( 'self' === $link['rel'] && 'application/activity+json' === $link['type'] ) { - \set_transient( $transient_key, $link['href'], WEEK_IN_SECONDS ); - return $link['href']; - } - } - - $link = new WP_Error( 'webfinger_url_no_activitypub', null, $body ); - \set_transient( $transient_key, $link, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $link; - } - - /** - * 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 ) { - // 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( 'invalid_identifier', __( 'Invalid Identifier', 'activitypub' ) ); - } - - return array( $identifier, $host ); - } - - /** - * Get the WebFinger data for a given URI - * - * @param string $identifier The Identifier: @ - * @param string $host The Host: @ - * - * @return WP_Error|array Error reaction or array with - * identifier and host as values - */ - public static function get_data( $identifier, $host ) { - $webfinger_url = 'https://' . $host . '/.well-known/webfinger?resource=' . rawurlencode( $identifier ); - - $response = wp_safe_remote_get( - $webfinger_url, - array( - 'headers' => array( 'Accept' => 'application/jrd+json' ), - 'redirection' => 0, - 'timeout' => 2, - ) - ); - - if ( is_wp_error( $response ) ) { - return new WP_Error( 'webfinger_url_not_accessible', null, $webfinger_url ); - } - - $body = wp_remote_retrieve_body( $response ); - - return json_decode( $body, true ); - } - - /** - * Undocumented function - * - * @return void - */ - public static function get_remote_follow_endpoint( $uri ) { - $identifier_and_host = self::get_identifier_and_host( $uri ); - - if ( is_wp_error( $identifier_and_host ) ) { - return $identifier_and_host; - } - - list( $identifier, $host ) = $identifier_and_host; - - $data = self::get_data( $identifier, $host ); - - if ( is_wp_error( $data ) ) { - return $data; - } - - if ( empty( $data['links'] ) ) { - return new WP_Error( 'webfinger_url_invalid_response', null, $data ); - } - - foreach ( $data['links'] as $link ) { - if ( 'http://ostatus.org/schema/1.0/subscribe' === $link['rel'] ) { - return $link['template']; - } - } - - return new WP_Error( 'webfinger_remote_follow_endpoint_invalid', $data, array( 'status' => 417 ) ); - } -} 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 a9fe2981..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-followers.php +++ /dev/null @@ -1,591 +0,0 @@ - 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( - self::POST_TYPE, - 'activitypub_inbox', - array( - 'type' => 'string', - 'single' => true, - 'sanitize_callback' => array( self::class, 'sanitize_url' ), - ) - ); - - register_post_meta( - self::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( - self::POST_TYPE, - 'activitypub_user_id', - array( - 'type' => 'string', - 'single' => false, - 'sanitize_callback' => function( $value ) { - return esc_sql( $value ); - }, - ) - ); - - register_post_meta( - self::POST_TYPE, - 'activitypub_actor_json', - array( - 'type' => 'string', - 'single' => true, - 'sanitize_callback' => function( $value ) { - return sanitize_text_field( $value ); - }, - ) - ); - - do_action( 'activitypub_after_register_post_type' ); - } - - public static function sanitize_url( $value ) { - if ( filter_var( $value, FILTER_VALIDATE_URL ) === false ) { - return null; - } - - return esc_url_raw( $value ); - } - - /** - * Handle the "Follow" Request - * - * @param array $object The JSON "Follow" Activity - * @param int $user_id The ID of the ID of the WordPress User - * - * @return void - */ - public static function handle_follow_request( $object, $user_id ) { - // save follower - $follower = self::add_follower( $user_id, $object['actor'] ); - - do_action( 'activitypub_followers_post_follow', $object['actor'], $object, $user_id, $follower ); - } - - /** - * Handle "Unfollow" requests - * - * @param array $object The JSON "Undo" Activity - * @param int $user_id The ID of the ID of the WordPress User - */ - public static function handle_undo_request( $object, $user_id ) { - if ( - isset( $object['object'] ) && - isset( $object['object']['type'] ) && - 'Follow' === $object['object']['type'] - ) { - self::remove_follower( $user_id, $object['actor'] ); - } - } - - /** - * Add new Follower - * - * @param int $user_id The ID of the WordPress User - * @param string $actor The Actor URL - * - * @return array|WP_Error The Follower (WP_Post array) or an WP_Error - */ - public static function add_follower( $user_id, $actor ) { - $meta = get_remote_metadata_by_actor( $actor ); - - if ( is_tombstone( $meta ) ) { - return $meta; - } - - if ( empty( $meta ) || ! is_array( $meta ) || is_wp_error( $meta ) ) { - return new WP_Error( 'activitypub_invalid_follower', __( 'Invalid Follower', 'activitypub' ), array( 'status' => 400 ) ); - } - - $error = null; - - $follower = new Follower(); - $follower->from_array( $meta ); - - $id = $follower->upsert(); - - if ( is_wp_error( $id ) ) { - return $id; - } - - $meta = get_post_meta( $id, 'activitypub_user_id' ); - - if ( $error ) { - self::add_error( $id, $error ); - } - - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict - if ( is_array( $meta ) && ! in_array( $user_id, $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 The Follower object - */ - public static function get_follower( $user_id, $actor ) { - global $wpdb; - - $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; - } - - /** - * 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 ); - } - - /** - * 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( - // 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( - '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-users.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-users.php deleted file mode 100644 index f6e35a64..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-users.php +++ /dev/null @@ -1,209 +0,0 @@ - 404 ) - ); - } - - if ( self::BLOG_USER_ID === $user_id ) { - return Blog_User::from_wp_user( $user_id ); - } elseif ( self::APPLICATION_USER_ID === $user_id ) { - return Application_User::from_wp_user( $user_id ); - } 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_User::get_default_username() === $username ) { - return self::get_by_id( self::BLOG_USER_ID ); - } - - if ( get_option( 'activitypub_blog_user_identifier' ) === $username ) { - return self::get_by_id( self::BLOG_USER_ID ); - } - - // check for application user. - if ( 'application' === $username ) { - return self::get_by_id( self::APPLICATION_USER_ID ); - } - - // check for 'activitypub_username' meta - $user = new WP_User_Query( - array( - '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] ); - } - - // check for login or nicename. - $user = new WP_User_Query( - array( - '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 ) { - if ( \strpos( $resource, '@' ) === false ) { - return new WP_Error( - 'activitypub_unsupported_resource', - \__( 'Resource is invalid', 'activitypub' ), - array( 'status' => 400 ) - ); - } - - $resource = \str_replace( 'acct:', '', $resource ); - - $resource_identifier = \substr( $resource, 0, \strrpos( $resource, '@' ) ); - $resource_host = self::normalize_host( \substr( \strrchr( $resource, '@' ), 1 ) ); - $blog_host = self::normalize_host( \wp_parse_url( \home_url( '/' ), \PHP_URL_HOST ) ); - - if ( $blog_host !== $resource_host ) { - return new WP_Error( - 'activitypub_wrong_host', - \__( 'Resource host does not match blog host', 'activitypub' ), - array( 'status' => 404 ) - ); - } - - return self::get_by_username( $resource_identifier ); - } - - /** - * Get the User by resource. - * - * @param string $resource The User-Resource. - * - * @return \Acitvitypub\Model\User The User. - */ - public static function get_by_various( $id ) { - if ( is_numeric( $id ) ) { - return self::get_by_id( $id ); - } elseif ( filter_var( $id, FILTER_VALIDATE_URL ) ) { - return self::get_by_resource( $id ); - } else { - return self::get_by_username( $id ); - } - } - - /** - * Normalize the host. - * - * @param string $host The host. - * - * @return string The normalized host. - */ - public static function normalize_host( $host ) { - return \str_replace( 'www.', '', $host ); - } - - /** - * Get the User collection. - * - * @return array The User collection. - */ - public static function get_collection() { - $users = \get_users( - array( - 'capability__in' => array( 'publish_posts' ), - ) - ); - - $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 4bee6402..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/compat.php +++ /dev/null @@ -1,37 +0,0 @@ - 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 ) ); - \set_transient( $transient_key, $metadata, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $metadata; - } - - $short_timeout = function() { - return 3; - }; - add_filter( 'activitypub_remote_get_timeout', $short_timeout ); - $response = Http::get( $actor ); - remove_filter( 'activitypub_remote_get_timeout', $short_timeout ); - if ( \is_wp_error( $response ) ) { - \set_transient( $transient_key, $response, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $response; - } - - $metadata = \wp_remote_retrieve_body( $response ); - $metadata = \json_decode( $metadata, true ); - - \set_transient( $transient_key, $metadata, WEEK_IN_SECONDS ); - - if ( ! $metadata ) { - $metadata = new WP_Error( 'activitypub_invalid_json', \__( 'No valid JSON data', 'activitypub' ), array( 'status' => 400, 'actor' => $actor ) ); - \set_transient( $transient_key, $metadata, HOUR_IN_SECONDS ); // Cache the error for a shorter period. - return $metadata; - } - - 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( \site_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; -} - -/** - * 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, 'publish_posts' ) ) { - $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 ) ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/help.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/help.php deleted file mode 100644 index 3f0c7b9d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/help.php +++ /dev/null @@ -1,75 +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 lenght="400"]
' . - '
' . \wp_kses( __( 'The post\'s excerpt (default 400 chars). length attribute is optional.', '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-user.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-application-user.php deleted file mode 100644 index 1cfcec0e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-application-user.php +++ /dev/null @@ -1,72 +0,0 @@ - 404 ) - ); - } - - $object = new static(); - $object->_id = $user_id; - - return $object; - } - - /** - * 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() ); - } - - /** - * Returns the User-URL with @-Prefix for the username. - * - * @return string The User-URL with @-Prefix for the username. - */ - public function get_at_url() { - return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() ); - } - - /** - * 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_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 ); - } - - public function get_attachment() { - return array(); - } - - 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_posting_restricted_to_mods() { - if ( 'Group' === $this->get_type() ) { - return true; - } - - return null; - } -} 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 7cf6dd46..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-follower.php +++ /dev/null @@ -1,366 +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 ); - } - } - - $args = array( - 'ID' => $this->get__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(), - ); - - $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 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_published ) ) ); - $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 d967ad9a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-post.php +++ /dev/null @@ -1,131 +0,0 @@ -post = $post; - $this->object = Post_Transformer::transform( $post )->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 = User_Factory::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 f62772d3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-user.php +++ /dev/null @@ -1,318 +0,0 @@ - - */ - protected $resource; - - /** - * Restrict posting to mods - * - * @see https://join-lemmy.org/docs/contributors/05-federation.html - * - * @var boolean - */ - protected $posting_restricted_to_mods = null; - - 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_at_url() { - return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_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( 'users/%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( 'users/%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( 'users/%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( 'users/%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( 'users/%d/collections/featured', $this->get__id() ) ); - } - - /** - * Returns the Featured-Tags-API-Endpoint. - * - * @return string The Featured-Tags-Endpoint. - */ - public function get_featured_tags() { - return get_rest_url_by_path( sprintf( 'users/%d/collections/tags', $this->get__id() ) ); - } - - /** - * 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( - '' . \wp_parse_url( \home_url( '/' ), \PHP_URL_HOST ) . '', - \ENT_QUOTES, - 'UTF-8' - ), - ); - - $array[] = array( - 'type' => 'PropertyValue', - 'name' => \__( 'Profile', 'activitypub' ), - 'value' => \html_entity_decode( - '' . \wp_parse_url( \get_author_posts_url( $this->get__id() ), \PHP_URL_HOST ) . '', - \ENT_QUOTES, - 'UTF-8' - ), - ); - - if ( \get_the_author_meta( 'user_url', $this->get__id() ) ) { - $array[] = array( - 'type' => 'PropertyValue', - 'name' => \__( 'Website', 'activitypub' ), - 'value' => \html_entity_decode( - '' . \wp_parse_url( \get_the_author_meta( 'user_url', $this->get__id() ), \PHP_URL_HOST ) . '', - \ENT_QUOTES, - 'UTF-8' - ), - ); - } - - return $array; - } - - /** - * Returns a user@domain type of identifier for the user. - * - * @return string The Webfinger-Identifier. - */ - public function get_resource() { - 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/peer/class-followers.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/peer/class-followers.php deleted file mode 100644 index e0e6ddba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/peer/class-followers.php +++ /dev/null @@ -1,34 +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/(?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' => Activity::CONTEXT, - 'id' => get_rest_url_by_path( sprintf( 'users/%d/collections/tags', $user->get__id() ) ), - 'type' => 'Collection', - 'totalItems' => count( $tags ), - 'items' => array(), - ); - - foreach ( $tags as $tag ) { - $response['items'][] = array( - 'type' => 'Hashtag', - 'href' => \esc_url( \get_tag_link( $tag ) ), - 'name' => esc_hashtag( $tag->name ), - ); - } - - return new WP_REST_Response( $response, 200 ); - } - - /** - * 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' => Activity::CONTEXT, - 'id' => get_rest_url_by_path( sprintf( 'users/%d/collections/featured', $user_id ) ), - 'type' => 'OrderedCollection', - 'totalItems' => count( $posts ), - 'orderedItems' => array(), - ); - - foreach ( $posts as $post ) { - $response['orderedItems'][] = Post::transform( $post )->to_object()->to_array(); - } - - return new WP_REST_Response( $response, 200 ); - } - - /** - * 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' => Activity::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(); - } - - return new WP_REST_Response( $response, 200 ); - } - - /** - * 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-followers.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-followers.php deleted file mode 100644 index b7be9d02..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-followers.php +++ /dev/null @@ -1,149 +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( 'users/%d/followers', $user->get__id() ) ); - $json->generator = 'http://wordpress.org/?v=' . \get_bloginfo_rss( 'version' ); - $json->actor = $user->get_id(); - $json->type = 'OrderedCollectionPage'; - - $json->totalItems = $data['total']; // phpcs:ignore - $json->partOf = get_rest_url_by_path( sprintf( 'users/%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(); - } - return $item->get_url(); - }, - $data['followers'] - ); - - $response = new WP_REST_Response( $json, 200 ); - $response->header( 'Content-Type', 'application/activity+json' ); - - return $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 33bdf650..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-following.php +++ /dev/null @@ -1,130 +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( 'users/%d/following', $user->get__id() ) ); - $json->generator = 'http://wordpress.org/?v=' . \get_bloginfo_rss( 'version' ); - $json->actor = $user->get_id(); - $json->type = 'OrderedCollectionPage'; - - $json->partOf = get_rest_url_by_path( sprintf( 'users/%d/following', $user->get__id() ) ); // phpcs:ignore - - $items = apply_filters( 'activitypub_rest_following', array(), $user ); // phpcs:ignore - - $json->totalItems = count( $items ); // phpcs:ignore - $json->orderedItems = $items; // phpcs:ignore - - $json->first = $json->partOf; // phpcs:ignore - - $response = new \WP_REST_Response( $json, 200 ); - $response->header( 'Content-Type', 'application/activity+json' ); - - return $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 5d65b9b8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-inbox.php +++ /dev/null @@ -1,481 +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/(?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( 'users/%d/inbox', $user->get__id() ) ); - $json->generator = 'http://wordpress.org/?v=' . \get_bloginfo_rss( 'version' ); - $json->type = 'OrderedCollectionPage'; - $json->partOf = get_rest_url_by_path( sprintf( 'users/%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' ); - - $response = new WP_REST_Response( $json, 200 ); - - $response->header( 'Content-Type', 'application/activity+json' ); - - return $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(); - $type = $request->get_param( 'type' ); - $type = \strtolower( $type ); - - \do_action( 'activitypub_inbox', $data, $user->get__id(), $type ); - \do_action( "activitypub_inbox_{$type}", $data, $user->get__id() ); - - return new WP_REST_Response( array(), 202 ); - } - - /** - * The shared inbox - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function shared_inbox_post( $request ) { - $data = $request->get_json_params(); - $type = $request->get_param( 'type' ); - $users = self::extract_recipients( $data ); - - if ( ! $users ) { - return new WP_Error( - 'rest_invalid_param', - \__( 'No recipients found', 'activitypub' ), - array( - 'status' => 404, - 'params' => array( - 'to' => \__( 'Please check/validate "to" field', 'activitypub' ), - 'bto' => \__( 'Please check/validate "bto" field', 'activitypub' ), - 'cc' => \__( 'Please check/validate "cc" field', 'activitypub' ), - 'bcc' => \__( 'Please check/validate "bcc" field', 'activitypub' ), - 'audience' => \__( 'Please check/validate "audience" field', 'activitypub' ), - ), - ) - ); - } - - foreach ( $users as $user ) { - $user = User_Collection::get_by_various( $user ); - - if ( is_wp_error( $user ) ) { - continue; - } - - $type = \strtolower( $type ); - - \do_action( 'activitypub_inbox', $data, $user->ID, $type ); - \do_action( "activitypub_inbox_{$type}", $data, $user->ID ); - } - - return new WP_REST_Response( array(), 202 ); - } - - /** - * 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 ) { - if ( ! \is_string( $param ) ) { - $param = $param['id']; - } - return \esc_url_raw( $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 ) { - if ( ! \is_string( $param ) ) { - $param = $param['id']; - } - return \esc_url_raw( $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; - } - - /** - * Handles "Create" requests - * - * @param array $object The activity-object - * @param int $user_id The id of the local blog-user - */ - public static function handle_create( $object, $user_id ) { - $meta = get_remote_metadata_by_actor( $object['actor'] ); - - if ( ! isset( $object['object']['inReplyTo'] ) ) { - return; - } - - // check if Activity is public or not - if ( ! self::is_activity_public( $object ) ) { - // @todo maybe send email - return; - } - - $comment_post_id = \url_to_postid( $object['object']['inReplyTo'] ); - - // save only replys and reactions - if ( ! $comment_post_id ) { - return false; - } - - $commentdata = array( - 'comment_post_ID' => $comment_post_id, - 'comment_author' => \esc_attr( $meta['name'] ), - 'comment_author_url' => \esc_url_raw( $object['actor'] ), - 'comment_content' => \wp_filter_kses( $object['object']['content'] ), - 'comment_type' => 'comment', - 'comment_author_email' => '', - 'comment_parent' => 0, - 'comment_meta' => array( - 'source_url' => \esc_url_raw( $object['object']['url'] ), - 'avatar_url' => \esc_url_raw( $meta['icon']['url'] ), - 'protocol' => 'activitypub', - ), - ); - - // 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'; - } - ); - - $state = \wp_new_comment( $commentdata, true ); - - \remove_filter( 'pre_option_require_name_email', '__return_false' ); - - // re-add flood control - \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); - - do_action( 'activitypub_handled_create', $object, $user_id, $state, $commentdata ); - } - - /** - * Extract recipient URLs from Activity object - * - * @param array $data - * - * @return array The list of user URLs - */ - public static function extract_recipients( $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 ( 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 ); - } - - /** - * Get local user recipients - * - * @param array $data - * - * @return array The list of local users - */ - public static function get_recipients( $data ) { - $recipients = self::extract_recipients( $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; - } - - /** - * Check if passed Activity is Public - * - * @param array $data - * @return boolean - */ - public static function is_activity_public( $data ) { - $recipients = self::extract_recipients( $data ); - - return in_array( 'https://www.w3.org/ns/activitystreams#Public', $recipients, true ); - } -} 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 1f6277af..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-nodeinfo.php +++ /dev/null @@ -1,194 +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_bloginfo( 'version' ), - ); - - $users = \get_users( - array( - 'capability__in' => array( 'publish_posts' ), - ) - ); - - if ( is_array( $users ) ) { - $users = count( $users ); - } else { - $users = 1; - } - - $posts = \wp_count_posts(); - $comments = \wp_count_comments(); - - $nodeinfo['usage'] = array( - 'users' => array( - 'total' => $users, - ), - '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 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'] = '1.0'; - $nodeinfo['server'] = array( - 'baseUrl' => \home_url( '/' ), - 'name' => \get_bloginfo( 'name' ), - 'software' => 'wordpress', - 'version' => \get_bloginfo( 'version' ), - ); - - $users = \get_users( - array( - 'capability__in' => array( 'publish_posts' ), - ) - ); - - if ( is_array( $users ) ) { - $users = count( $users ); - } else { - $users = 1; - } - - $posts = \wp_count_posts(); - $comments = \wp_count_comments(); - - $nodeinfo['usage'] = array( - 'users' => array( - 'total' => (int) $users, - ), - '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' ), - ), - ); - - 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 eb35e865..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-outbox.php +++ /dev/null @@ -1,153 +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' ) ); - - $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( 'users/%d/outbox', $user_id ) ); - $json->generator = 'http://wordpress.org/?v=' . \get_bloginfo_rss( 'version' ); - $json->actor = $user->get_id(); - $json->type = 'OrderedCollectionPage'; - $json->partOf = get_rest_url_by_path( sprintf( 'users/%d/outbox', $user_id ) ); // phpcs:ignore - $json->totalItems = 0; // phpcs:ignore - - 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, - 'paged' => $page, - 'post_type' => $post_types, - ) - ); - - foreach ( $posts as $post ) { - $post = Post::transform( $post )->to_object(); - $activity = new Activity(); - $activity->set_type( 'Create' ); - $activity->set_context( null ); - $activity->set_object( $post ); - - $json->orderedItems[] = $activity->to_array(); // 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' ); - - $response = new WP_REST_Response( $json, 200 ); - - $response->header( 'Content-Type', 'application/activity+json' ); - - return $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 e1a10379..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-server.php +++ /dev/null @@ -1,105 +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_User(); - - $user->set_context( - \Activitypub\Activity\Activity::CONTEXT - ); - - $json = $user->to_array(); - - $response = new WP_REST_Response( $json, 200 ); - - $response->header( 'Content-Type', 'application/activity+json' ); - - return $response; - } - - /** - * Callback function to authorize each api requests - * - * @see WP_REST_Request - * - * @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 ) { - $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' ) - ) { - return $response; - } - - // POST-Requets are always signed - if ( 'get' !== \strtolower( $request->get_method() ) ) { - $verified_request = Signature::verify_http_signature( $request ); - if ( \is_wp_error( $verified_request ) ) { - return $verified_request; - } - } elseif ( 'get' === \strtolower( $request->get_method() ) ) { // GET-Requests are only signed in secure mode - if ( ACTIVITYPUB_AUTHORIZED_FETCH ) { - $verified_request = Signature::verify_http_signature( $request ); - if ( \is_wp_error( $verified_request ) ) { - return $verified_request; - } - } - } - - return $response; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-users.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-users.php deleted file mode 100644 index 31a92ddd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-users.php +++ /dev/null @@ -1,155 +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/(?P[\w\-\.]+)/remote-follow', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'remote_follow_get' ), - - 'args' => array( - 'resource' => array( - 'required' => true, - 'sanitize_callback' => 'sanitize_text_field', - ), - ), - '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; - } - - // 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' ); - - $user->set_context( - Activity::CONTEXT - ); - - $json = $user->to_array(); - - $response = new WP_REST_Response( $json, 200 ); - $response->header( 'Content-Type', 'application/activity+json' ); - - return $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_resource(); - $url = str_replace( '{uri}', $resource, $template ); - - return new WP_REST_Response( - array( 'url' => $url ), - 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-webfinger.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-webfinger.php deleted file mode 100644 index f69593f1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-webfinger.php +++ /dev/null @@ -1,118 +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' ); - - $resource = $request->get_param( 'resource' ); - $response = self::get_profile( $resource ); - - return new WP_REST_Response( $response, 200 ); - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['resource'] = array( - 'required' => true, - 'type' => 'string', - 'pattern' => '^acct:(.+)@(.+)$', - ); - - 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(), - ); - - $profile = array( - 'subject' => $resource, - '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(), - ), - ), - ); - - 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 289a1945..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/table/class-followers.php +++ /dev/null @@ -1,148 +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' ), - 'name' => \__( 'Name', 'activitypub' ), - 'username' => \__( 'Username', 'activitypub' ), - 'url' => \__( 'URL', 'activitypub' ), - 'updated' => \__( 'Last updated', 'activitypub' ), - //'errors' => \__( 'Errors', 'activitypub' ), - //'latest-error' => \__( 'Latest Error Message', 'activitypub' ), - ); - } - - public function get_sortable_columns() { - return array(); - } - - 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; - - $followers = FollowerCollection::get_followers( $this->user_id, $per_page, $page_num ); - $counter = FollowerCollection::count_followers( $this->user_id ); - - $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() ), - 'name' => esc_attr( $follower->get_name() ), - 'username' => esc_attr( $follower->get_preferred_username() ), - 'url' => esc_attr( $follower->get_url() ), - 'identifier' => esc_attr( $follower->get_id() ), - 'updated' => esc_attr( $follower->get_updated() ), - 'errors' => $follower->count_errors(), - 'latest-error' => $follower->get_latest_error_message(), - ); - - $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['_apnonce'] ) ) { - return false; - } - $nonce = sanitize_text_field( wp_unslash( $_REQUEST['_apnonce'] ) ); - if ( ! wp_verify_nonce( $nonce, 'activitypub-followers-list' ) ) { - 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-post.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-post.php deleted file mode 100644 index 6e2f0aa9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-post.php +++ /dev/null @@ -1,512 +0,0 @@ -wp_post = $wp_post; - } - - /** - * 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() { - $wp_post = $this->wp_post; - $object = new Base_Object(); - - $object->set_id( $this->get_id() ); - $object->set_url( $this->get_url() ); - $object->set_type( $this->get_object_type() ); - - $published = \strtotime( $wp_post->post_date_gmt ); - - $object->set_published( \gmdate( 'Y-m-d\TH:i:s\Z', $published ) ); - - $updated = \strtotime( $wp_post->post_modified_gmt ); - - if ( $updated > $published ) { - $object->set_updated( \gmdate( 'Y-m-d\TH:i:s\Z', $updated ) ); - } - - $object->set_attributed_to( $this->get_attributed_to() ); - $object->set_content( $this->get_content() ); - $object->set_content_map( - array( - \strstr( \get_locale(), '_', true ) => $this->get_content(), - ) - ); - $path = sprintf( 'users/%d/followers', intval( $wp_post->post_author ) ); - - $object->set_to( - array( - 'https://www.w3.org/ns/activitystreams#Public', - get_rest_url_by_path( $path ), - ) - ); - $object->set_cc( $this->get_cc() ); - $object->set_attachment( $this->get_attachments() ); - $object->set_tag( $this->get_tags() ); - - 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_post; - - if ( 'trash' === get_post_status( $post ) ) { - $permalink = \get_post_meta( $post->ID, 'activitypub_canonical_url', true ); - } 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() { - if ( is_single_user() ) { - $user = new Blog_User(); - return $user->get_url(); - } - - return Users::get_by_id( $this->wp_post->post_author )->get_url(); - } - - /** - * Returns the Image Attachments for this Post, parsed from blocks. - * @param int $max_images The maximum number of images to return. - * @param array $image_ids The image IDs to append new IDs to. - * - * @return array The image IDs. - */ - protected function get_block_image_ids( $max_images, $image_ids = [] ) { - $blocks = \parse_blocks( $this->wp_post->post_content ); - return self::get_image_ids_from_blocks( $blocks, $image_ids, $max_images ); - } - - /** - * Recursively get image IDs from blocks. - * @param array $blocks The blocks to search for image IDs - * @param array $image_ids The image IDs to append new IDs to - * @param int $max_images The maximum number of images to return. - * - * @return array The image IDs. - */ - protected static function get_image_ids_from_blocks( $blocks, $image_ids, $max_images ) { - foreach ( $blocks as $block ) { - // recurse into inner blocks - if ( ! empty( $block['innerBlocks'] ) ) { - $image_ids = self::get_image_ids_from_blocks( $block['innerBlocks'], $image_ids, $max_images ); - } - - switch ( $block['blockName'] ) { - case 'core/image': - case 'core/cover': - if ( ! empty( $block['attrs']['id'] ) ) { - $image_ids[] = $block['attrs']['id']; - } - break; - case 'jetpack/slideshow': - case 'jetpack/tiled-gallery': - if ( ! empty( $block['attrs']['ids'] ) ) { - $image_ids = array_merge( $image_ids, $block['attrs']['ids'] ); - } - break; - case 'jetpack/image-compare': - if ( ! empty( $block['attrs']['beforeImageId'] ) ) { - $image_ids[] = $block['attrs']['beforeImageId']; - } - if ( ! empty( $block['attrs']['afterImageId'] ) ) { - $image_ids[] = $block['attrs']['afterImageId']; - } - break; - } - - // we could be at or over max, stop unneeded work - if ( count( $image_ids ) >= $max_images ) { - break; - } - } - - // still need to slice it because one gallery could knock us over the limit - return \array_slice( $image_ids, 0, $max_images ); - } - - /** - * Generates all Image Attachments for a Post. - * - * @return array The Image Attachments. - */ - protected function get_attachments() { - $max_images = intval( \apply_filters( 'activitypub_max_image_attachments', \get_option( 'activitypub_max_image_attachments', ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS ) ) ); - - $images = array(); - - // max images can't be negative or zero - if ( $max_images <= 0 ) { - return $images; - } - - $id = $this->wp_post->ID; - - $image_ids = array(); - - // list post thumbnail first if this post has one - if ( \function_exists( 'has_post_thumbnail' ) && \has_post_thumbnail( $id ) ) { - $image_ids[] = \get_post_thumbnail_id( $id ); - --$max_images; - } - - if ( $max_images > 0 ) { - // first try to get images that are actually in the post content - if ( site_supports_blocks() && \has_blocks( $this->wp_post->post_content ) ) { - $block_image_ids = $this->get_block_image_ids( $max_images, $image_ids ); - $image_ids = \array_merge( $image_ids, $block_image_ids ); - } else { - // fallback to images attached to the post - $query = new \WP_Query( - array( - 'post_parent' => $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, $image_ids, true ) ) { - $image_ids[] = $attachment->ID; - } - } - } - } - - $image_ids = \array_unique( $image_ids ); - - // get URLs for each image - foreach ( $image_ids as $id ) { - $image_size = 'full'; - - /** - * 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 'full' by default. - */ - $thumbnail = apply_filters( - 'activitypub_get_image', - $this->get_image( $id, $image_size ), - $id, - $image_size - ); - - if ( $thumbnail ) { - $mimetype = \get_post_mime_type( $id ); - $alt = \get_post_meta( $id, '_wp_attachment_image_alt', true ); - $image = array( - 'type' => 'Image', - 'url' => $thumbnail[0], - 'mediaType' => $mimetype, - ); - - if ( $alt ) { - $image['name'] = $alt; - } - $images[] = $image; - } - } - - return $images; - } - - /** - * Return details about an image attachment. - * - * @param int $id The attachment ID. - * @param string $image_size The image size to retrieve. Set to 'full' by default. - * - * @return array|false Array of image data, or boolean false if no image is available. - */ - protected function get_image( $id, $image_size = 'full' ) { - /** - * 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 'full' by default. - */ - do_action( 'activitypub_get_image_pre', $id, $image_size ); - - $thumbnail = \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 'full' by default. - */ - do_action( 'activitypub_get_image_post', $id, $image_size ); - - return $thumbnail; - } - - /** - * 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_object_type() { - if ( 'wordpress-post-format' !== \get_option( 'activitypub_object_type', 'note' ) ) { - return \ucfirst( \get_option( 'activitypub_object_type', 'note' ) ); - } - - $post_type = \get_post_type( $this->wp_post ); - switch ( $post_type ) { - case 'post': - $post_format = \get_post_format( $this->wp_post ); - switch ( $post_format ) { - case 'aside': - case 'status': - case 'quote': - case 'note': - $object_type = 'Note'; - break; - case 'gallery': - case 'image': - $object_type = 'Image'; - break; - case 'video': - $object_type = 'Video'; - break; - case 'audio': - $object_type = 'Audio'; - break; - default: - $object_type = 'Article'; - break; - } - break; - case 'page': - $object_type = 'Page'; - break; - case 'attachment': - $mime_type = \get_post_mime_type(); - $media_type = \preg_replace( '/(\/[a-zA-Z]+)/i', '', $mime_type ); - switch ( $media_type ) { - case 'audio': - $object_type = 'Audio'; - break; - case 'video': - $object_type = 'Video'; - break; - case 'image': - $object_type = 'Image'; - break; - } - break; - default: - $object_type = 'Article'; - 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; - } - - /** - * Returns a list of Tags, used in the Post. - * - * This includes Hash-Tags and Mentions. - * - * @return array The list of Tags. - */ - protected function get_tags() { - $tags = array(); - - $post_tags = \get_the_tags( $this->wp_post->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 content for the ActivityPub Item. - * - * The content will be generated based on the user settings. - * - * @return string The content. - */ - protected function get_content() { - 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 ); - - // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited - $post = $this->wp_post; - $content = $this->get_post_content_template(); - - // 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 ); - - 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() { - if ( 'excerpt' === \get_option( 'activitypub_post_content_type', 'content' ) ) { - return "[ap_excerpt]\n\n[ap_permalink type=\"html\"]"; - } - - if ( 'title' === \get_option( 'activitypub_post_content_type', 'content' ) ) { - return "[ap_title]\n\n[ap_permalink type=\"html\"]"; - } - - if ( 'content' === \get_option( 'activitypub_post_content_type', 'content' ) ) { - return "[ap_content]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]"; - } - - return \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT ); - } - - /** - * 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_post->post_content, $this->wp_post ); - } -} 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 45cfc0d6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-buddypress.php +++ /dev/null @@ -1,66 +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( - '' . \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( - '' . \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-nodeinfo.php b/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-nodeinfo.php deleted file mode 100644 index f1e2506a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-nodeinfo.php +++ /dev/null @@ -1,49 +0,0 @@ -= '2.0' ) { - $nodeinfo['protocols'][] = 'activitypub'; - } else { - $nodeinfo['protocols']['inbound'][] = 'activitypub'; - $nodeinfo['protocols']['outbound'][] = 'activitypub'; - } - - return $nodeinfo; - } - - /** - * Extend NodeInfo2 data - * - * @param array $nodeinfo NodeInfo2 data - * - * @return array The extended array - */ - public static function add_nodeinfo2_discovery( $nodeinfo ) { - $nodeinfo['protocols'][] = 'activitypub'; - - return $nodeinfo; - } -} 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 177b4173..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-webfinger.php +++ /dev/null @@ -1,58 +0,0 @@ -ID ); - - $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 ) { - if ( $array ) { - return $array; - } - - return Webfinger_Rest::get_profile( $resource ); - } -} 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 03e9b39a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/readme.txt +++ /dev/null @@ -1,481 +0,0 @@ -=== ActivityPub === -Contributors: automattic, pfefferle, mediaformat, mattwiebe, akirk, jeherve, nuriapena, cavalierlife -Tags: OStatus, fediverse, activitypub, activitystream -Requires at least: 4.7 -Tested up to: 6.3 -Stable tag: 1.0.7 -Requires PHP: 5.6 -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 - -To implement: - -* threaded comments support -* 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. - -== Changelog == - -Project maintained on GitHub at [automattic/wordpress-activitypub](https://github.com/automattic/wordpress-activitypub). - -= 1.0.7 = - -* Fixed: broken function call -* Add: filter to hook into "is blog public" check - -= 1.0.6 = - -* Fixed: more restrictive request verification - -= 1.0.5 = - -* Fixed: compatibility with WebFinger and NodeInfo plugin - -= 1.0.4 = - -* Fixed: Constants were not loaded early enough, resulting in a race condition -* Fixed: Featured image was ignored when using the block editor - -= 1.0.3 = - -* Fixed: compatibility with older WordPress/PHP versions -* Update: refactoring of the Plugin init process -* Update: better frontend UX and improved theme compat for blocks -* Compatibility: add a ACTIVITYPUB_DISABLE_REWRITES constant -* Compatibility: add pre-fetch hook to allow plugins to hang filters on - -= 1.0.2 = - -* Updated: improved hashtag visibility in default template -* Updated: reduced number of followers to be checked/updated via Cron, when System Cron is not set up -* Updated: check if username of Blog-User collides with an Authors name -* Compatibility: improved Group meta informations -* Fixed: detection of single user mode -* Fixed: remote delete -* Fixed: styles in Follow-Me block -* Fixed: various encoding and formatting issues -* Fixed: (health) check Author URLs only if Authors are enabled - -= 1.0.1 = - -* Update: improve image attachment detection using the block editor -* Update: better error code handling for API responses -* Update: use a tag stack instead of regex for protecting tags for Hashtags and @-Mentions -* Compatibility: better signature support for subpath-installations -* Compatibility: allow deactivating blocks registered by the plugin -* Compatibility: avoid Fatal Errors when using ClassicPress -* Compatibility: improve the Group-Actor to play nicely with existing implementations -* Fixed: truncate long blog titles and handles for the "Follow me" block -* Fixed: ensure that only a valid user can be selected for the "Follow me" block -* Fixed: fix a typo in a hook name -* Fixed: a problem with signatures when running WordPress in a sub-path - -= 1.0.0 = - -* Add: blog-wide Account (catchall, like `example.com@example.com`) -* Add: a Follow Me block (help visitors to follow your Profile) -* Add: Signature Verification: https://docs.joinmastodon.org/spec/security/ -* Add: a Followers Block (show off your Followers) -* Add: Simple caching -* Add: Collection endpoints for Featured Tags and Featured Posts -* Add: Better handling of Hashtags in mobile apps -* Update: Complete rewrite of the Follower-System based on Custom Post Types -* Update: Improved linter (PHPCS) -* Compatibility: Add a new conditional, `\Activitypub\is_activitypub_request()`, to allow third-party plugins to detect ActivityPub requests -* Compatibility: Add hooks to allow modifying images returned in ActivityPub requests -* Compatibility: Indicate that the plugin is compatible and has been tested with the latest version of WordPress, 6.3 -* Compatibility: Avoid PHP notice on sites using PHP 8.2 -* Fixed: Load the plugin later in the WordPress code lifecycle to avoid errors in some requests -* Fixed: Updating posts -* Fixed: Hashtag now support CamelCase and UTF-8 - -= 0.17.0 = - -* Fix type-selector -* Allow more HTML elements in Activity-Objects - -= 0.16.5 = - -* Return empty content/excerpt on password protected posts/pages - -= 0.16.4 = - -* Remove scripts later in the queue, to also handle scripts added by blocks -* Add published date to author profiles - -= 0.16.3 = - -* "cc", "to", ... fields can either be an array or a string -* Remove "style" and "script" HTML elements from content - -= 0.16.2 = - -* Fix fatal error in outbox - -= 0.16.1 = - -* Fix "update and create, posts appear blank on Mastodon" issue - -= 0.16.0 = - -* Add "Outgoing Mentions" ([#213](https://github.com/pfefferle/wordpress-activitypub/pull/213)) props [@akirk](https://github.com/akirk) -* Add configuration item for number of images to attach ([#248](https://github.com/pfefferle/wordpress-activitypub/pull/248)) props [@mexon](https://github.com/mexon) -* Use shortcodes instead of custom templates, to setup the Activity Post-Content ([#250](https://github.com/pfefferle/wordpress-activitypub/pull/250)) props [@toolstack](https://github.com/toolstack) -* Remove custom REST Server, because the needed changes are now merged into Core. -* Fix hashtags ([#261](https://github.com/pfefferle/wordpress-activitypub/pull/261)) props [@akirk](https://github.com/akirk) -* Change priorites, to maybe fix the hashtag issue - -= 0.15.0 = - -* Enable ActivityPub only for users that can `publish_posts` -* Persist only public Activities -* Fix remote-delete - -= 0.14.3 = - -* Better error handling. props [@akirk](https://github.com/akirk) - -= 0.14.2 = - -* Fix Critical error when using Friends Plugin and adding new URL to follow. props [@akirk](https://github.com/akirk) - -= 0.14.1 = - -* Fix "WebFinger not compatible with PHP < 8.0". props [@mexon](https://github.com/mexon) - -= 0.14.0 = - -* Friends support: https://wordpress.org/plugins/friends/ props [@akirk](https://github.com/akirk) -* Massive guidance improvements. props [mediaformat](https://github.com/mediaformat) & [@akirk](https://github.com/akirk) -* Add Custom Post Type support to outbox API. props [blueset](https://github.com/blueset) -* Better hash-tag support. props [bocops](https://github.com/bocops) -* Fix user-count (NodeInfo). props [mediaformat](https://github.com/mediaformat) - -= 0.13.4 = - -* fix webfinger for email identifiers - -= 0.13.3 = - -* fix: Create and Note should not have the same ActivityPub ID - -= 0.13.2 = - -* fix Follow issue AGAIN - -= 0.13.1 = - -* fix Inbox issue - -= 0.13.0 = - -* add Autor URL and WebFinger health checks -* fix NodeInfo endpoint - -= 0.12.0 = - -* use "pre_option_require_name_email" filter instead of "check_comment_flood". props [@akirk](https://github.com/akirk) -* save only comments/replies -* check for an explicit "undo -> follow" action. see https://wordpress.org/support/topic/qs-after-latest/ - -= 0.11.2 = - -* fix inconsistent `%tags%` placeholder - -= 0.11.1 = - -* fix follow/unfollow actions - -= 0.11.0 = - -* add support for customizable post-content -* first try of a delete activity -* do not require email for AP entries. props [@akirk](https://github.com/akirk) -* fix [timezones](https://github.com/pfefferle/wordpress-activitypub/issues/63) bug. props [@mediaformat](https://github.com/mediaformat) -* fix [digest header](https://github.com/pfefferle/wordpress-activitypub/issues/104) bug. props [@mediaformat](https://github.com/mediaformat) - - -= 0.10.1 = - -* fix inbox activities, like follow -* fix debug - -= 0.10.0 = - -* add image alt text to the ActivityStreams attachment property in a format that Mastodon can read. props [@BenLubar](https://github.com/BenLubar) -* use the "summary" property for a title as Mastodon does. props [@BenLubar](https://github.com/BenLubar) -* support authorized fetch to avoid having comments from "Anonymous". props [@BenLubar](https://github.com/BenLubar) -* add new post type: "title and link only". props [@bgcarlisle](https://github.com/bgcarlisle) - -= 0.9.1 = - -* disable shared inbox -* disable delete activity - -= 0.9.0 = - -* some code refactorings -* fix #73 - -= 0.8.3 = - -* fixed accept header bug - -= 0.8.2 = - -* add all required accept header -* better/simpler accept-header handling -* add debugging mechanism -* Add setting to enable AP for different (public) Post-Types -* explicit use of global functions - -= 0.8.1 = - -* fixed PHP warnings - -= 0.8.0 = - -* Moved followers list to user-menu - -= 0.7.4 = - -* added admin_email to metadata, to be able to "Manage your instance" on https://fediverse.network/manage/ - -= 0.7.3 = - -* refactorings -* fixed PHP warnings -* better hashtag regex - -= 0.7.2 = - -* fixed JSON representation of posts https://merveilles.town/@xuv/101907542498716956 - -= 0.7.1 = - -* fixed inbox problems with pleroma - -= 0.7.0 = - -* finally fixed pleroma compatibility -* added "following" endpoint -* simplified "followers" endpoint -* fixed default value problem - -= 0.6.0 = - -* add tags as hashtags to the end of each activity -* fixed pleroma following issue -* followers-list improvements - -= 0.5.1 = - -* fixed name-collision that caused an infinite loop - -= 0.5.0 = - -* complete refactoring -* fixed bug #30: Password-protected posts are federated -* only send Activites when ActivityPub is enabled for this post-type - -= 0.4.4 = - -* show avatars - -= 0.4.3 = - -* finally fixed backlink in excerpt/summary posts - -= 0.4.2 = - -* fixed backlink in excerpt/summary posts (thanks @depone) - -= 0.4.1 = - -* finally fixed contact list - -= 0.4.0 = - -* added settings to enable/disable hashtag support -* fixed follower list -* send activities only for new posts, otherwise send updates - -= 0.3.2 = - -* added "followers" endpoint -* change activity content from blog 'excerpt' to blog 'content' - -= 0.3.1 = - -* better json encoding - -= 0.3.0 = - -* basic hashtag support -* temporarily deactivated likes and boosts -* added support for actor objects -* fixed encoding issue - -= 0.2.1 = - -* customizable backlink (permalink or shorturl) -* show profile-identifiers also on profile settings - -= 0.2.0 = - -* added option to switch between content and excerpt -* removed html and duplicate new-lines - -= 0.1.1 = - -* fixed "excerpt" in AS JSON -* added settings for the activity-summary and for the activity-object-type - -= 0.1.0 = - -* added basic WebFinger support -* added basic NodeInfo support -* fully functional "follow" activity -* send new posts to your followers -* receive comments from your followers - -= 0.0.2 = - -* refactoring -* functional inbox -* nicer profile views - -= 0.0.1 = - -* initial - -== 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 70fb43b2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/author-json.php +++ /dev/null @@ -1,34 +0,0 @@ -set_context( - \Activitypub\Activity\Activity::CONTEXT -); - -/* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ -\do_action( 'activitypub_json_author_pre', $user->get__id() ); - -$options = 0; -// JSON_PRETTY_PRINT added in PHP 5.4 -if ( \get_query_var( 'pretty' ) ) { - $options |= \JSON_PRETTY_PRINT; // phpcs:ignore -} - -$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_author_options', $options, $user->get__id() ); - -\header( 'Content-Type: application/activity+json' ); -echo \wp_json_encode( $user->to_array(), $options ); - -/* - * 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 7ce6a270..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-json.php +++ /dev/null @@ -1,34 +0,0 @@ -set_context( - \Activitypub\Activity\Activity::CONTEXT -); - -/* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ -\do_action( 'activitypub_json_author_pre', $user->get__id() ); - -$options = 0; -// JSON_PRETTY_PRINT added in PHP 5.4 -if ( \get_query_var( 'pretty' ) ) { - $options |= \JSON_PRETTY_PRINT; // phpcs:ignore -} - -$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_author_options', $options, $user->get__id() ); - -\header( 'Content-Type: application/activity+json' ); -echo \wp_json_encode( $user->to_array(), $options ); - -/* - * 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 42d1b8b3..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->display(); - ?> - -
-
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 89467c46..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/post-json.php +++ /dev/null @@ -1,37 +0,0 @@ - \Activitypub\get_context() ), $object->to_object()->to_array() ); - -// filter output -$json = \apply_filters( 'activitypub_json_post_array', $json ); - -/* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ -\do_action( 'activitypub_json_post_pre' ); - -$options = 0; -// JSON_PRETTY_PRINT added in PHP 5.4 -if ( \get_query_var( 'pretty' ) ) { - $options |= \JSON_PRETTY_PRINT; // phpcs:ignore -} - -$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_post_options', $options ); - -\header( 'Content-Type: application/activity+json' ); -echo \wp_json_encode( $json, $options ); - -/* - * 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 fd801458..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/settings.php +++ /dev/null @@ -1,265 +0,0 @@ - 'active', - 'welcome' => '', - 'followers' => '', - ) -); -?> - -
-
- - -
-

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

- -

-

- publish_posts capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => 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 ec19be90..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-followers-list.php +++ /dev/null @@ -1,21 +0,0 @@ - -
-

-

- - - -
- - prepare_items(); - $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 afbb4046..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-settings.php +++ /dev/null @@ -1,32 +0,0 @@ - -

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

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

- -

get_resource() ) ); ?>

-
- - - -

-
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 cf26cfea..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 eea6f526..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 3afa125f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-git-wrapper.php +++ /dev/null @@ -1,669 +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; - $this->private_key = ''; - } - - 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 784c44a0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/readme.txt +++ /dev/null @@ -1,264 +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.5 -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.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/simple-local-avatars/dist/simple-local-avatars.asset.php b/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/dist/simple-local-avatars.asset.php deleted file mode 100644 index 97728613..00000000 --- a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/dist/simple-local-avatars.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => 'aa61da036e6891c324d0'); diff --git a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/dist/simple-local-avatars.js b/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/dist/simple-local-avatars.js deleted file mode 100644 index 1332c741..00000000 --- a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/dist/simple-local-avatars.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{let a,e,t,i,r,s,l,o,n,c=!1;function m(a){void 0===e&&(t=document.getElementById("simple-local-avatar-ratings"),e=jQuery(document.getElementById("simple-local-avatar-spinner")),i=document.getElementById("simple-local-avatar-photo"),r=jQuery(t).closest("form").find("input[type=submit]")),"unlock"===a?(c=!1,r.removeAttr("disabled"),e.hide(),e.hasClass("is-active")&&e.removeClass("is-active")):(c=!0,r.attr("disabled","disabled"),e.show(),jQuery(i).html(e),e.hasClass("is-active")||e.addClass("is-active"))}function p(a,e){const t=e.get("control"),i=a.get("width"),r=a.get("height");let s=parseInt(t.params.width,10),l=parseInt(t.params.height,10);const o=s/l;e.set("canSkipCrop",!0);const n=s,c=l;i/r>o?(l=r,s=l*o):(s=i,l=s/o);const m=(i-s)/2,p=(r-l)/2;return{handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:i,imageHeight:r,minWidth:n>s?s:n,minHeight:c>l?l:c,x1:m,y1:p,x2:s+m,y2:l+p,aspectRatio:`${s}:${l}`}}function d(a,e,r,s){const l={};l.url=a,l.thumbnail_url=a,l.timestamp=_.now(),e&&(l.attachment_id=e),r&&(l.width=r),s&&(l.height=s),m("lock"),jQuery.post(i10n_SimpleLocalAvatars.ajaxurl,{action:"assign_simple_local_avatar_media",media_id:e,user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.mediaNonce}).done((function(a){""!==a&&(i.innerHTML=a,jQuery("#simple-local-avatar-remove").show(),t.disabled=!1)})).always((function(){m("unlock")}))}jQuery(document).ready((function(e){l=e("#simple-local-avatar"),s=e("#simple-local-avatar-photo img"),n=s.attr("src"),t=e("#simple-local-avatar-ratings"),i=e("#simple-local-avatar-photo"),e("#simple-local-avatar-media").on("click",(function(e){if(e.preventDefault(),c)return;const r={id:"control-id",params:{flex_width:!0,flex_height:!0,width:200,height:200}};a=wp.media({button:{text:i10n_SimpleLocalAvatars.selectCrop,close:!1},states:[new wp.media.controller.Library({title:i10n_SimpleLocalAvatars.selectCrop,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:200,suggestedHeight:200}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:p,control:r})]}),a.on("cropped",(function(a){const{url:e}=a;d(e,a.id,a.width,a.height)})),a.on("skippedcrop",(function(a){const e=a.get("url"),t=a.get("width"),i=a.get("height");d(e,a.id,t,i)})),a.on("select",(function(){const e=a.state().get("selection").first().toJSON();var s;r.params.width!==e.width||r.params.height!==e.height||r.params.flex_width||r.params.flex_height?a.setState("cropper"):(e.dst_width=e.width,e.dst_height=e.height,s=e,m("lock"),jQuery.post(i10n_SimpleLocalAvatars.ajaxurl,{action:"assign_simple_local_avatar_media",media_id:s.id,user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.mediaNonce}).done((function(a){""!==a&&(i.innerHTML=a,jQuery("#simple-local-avatar-remove").show(),t.disabled=!1,m("unlock"))})).always((function(){m("unlock")})),a.close())})),a.open()})),e("#simple-local-avatar-remove").on("click",(function(a){a.preventDefault(),c||(m("lock"),e.get(i10n_SimpleLocalAvatars.ajaxurl,{action:"remove_simple_local_avatar",user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.deleteNonce}).done((function(a){""!==a&&(i.innerHTML=a,e("#simple-local-avatar-remove").hide(),t.disabled=!0)})).always((function(){m("unlock")})))})),l.on("change",(function(a){s.attr("srcset",""),s.attr("height","auto"),URL.revokeObjectURL(o),a.target.files.length>0?(o=URL.createObjectURL(a.target.files[0]),s.attr("src",o)):s.attr("src",n)})),e(document.getElementById("simple-local-avatars-migrate-from-wp-user-avatar")).on("click",(function(a){a.preventDefault(),jQuery.post(i10n_SimpleLocalAvatars.ajaxurl,{action:"migrate_from_wp_user_avatar",migrateFromWpUserAvatarNonce:i10n_SimpleLocalAvatars.migrateFromWpUserAvatarNonce}).always((function(){e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty(),e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarProgress)})).done((function(a){e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty();const t=e.parseJSON(a).count;0===t&&e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarFailure),t>0&&e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarSuccess+": "+t),setTimeout((function(){e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty()}),5e3)}))}));const r=e("#clear_cache_btn"),u=e("#clear_cache_message"),v=e("#simple-local-avatar-default"),g=e("#simple-local-avatar-file-url"),h=e("#simple-local-avatar-file-id");function _(){r.find("span").remove(),r.removeClass("disabled")}function f(a,t){t.step=a,e.ajax({url:i10n_SimpleLocalAvatars.ajaxurl,dataType:"json",data:t,method:"POST",success:function(a){if(a.success)return"done"===a.data.step?(u.text(a.data.message),_()):(u.text(a.data.message),f(parseInt(a.data.step,10),t)),!1;u.text(i10n_SimpleLocalAvatars.clearCacheError),_()},error:function(){u.text(i10n_SimpleLocalAvatars.clearCacheError),_()}})}if(r.on("click",(function(a){a.preventDefault(),r.addClass("disabled"),r.append(''),f(1,{action:"sla_clear_user_cache",nonce:i10n_SimpleLocalAvatars.cacheNonce})})),v.click((function(a){a.preventDefault();var t=e(this),i=wp.media({title:i10n_SimpleLocalAvatars.insertMediaTitle,multiple:!1,library:{type:"image"}}).open().on("select",(function(a){var e=i.state().get("selection").first(),r=(e=e.toJSON())?.sizes?.thumbnail?.url;void 0===r&&(r=e.url);var s=t.parent().find("img.avatar");s.show(),s.attr("src",r),s.attr("srcset",r),g.val(r),h.val(e.id)}))})),g.length&&""!==g.val()){var w=g.parent().find("img.avatar");w.attr("src",g.val()),w.attr("srcset",g.val())}""===h.val()&&h.parent().find("img.avatar").hide()}))})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/includes/class-simple-local-avatars.php b/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/includes/class-simple-local-avatars.php deleted file mode 100644 index 0eb8fa84..00000000 --- a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/includes/class-simple-local-avatars.php +++ /dev/null @@ -1,1634 +0,0 @@ -add_hooks(); - - $this->options = (array) get_option( 'simple_local_avatars' ); - $this->user_key = 'simple_local_avatar'; - $this->rating_key = 'simple_local_avatar_rating'; - - if ( - ! $this->is_avatar_shared() // Are we sharing avatars? - && ( - ( // And either an ajax request not in the network admin. - defined( 'DOING_AJAX' ) && DOING_AJAX - && isset( $_SERVER['HTTP_REFERER'] ) && ! preg_match( '#^' . network_admin_url() . '#i', $_SERVER['HTTP_REFERER'] ) - ) - || - ( // Or normal request not in the network admin. - ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) - && ! is_network_admin() - ) - ) - && is_multisite() - ) { - $this->user_key = sprintf( $this->user_key . '_%d', get_current_blog_id() ); - $this->rating_key = sprintf( $this->rating_key . '_%d', get_current_blog_id() ); - } - } - - /** - * Register actions and filters. - */ - public function add_hooks() { - global $pagenow; - global $wp_version; - - add_filter( 'plugin_action_links_' . SLA_PLUGIN_BASENAME, array( $this, 'plugin_filter_action_links' ) ); - - add_filter( 'pre_get_avatar_data', array( $this, 'get_avatar_data' ), 10, 2 ); - add_filter( 'pre_option_simple_local_avatars', array( $this, 'pre_option_simple_local_avatars' ), 10, 1 ); - - add_action( 'admin_init', array( $this, 'admin_init' ) ); - add_action( 'init', array( $this, 'define_avatar_ratings' ) ); - - // Load the JS on BE & FE both, in order to support third party plugins like bbPress. - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); - - add_action( 'show_user_profile', array( $this, 'edit_user_profile' ) ); - add_action( 'edit_user_profile', array( $this, 'edit_user_profile' ) ); - - add_action( 'personal_options_update', array( $this, 'edit_user_profile_update' ) ); - add_action( 'edit_user_profile_update', array( $this, 'edit_user_profile_update' ) ); - add_action( 'admin_action_remove-simple-local-avatar', array( $this, 'action_remove_simple_local_avatar' ) ); - add_action( 'wp_ajax_assign_simple_local_avatar_media', array( $this, 'ajax_assign_simple_local_avatar_media' ) ); - add_action( 'wp_ajax_remove_simple_local_avatar', array( $this, 'action_remove_simple_local_avatar' ) ); - add_action( 'user_edit_form_tag', array( $this, 'user_edit_form_tag' ) ); - - add_action( 'rest_api_init', array( $this, 'register_rest_fields' ) ); - - add_action( 'wp_ajax_migrate_from_wp_user_avatar', array( $this, 'ajax_migrate_from_wp_user_avatar' ) ); - - if ( defined( 'WP_CLI' ) && WP_CLI ) { - WP_CLI::add_command( 'simple-local-avatars migrate wp-user-avatar', array( $this, 'wp_cli_migrate_from_wp_user_avatar' ) ); - } - - add_action( 'wp_ajax_sla_clear_user_cache', array( $this, 'sla_clear_user_cache' ) ); - - add_filter( 'avatar_defaults', array( $this, 'add_avatar_default_field' ) ); - if ( version_compare( $wp_version, '5.1', '<' ) ) { - add_action( 'wpmu_new_blog', array( $this, 'set_defaults' ) ); - } else { - add_action( 'wp_initialize_site', array( $this, 'set_defaults' ) ); - } - - if ( 'profile.php' === $pagenow ) { - add_filter( 'media_view_strings', function ( $strings ) { - $strings['skipCropping'] = esc_html__( 'Default Crop', 'simple-local-avatars' ); - - return $strings; - }, 10, 1 ); - } - - // Fix: An error occurred cropping the image (https://github.com/10up/simple-local-avatars/issues/141). - if ( isset( $_POST['action'] ) && 'crop-image' === $_POST['action'] && is_admin() && wp_doing_ajax() ) { - add_action( 'plugins_loaded', function () { - remove_all_actions( 'setup_theme' ); - } ); - } - } - - /** - * Determine if plugin is network activated. - * - * @param string $plugin The plugin slug to check. - * - * @return boolean - */ - public static function is_network( $plugin ) { - $plugins = get_site_option( 'active_sitewide_plugins', array() ); - - if ( is_multisite() && isset( $plugins[ $plugin ] ) ) { - return true; - } - - return false; - } - - /** - * Get current plugin network mode - */ - public function get_network_mode() { - if ( SLA_IS_NETWORK ) { - return get_site_option( 'simple_local_avatars_mode', 'default' ); - } - - return 'default'; - } - - /** - * Determines if settings handling is enforced on a network level - * - * Important: this is only meant for admin UI purposes. - * - * @return boolean - */ - public function is_enforced() { - if ( - ( ! is_network_admin() && ( SLA_IS_NETWORK && 'enforce' === $this->get_network_mode() ) ) - ) { - return true; - } - - return false; - } - - /** - * Determine if avatars should be shared - * - * @return boolean - */ - public function is_avatar_shared() { - if ( - is_multisite() // Are we on multisite. - && ! isset( $this->options['shared'] ) // And our shared option doesn't exist. - || ( - isset( $this->options['shared'] ) // Or our shared option is set. - && 1 === $this->options['shared'] - ) - ) { - return true; - } - - return false; - } - - /** - * Add the settings action link to the plugin page. - * - * @param array $links The Action links for the plugin. - * - * @return array - */ - public function plugin_filter_action_links( $links ) { - - if ( ! is_array( $links ) ) { - return $links; - } - - $links['settings'] = sprintf( - ' %s ', - esc_url( admin_url( 'options-discussion.php' ) ), - __( 'Settings', 'simple-local-avatars' ) - ); - - return $links; - } - - /** - * Retrieve the local avatar for a user who provided a user ID, email address or post/comment object. - * - * @param string $avatar Avatar return by original function - * @param int|string|object $id_or_email A user ID, email address, or post/comment object - * @param int $size Size of the avatar image - * @param string $default URL to a default image to use if no avatar is available - * @param string $alt Alternative text to use in image tag. Defaults to blank - * @param array $args Optional. Extra arguments to retrieve the avatar. - * - * @return string tag for the user's avatar - */ - public function get_avatar( $avatar = '', $id_or_email = '', $size = 96, $default = '', $alt = '', $args = array() ) { - return apply_filters( 'simple_local_avatar', get_avatar( $id_or_email, $size, $default, $alt, $args ) ); - } - - /** - * Filter avatar data early to add avatar url if needed. This filter hooks - * before Gravatar setup to prevent wasted requests. - * - * @since 2.2.0 - * - * @param array $args Arguments passed to get_avatar_data(), after processing. - * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, - * user email, WP_User object, WP_Post object, or WP_Comment object. - */ - public function get_avatar_data( $args, $id_or_email ) { - if ( ! empty( $args['force_default'] ) ) { - return $args; - } - - $simple_local_avatar_url = $this->get_simple_local_avatar_url( $id_or_email, $args['size'] ); - if ( $simple_local_avatar_url ) { - $args['url'] = $simple_local_avatar_url; - } - - // Local only mode - if ( ! $simple_local_avatar_url && ! empty( $this->options['only'] ) ) { - $args['url'] = $this->get_default_avatar_url( $args['size'] ); - } - - if ( ! empty( $args['url'] ) ) { - $args['found_avatar'] = true; - - // If custom alt text isn't passed, pull alt text from the local image. - if ( empty( $args['alt'] ) ) { - $args['alt'] = $this->get_simple_local_avatar_alt( $id_or_email ); - } - } - - return $args; - } - - /** - * Get a user ID from certain possible values. - * - * @since 2.5.0 - * - * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, - * user email, WP_User object, WP_Post object, or WP_Comment object. - * @return int|false - */ - public function get_user_id( $id_or_email ) { - $user_id = false; - - if ( is_numeric( $id_or_email ) ) { - $user_id = (int) $id_or_email; - } elseif ( is_object( $id_or_email ) && ! empty( $id_or_email->user_id ) ) { - $user_id = (int) $id_or_email->user_id; - } elseif ( $id_or_email instanceof WP_User ) { - $user_id = $id_or_email->ID; - } elseif ( $id_or_email instanceof WP_Post && ! empty( $id_or_email->post_author ) ) { - $user_id = (int) $id_or_email->post_author; - } elseif ( is_string( $id_or_email ) ) { - $user = get_user_by( 'email', $id_or_email ); - $user_id = $user ? $user->ID : ''; - } - - return $user_id; - } - - /** - * Get local avatar url. - * - * @since 2.2.0 - * - * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, - * user email, WP_User object, WP_Post object, or WP_Comment object. - * @param int $size Requested avatar size. - */ - public function get_simple_local_avatar_url( $id_or_email, $size ) { - $user_id = $this->get_user_id( $id_or_email ); - - if ( empty( $user_id ) ) { - return ''; - } - - // Fetch local avatar from meta and make sure it's properly set. - $local_avatars = get_user_meta( $user_id, $this->user_key, true ); - if ( empty( $local_avatars['full'] ) ) { - return ''; - } - - // check rating - $avatar_rating = get_user_meta( $user_id, $this->rating_key, true ); - $site_rating = get_option( 'avatar_rating' ); - if ( ! empty( $avatar_rating ) && 'G' !== $avatar_rating && $site_rating ) { - $ratings = array_keys( $this->avatar_ratings ); - $site_rating_weight = array_search( $site_rating, $ratings, true ); - $avatar_rating_weight = array_search( $avatar_rating, $ratings, true ); - if ( false !== $avatar_rating_weight && $avatar_rating_weight > $site_rating_weight ) { - return ''; - } - } - - // handle "real" media - if ( ! empty( $local_avatars['media_id'] ) ) { - // If using shared avatars, make sure we validate the URL on the main site. - if ( $this->is_avatar_shared() ) { - $origin_blog_id = isset( $local_avatars['blog_id'] ) && ! empty( $local_avatars['blog_id'] ) ? $local_avatars['blog_id'] : get_main_site_id(); - switch_to_blog( $origin_blog_id ); - } - - $avatar_full_path = get_attached_file( $local_avatars['media_id'] ); - - if ( $this->is_avatar_shared() ) { - restore_current_blog(); - } - - // has the media been deleted? - if ( ! $avatar_full_path ) { - return ''; - } - } - - $size = (int) $size; - - // Generate a new size. - if ( ! array_key_exists( $size, $local_avatars ) ) { - $local_avatars[ $size ] = $local_avatars['full']; // just in case of failure elsewhere - - // allow automatic rescaling to be turned off - if ( apply_filters( 'simple_local_avatars_dynamic_resize', true ) ) : - - $upload_path = wp_upload_dir(); - - // get path for image by converting URL, unless its already been set, thanks to using media library approach - if ( ! isset( $avatar_full_path ) ) { - $avatar_full_path = str_replace( $upload_path['baseurl'], $upload_path['basedir'], $local_avatars['full'] ); - } - - // generate the new size - $editor = wp_get_image_editor( $avatar_full_path ); - if ( ! is_wp_error( $editor ) ) { - $resized = $editor->resize( $size, $size, true ); - if ( ! is_wp_error( $resized ) ) { - $dest_file = $editor->generate_filename(); - $saved = $editor->save( $dest_file ); - if ( ! is_wp_error( $saved ) ) { - // Transform the destination file path into URL. - $dest_file_url = ''; - if ( false !== strpos( $dest_file, $upload_path['basedir'] ) ) { - $dest_file_url = str_replace( $upload_path['basedir'], $upload_path['baseurl'], $dest_file ); - } else if ( is_multisite() && false !== strpos( $dest_file, ABSPATH . 'wp-content/uploads' ) ) { - $dest_file_url = str_replace( ABSPATH . 'wp-content/uploads', network_site_url( '/wp-content/uploads' ), $dest_file ); - } - - $local_avatars[ $size ] = $dest_file_url; - } - } - } - - // save updated avatar sizes - update_user_meta( $user_id, $this->user_key, $local_avatars ); - - endif; - } - - if ( 'http' !== substr( $local_avatars[ $size ], 0, 4 ) ) { - $local_avatars[ $size ] = home_url( $local_avatars[ $size ] ); - } - - return esc_url( $local_avatars[ $size ] ); - } - - /** - * Get local avatar alt text. - * - * @since 2.5.0 - * - * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, - * user email, WP_User object, WP_Post object, or WP_Comment object. - * @return string - */ - public function get_simple_local_avatar_alt( $id_or_email ) { - $user_id = $this->get_user_id( $id_or_email ); - - /** - * Filter the default avatar alt text. - * - * @param string $alt Default alt text. - * @return string - */ - $default_alt = apply_filters( 'simple_local_avatars_default_alt', __( 'Avatar photo', 'simple-local-avatars' ) ); - - if ( empty( $user_id ) ) { - return $default_alt; - } - - // Fetch local avatar from meta and make sure we have a media ID. - $local_avatars = get_user_meta( $user_id, 'simple_local_avatar', true ); - if ( empty( $local_avatars['media_id'] ) ) { - $alt = ''; - // If no avatar is set, check if we are using a default avatar with alt text. - if ( 'simple_local_avatar' === get_option( 'avatar_default' ) ) { - $default_avatar_id = get_option( 'simple_local_avatar_default', '' ); - if ( ! empty( $default_avatar_id ) ) { - $alt = get_post_meta( $default_avatar_id, '_wp_attachment_image_alt', true ); - } - } - - return $alt ? $alt : $default_alt; - } - - $alt = get_post_meta( $local_avatars['media_id'], '_wp_attachment_image_alt', true ); - - return $alt ? $alt : $default_alt; - } - - /** - * Get default avatar url - * - * @since 2.2.0 - * - * @param int $size Requested avatar size. - */ - public function get_default_avatar_url( $size ) { - if ( empty( $default ) ) { - $avatar_default = get_option( 'avatar_default' ); - if ( empty( $avatar_default ) ) { - $default = 'mystery'; - } else { - $default = $avatar_default; - } - } - - $host = is_ssl() ? 'https://secure.gravatar.com' : 'http://0.gravatar.com'; - - if ( 'mystery' === $default ) { - $default = "$host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') - } elseif ( 'blank' === $default ) { - $default = includes_url( 'images/blank.gif' ); - } elseif ( 'gravatar_default' === $default ) { - $default = "$host/avatar/?s={$size}"; - } elseif ( 'simple_local_avatar' === $default ) { - $default = "$host/avatar/?d=$default&s={$size}"; - $default_avatar_id = get_option( 'simple_local_avatar_default', '' ); - if ( ! empty( $default_avatar_id ) ) { - $default = wp_get_attachment_image_url( $default_avatar_id ); - } - } else { - $default = "$host/avatar/?d=$default&s={$size}"; - } - - return $default; - } - - /** - * Define the ratings avatar ratings. - * - * The ratings need to be defined after the languages have been loaded so - * they can be translated. This method exists to define the ratings - * after that has been done. - * - * @since 2.7.3 - */ - public function define_avatar_ratings() { - /* - * Avatar ratings. - * - * The key should not be translated as it's used by WP Core in it's - * english form (G, PG, etc). - * - * The values should be translated, these include the initial rating - * name and the description for display to users. - */ - $this->avatar_ratings = array( - /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ - 'G' => __( 'G — Suitable for all audiences' ), - /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ - 'PG' => __( 'PG — Possibly offensive, usually for audiences 13 and above' ), - /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ - 'R' => __( 'R — Intended for adult audiences above 17' ), - /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ - 'X' => __( 'X — Even more mature than above' ), - ); - } - - /** - * Register admin settings. - */ - public function admin_init() { - $this->define_avatar_ratings(); - // upgrade pre 2.0 option - $old_ops = get_option( 'simple_local_avatars_caps' ); - if ( $old_ops ) { - if ( ! empty( $old_ops['simple_local_avatars_caps'] ) ) { - update_option( 'simple_local_avatars', array( 'caps' => 1 ) ); - } - - delete_option( 'simple_local_avatar_caps' ); - } - - register_setting( 'discussion', 'simple_local_avatars', array( $this, 'sanitize_options' ) ); - add_settings_field( - 'simple-local-avatars-only', - __( 'Local Avatars Only', 'simple-local-avatars' ), - array( $this, 'avatar_settings_field' ), - 'discussion', - 'avatars', - array( - 'class' => 'simple-local-avatars', - 'key' => 'only', - 'desc' => __( 'Only allow local avatars (still uses Gravatar for default avatars)', 'simple-local-avatars' ), - ) - ); - add_settings_field( - 'simple-local-avatars-caps', - __( 'Local Upload Permissions', 'simple-local-avatars' ), - array( $this, 'avatar_settings_field' ), - 'discussion', - 'avatars', - array( - 'class' => 'simple-local-avatars', - 'key' => 'caps', - 'desc' => __( 'Only allow users with file upload capabilities to upload local avatars (Authors and above)', 'simple-local-avatars' ), - ) - ); - - if ( is_multisite() ) { - add_settings_field( - 'simple-local-avatars-shared', - __( 'Shared network avatars', 'simple-local-avatars' ), - array( $this, 'avatar_settings_field' ), - 'discussion', - 'avatars', - array( - 'class' => 'simple-local-avatars', - 'key' => 'shared', - 'desc' => __( 'Uploaded avatars will be shared across the entire network, instead of being unique per site', 'simple-local-avatars' ), - 'default' => 1, - ) - ); - } - - add_action( 'load-options-discussion.php', array( $this, 'load_discussion_page' ) ); - - // This is for network site settings. - if ( SLA_IS_NETWORK && is_network_admin() ) { - add_action( 'load-settings.php', array( $this, 'load_network_settings' ) ); - } - - add_settings_field( - 'simple-local-avatars-migration', - __( 'Migrate Other Local Avatars', 'simple-local-avatars' ), - array( $this, 'migrate_from_wp_user_avatar_settings_field' ), - 'discussion', - 'avatars' - ); - add_settings_field( - 'simple-local-avatars-clear', - esc_html__( 'Clear local avatar cache', 'simple-local-avatars' ), - array( $this, 'avatar_settings_field' ), - 'discussion', - 'avatars', - array( - 'key' => 'clear_cache', - 'desc' => esc_html__( 'Clear cache of stored avatars', 'simple-local-avatars' ), - ) - ); - - // Save default avatar file. - $this->save_default_avatar_file_id(); - } - - /** - * Fire code on the Discussion page - */ - public function load_discussion_page() { - add_action( 'admin_print_styles', array( $this, 'admin_print_styles' ) ); - add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) ); - } - - /** - * Load needed hooks to handle network settings - */ - public function load_network_settings() { - $this->options = (array) get_site_option( 'simple_local_avatars', array() ); - - add_action( 'wpmu_options', array( $this, 'show_network_settings' ) ); - add_action( 'update_wpmu_options', array( $this, 'save_network_settings' ) ); - } - - /** - * Show the network settings - */ - public function show_network_settings() { - $mode = $this->get_network_mode(); - ?> - -

- - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
- - - avatar_settings_field( - array( - 'key' => 'only', - 'desc' => __( 'Only allow local avatars (still uses Gravatar for default avatars) ', 'simple-local-avatars' ), - ) - ); - ?> -
- - - avatar_settings_field( - array( - 'key' => 'caps', - 'desc' => __( 'Only allow users with file upload capabilities to upload local avatars (Authors and above)', 'simple-local-avatars' ), - ) - ); - ?> -
- - - avatar_settings_field( - array( - 'key' => 'shared', - 'desc' => __( 'Uploaded avatars will be shared across the entire network, instead of being unique per site', 'simple-local-avatars' ), - 'default' => 1, - ) - ); - ?> -
- - remove_nonce = wp_create_nonce( 'remove_simple_local_avatar_nonce' ); - - wp_enqueue_script( 'simple-local-avatars', plugins_url( '', dirname( __FILE__ ) ) . '/dist/simple-local-avatars.js', array( 'jquery' ), SLA_VERSION, true ); - wp_localize_script( - 'simple-local-avatars', - 'i10n_SimpleLocalAvatars', - array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'user_id' => $user_id, - 'insertIntoPost' => __( 'Set as avatar', 'simple-local-avatars' ), - 'selectCrop' => __( 'Select avatar and Crop', 'simple-local-avatars' ), - 'deleteNonce' => $this->remove_nonce, - 'cacheNonce' => wp_create_nonce( 'sla_clear_cache_nonce' ), - 'mediaNonce' => wp_create_nonce( 'assign_simple_local_avatar_nonce' ), - 'migrateFromWpUserAvatarNonce' => wp_create_nonce( 'migrate_from_wp_user_avatar_nonce' ), - 'clearCacheError' => esc_html__( 'Something went wrong while clearing cache, please try again.', 'simple-local-avatars' ), - 'insertMediaTitle' => esc_html__( 'Choose default avatar', 'simple-local-avatars' ), - 'migrateFromWpUserAvatarSuccess' => __( 'Number of avatars successfully migrated from WP User Avatar', 'simple-local-avatars' ), - 'migrateFromWpUserAvatarFailure' => __( 'No avatars were migrated from WP User Avatar.', 'simple-local-avatars' ), - 'migrateFromWpUserAvatarProgress' => __( 'Migration in progress.', 'simple-local-avatars' ), - ) - ); - } - - /** - * Sanitize new settings field before saving - * - * @param array|string $input Passed input values to sanitize - * @return array|string Sanitized input fields - */ - public function sanitize_options( $input ) { - $new_input['caps'] = empty( $input['caps'] ) ? 0 : 1; - $new_input['only'] = empty( $input['only'] ) ? 0 : 1; - - if ( is_multisite() ) { - $new_input['shared'] = empty( $input['shared'] ) ? 0 : 1; - } - - return $new_input; - } - - /** - * Settings field for avatar upload capabilities - * - * @param array $args Field arguments - */ - public function avatar_settings_field( $args ) { - $args = wp_parse_args( - $args, - array( - 'key' => '', - 'desc' => '', - 'default' => 0, - ) - ); - - if ( ! isset( $this->options[ $args['key'] ] ) ) { - $this->options[ $args['key'] ] = $args['default']; - } - - if ( 'clear_cache' !== $args['key'] ) { - echo ' - - '; - } else { - echo '
'; - echo ''; - } - - // Output warning if needed. - if ( - SLA_IS_NETWORK // If network activated. - && $this->is_enforced() // And in enforce mode. - && 'shared' === $args['key'] // And we are displaying the last setting. - ) { - echo ' -
-

' . esc_html__( 'Simple Local Avatar settings are currently enforced across all sites on the network.', 'simple-local-avatars' ) . '

-
- '; - } - } - - /** - * Settings field for migrating avatars away from WP User Avatar - */ - public function migrate_from_wp_user_avatar_settings_field() { - printf( - '

', - esc_attr( 'simple-local-avatars-migrate-from-wp-user-avatar' ), - esc_html__( 'Migrate avatars from WP User Avatar to Simple Local Avatars', 'simple-local-avatars' ) - ); - } - - /** - * Output new Avatar fields to user editing / profile screen - * - * @param object $profileuser User object - */ - public function edit_user_profile( $profileuser ) { - ?> -
-

- - - - - - - - - - -
-
-
- ID ) ); - remove_filter( 'pre_option_avatar_rating', '__return_empty_string' ); - ?> - -
-
- options['caps'] ); - } - - if ( $upload_rights ) { - do_action( 'simple_local_avatar_notices' ); - wp_nonce_field( 'simple_local_avatar_nonce', '_simple_local_avatar_nonce', false ); - $remove_url = add_query_arg( - array( - 'action' => 'remove-simple-local-avatar', - 'user_id' => $profileuser->ID, - '_wpnonce' => $this->remove_nonce, - ) - ); - ?> - -

-
- -

- -

- -   - - simple_local_avatar ) ? ' style="display:none;"' : ''; ?>> - - -

- simple_local_avatar ) ) { - echo '' . esc_html__( 'No local avatar is set. Set up your avatar at Gravatar.com.', 'simple-local-avatars' ) . ''; - } else { - echo '' . esc_html__( 'You do not have media management permissions. To change your local avatar, contact the blog administrator.', 'simple-local-avatars' ) . ''; - } - } - ?> -
-
-
-
simple_local_avatar ) ); ?>> - - simple_local_avatar_rating ) || ! array_key_exists( $profileuser->simple_local_avatar_rating, $this->avatar_ratings ) ) { - $profileuser->simple_local_avatar_rating = 'G'; - } - - foreach ( $this->avatar_ratings as $key => $rating ) : - echo "\n\t
'; - endforeach; - ?> -

-
-
-
- avatar_delete( $user_id ); // delete old images if successful. - - $meta_value = array(); - - // set the new avatar - if ( is_numeric( $url_or_media_id ) ) { - $meta_value['media_id'] = $url_or_media_id; - $url_or_media_id = wp_get_attachment_url( $url_or_media_id ); - } - - $meta_value['full'] = $url_or_media_id; - $meta_value['blog_id'] = get_current_blog_id(); - - update_user_meta( $user_id, $this->user_key, $meta_value ); // save user information (overwriting old). - - /** - * Enable themes and other plugins to react to changes to a user's avatar. - * - * @since 2.6.0 - * - * @param int $user_id Id of the user who's avatar was updated - */ - do_action( 'simple_local_avatar_updated' , $user_id ); - } - - /** - * Save any changes to the user profile - * - * @param int $user_id ID of user being updated - */ - public function edit_user_profile_update( $user_id ) { - // check nonces - if ( empty( $_POST['_simple_local_avatar_nonce'] ) || ! wp_verify_nonce( $_POST['_simple_local_avatar_nonce'], 'simple_local_avatar_nonce' ) ) { - return; - } - - // check for uploaded files - if ( ! empty( $_FILES['simple-local-avatar']['name'] ) && 0 === $_FILES['simple-local-avatar']['error'] ) : - - // need to be more secure since low privelege users can upload - $allowed_mime_types = wp_get_mime_types(); - $file_mime_type = strtolower( $_FILES['simple-local-avatar']['type'] ); - - if ( ! ( 0 === strpos( $file_mime_type, 'image/' ) ) || ! in_array( $file_mime_type, $allowed_mime_types, true ) ) { - $this->avatar_upload_error = __( 'Only images can be uploaded as an avatar', 'simple-local-avatars' ); - add_action( 'user_profile_update_errors', array( $this, 'user_profile_update_errors' ) ); - return; - } - - $max_upload_size = $this->upload_size_limit( wp_max_upload_size() ); - if ( $_FILES['simple-local-avatar']['size'] > $max_upload_size ) { - $this->avatar_upload_error = sprintf( __( 'Max allowed avatar size is %s', 'simple-local-avatars' ), size_format( $max_upload_size ) ); - add_action( 'user_profile_update_errors', array( $this, 'user_profile_update_errors' ) ); - return; - } - - // front end (theme my profile etc) support - if ( ! function_exists( 'media_handle_upload' ) ) { - include_once ABSPATH . 'wp-admin/includes/media.php'; - } - - // front end (plugin bbPress etc) support - if ( ! function_exists( 'wp_handle_upload' ) ) { - include_once ABSPATH . 'wp-admin/includes/file.php'; - } - if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) { - include_once ABSPATH . 'wp-admin/includes/image.php'; - } - - $this->user_id_being_edited = $user_id; // make user_id known to unique_filename_callback function - $avatar_id = media_handle_upload( - 'simple-local-avatar', - 0, - array(), - array( - 'mimes' => array( - 'jpg|jpeg|jpe' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - ), - 'test_form' => false, - 'unique_filename_callback' => array( $this, 'unique_filename_callback' ), - ) - ); - - if ( is_wp_error( $avatar_id ) ) { // handle failures. - $this->avatar_upload_error = '' . __( 'There was an error uploading the avatar:', 'simple-local-avatars' ) . ' ' . esc_html( $avatar_id->get_error_message() ); - add_action( 'user_profile_update_errors', array( $this, 'user_profile_update_errors' ) ); - - return; - } - - $this->assign_new_user_avatar( $avatar_id, $user_id ); - - endif; - - // Handle ratings - if ( isset( $avatar_id ) || get_user_meta( $user_id, $this->user_key, true ) ) { - if ( empty( $_POST['simple_local_avatar_rating'] ) || ! array_key_exists( $_POST['simple_local_avatar_rating'], $this->avatar_ratings ) ) { - $_POST['simple_local_avatar_rating'] = key( $this->avatar_ratings ); - } - - update_user_meta( $user_id, $this->rating_key, $_POST['simple_local_avatar_rating'] ); - } - } - - /** - * Allow developers to override the maximum allowable file size for avatar uploads - * - * @param int $bytes WordPress default byte size check - * @return int Maximum byte size - */ - public function upload_size_limit( $bytes ) { - return apply_filters( 'simple_local_avatars_upload_limit', $bytes ); - } - - /** - * Runs when a user clicks the Remove button for the avatar - */ - public function action_remove_simple_local_avatar() { - if ( ! empty( $_GET['user_id'] ) && ! empty( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'remove_simple_local_avatar_nonce' ) ) { - $user_id = (int) $_GET['user_id']; - - if ( ! current_user_can( 'edit_user', $user_id ) ) { - wp_die( esc_html__( 'You do not have permission to edit this user.', 'simple-local-avatars' ) ); - } - - $this->avatar_delete( $user_id ); // delete old images if successful - - /** - * Enable themes and other plugins to react to avatar deletions. - * - * @since 2.6.0 - * - * @param int $user_id Id of the user who's avatar was deleted. - */ - do_action( 'simple_local_avatar_deleted', $user_id ); - - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { - echo wp_kses_post( get_simple_local_avatar( $user_id ) ); - } - } - - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { - die; - } - } - - /** - * AJAX callback for assigning media ID fetched from media library to user - */ - public function ajax_assign_simple_local_avatar_media() { - // check required information and permissions - if ( empty( $_POST['user_id'] ) || empty( $_POST['media_id'] ) || ! current_user_can( 'upload_files' ) || ! current_user_can( 'edit_user', $_POST['user_id'] ) || empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'assign_simple_local_avatar_nonce' ) ) { - die; - } - - $media_id = (int) $_POST['media_id']; - $user_id = (int) $_POST['user_id']; - - // ensure the media is real is an image - if ( wp_attachment_is_image( $media_id ) ) { - $this->assign_new_user_avatar( $media_id, $user_id ); - } - - echo wp_kses_post( get_simple_local_avatar( $user_id ) ); - - die; - } - - /** - * Delete avatars based on a user_id - * - * @param int $user_id User ID. - */ - public function avatar_delete( $user_id ) { - $old_avatars = (array) get_user_meta( $user_id, $this->user_key, true ); - - if ( empty( $old_avatars ) ) { - return; - } - - // if it was uploaded media, don't erase the full size or try to erase an the ID - if ( array_key_exists( 'media_id', $old_avatars ) ) { - unset( $old_avatars['media_id'], $old_avatars['full'] ); - } - - if ( ! empty( $old_avatars ) ) { - $upload_path = wp_upload_dir(); - - foreach ( $old_avatars as $old_avatar ) { - // derive the path for the file based on the upload directory - $old_avatar_path = str_replace( $upload_path['baseurl'], $upload_path['basedir'], $old_avatar ); - if ( file_exists( $old_avatar_path ) ) { - unlink( $old_avatar_path ); - } - } - } - - delete_user_meta( $user_id, $this->user_key ); - delete_user_meta( $user_id, $this->rating_key ); - } - - /** - * Creates a unique, meaningful file name for uploaded avatars. - * - * @param string $dir Path for file - * @param string $name Filename - * @param string $ext File extension (e.g. ".jpg") - * @return string Final filename - */ - public function unique_filename_callback( $dir, $name, $ext ) { - $user = get_user_by( 'id', (int) $this->user_id_being_edited ); - $name = $base_name = sanitize_file_name( $user->display_name . '_avatar_' . time() ); //phpcs:ignore - - // ensure no conflicts with existing file names - $number = 1; - while ( file_exists( $dir . "/$name$ext" ) ) { - $name = $base_name . '_' . $number; - $number ++; - } - - return $name . $ext; - } - - /** - * Adds errors based on avatar upload problems. - * - * @param WP_Error $errors Error messages for user profile screen. - */ - public function user_profile_update_errors( WP_Error $errors ) { - $errors->add( 'avatar_error', $this->avatar_upload_error ); - } - - /** - * Registers the simple_local_avatar field in the REST API. - */ - public function register_rest_fields() { - register_rest_field( - 'user', - 'simple_local_avatar', - array( - 'get_callback' => array( $this, 'get_avatar_rest' ), - 'update_callback' => array( $this, 'set_avatar_rest' ), - 'schema' => array( - 'description' => 'The users simple local avatar', - 'type' => 'object', - ), - ) - ); - } - - /** - * Returns the simple_local_avatar meta key for the given user. - * - * @param object $user User object - */ - public function get_avatar_rest( $user ) { - $local_avatar = get_user_meta( $user['id'], $this->user_key, true ); - if ( empty( $local_avatar ) ) { - return; - } - - return $local_avatar; - } - - /** - * Updates the simple local avatar from a REST request. - * - * Since we are just adding a field to the existing user endpoint - * we don't need to worry about ensuring the calling user has proper permissions. - * Only the user or an administrator would be able to change the avatar. - * - * @param array $input Input submitted via REST request. - * @param object $user The user making the request. - */ - public function set_avatar_rest( $input, $user ) { - $this->assign_new_user_avatar( $input['media_id'], $user->ID ); - } - - /** - * Short-circuit filter the `simple_local_avatars` option to match network if necessary - * - * @param bool $value Value of `simple_local_avatars` option, typically false. - * - * @return array - */ - public function pre_option_simple_local_avatars( $value ) { - if ( SLA_IS_NETWORK && 'enforce' === $this->get_network_mode() ) { - $value = get_site_option( 'simple_local_avatars', array() ); - } - - return $value; - } - - /** - * Set plugin defaults for a new site - * - * @param int|WP_Site $blog_id Blog ID or object. - */ - public function set_defaults( $blog_id ) { - if ( 'enforce' === $this->get_network_mode() ) { - return; - } - - if ( $blog_id instanceof WP_Site ) { - $blog_id = (int) $blog_id->blog_id; - } - - switch_to_blog( $blog_id ); - update_option( 'simple_local_avatars', $this->sanitize_options( $this->options ) ); - restore_current_blog(); - } - - /** - * Add some basic styling on the Discussion page - */ - public function admin_print_styles() { - ?> - - is_enforced() ) { - $classes .= ' sla-enforced'; - } - - return $classes; - } - - /** - * Clear user cache. - */ - public function sla_clear_user_cache() { - check_ajax_referer( 'sla_clear_cache_nonce', 'nonce' ); - $step = isset( $_REQUEST['step'] ) ? intval( $_REQUEST['step'] ) : 1; - - // Setup defaults. - $users_per_page = 50; - $offset = ( $step - 1 ) * $users_per_page; - - $users_query = new \WP_User_Query( - array( - 'fields' => array( 'ID' ), - 'number' => $users_per_page, - 'offset' => $offset, - ) - ); - - // Total users in the site. - $total_users = $users_query->get_total(); - - // Get the users. - $users = $users_query->get_results(); - - if ( ! empty( $users ) ) { - foreach ( $users as $user ) { - $user_id = $user->ID; - $local_avatars = get_user_meta( $user_id, 'simple_local_avatar', true ); - $media_id = isset( $local_avatars['media_id'] ) ? $local_avatars['media_id'] : ''; - $this->clear_user_avatar_cache( $local_avatars, $user_id, $media_id ); - } - - wp_send_json_success( - array( - 'step' => $step + 1, - 'message' => sprintf( - /* translators: 1: Offset, 2: Total users */ - esc_html__( 'Processing %1$s/%2$s users...', 'simple-local-avatars' ), - $offset, - $total_users - ), - ) - ); - } - - wp_send_json_success( - array( - 'step' => 'done', - 'message' => sprintf( - /* translators: %s Total users */ - esc_html__( 'Completed clearing cache for all %s user(s) avatars.', 'simple-local-avatars' ), - $total_users - ), - ) - ); - } - - /** - * Clear avatar cache for given user. - * - * @param array $local_avatars Local avatars. - * @param int $user_id User ID. - * @param mixed $media_id Media ID. - */ - private function clear_user_avatar_cache( $local_avatars, $user_id, $media_id ) { - if ( ! empty( $media_id ) ) { - // In order to support WP 4.9. - if ( function_exists( 'wp_get_original_image_path' ) ) { - $file_name_data = pathinfo( wp_get_original_image_path( $media_id ) ); - } else { - $file_name_data = pathinfo( get_attached_file( $media_id ) ); - } - - $file_dir_name = $file_name_data['dirname']; - $file_name = $file_name_data['filename']; - $file_ext = $file_name_data['extension']; - foreach ( $local_avatars as $local_avatars_key => $local_avatar_value ) { - if ( ! in_array( $local_avatars_key, [ 'media_id', 'full' ], true ) ) { - $file_size_path = sprintf( '%1$s/%2$s-%3$sx%3$s.%4$s', $file_dir_name, $file_name, $local_avatars_key, $file_ext ); - if ( ! file_exists( $file_size_path ) ) { - unset( $local_avatars[ $local_avatars_key ] ); - } - } - } - - // Update meta, remove sizes that don't exist. - update_user_meta( $user_id, 'simple_local_avatar', $local_avatars ); - } - } - - /** - * Add default avatar upload file field. - * - * @param array $defaults Default options for avatar. - * - * @return array Default options of avatar. - */ - public function add_avatar_default_field( $defaults ) { - if ( ! did_action( 'wp_enqueue_media' ) ) { - wp_enqueue_media(); - } - $default_avatar_file_url = ''; - $default_avatar_file_id = get_option( 'simple_local_avatar_default', '' ); - if ( ! empty( $default_avatar_file_id ) ) { - $default_avatar_file_url = wp_get_attachment_image_url( $default_avatar_file_id ); - } - ob_start(); - ?> - - - - blog_id = 1; - $sites = array( $site ); - } - - // Bail early if we don't find sites. - if ( empty( $sites ) ) { - return $count; - } - - foreach ( $sites as $site ) { - // Get the blog ID to use in the meta key and user query. - $blog_id = isset( $site->blog_id ) ? $site->blog_id : 1; - - // Get the name of the meta key for WP User Avatar. - $meta_key = $wpdb->get_blog_prefix( $blog_id ) . 'user_avatar'; - - // Get processed users from database. - $migrations = get_option( 'simple_local_avatars_migrations', array() ); - $processed_users = isset( $migrations['wp_user_avatar'] ) ? $migrations['wp_user_avatar'] : array(); - - // Get all users that have a local avatar. - $users = get_users( - array( - 'blog_id' => $blog_id, - 'exclude' => $processed_users, - 'meta_key' => $meta_key, - 'meta_compare' => 'EXISTS', - ) - ); - - // Bail early if we don't find users. - if ( empty( $users ) ) { - continue; - } - - foreach ( $users as $user ) { - // Get the existing avatar media ID. - $avatar_id = get_user_meta( $user->ID, $meta_key, true ); - - // Attach the user and media to Simple Local Avatars. - $sla = new Simple_Local_Avatars(); - $sla->assign_new_user_avatar( (int) $avatar_id, $user->ID ); - - // Check that it worked. - $is_migrated = get_user_meta( $user->ID, 'simple_local_avatar', true ); - - if ( ! empty( $is_migrated ) ) { - // Build array of user IDs. - $migrations['wp_user_avatar'][] = $user->ID; - - // Record the user IDs so we don't process a second time. - $is_saved = update_option( 'simple_local_avatars_migrations', $migrations ); - - // Record how many avatars we migrate to be used in our messaging. - if ( $is_saved ) { - $count ++; - } - } - } - } - - return $count; - } - - /** - * Migrate the user's avatar data away from WP User Avatar/ProfilePress via the dashboard. - * - * Sends the number of avatars processed back to the AJAX response before stopping execution. - * - * @return void - */ - public function ajax_migrate_from_wp_user_avatar() { - // Bail early if nonce is not available. - if ( empty( sanitize_text_field( $_POST['migrateFromWpUserAvatarNonce'] ) ) ) { - die; - } - - // Bail early if nonce is invalid. - if ( ! wp_verify_nonce( sanitize_text_field( $_POST['migrateFromWpUserAvatarNonce'] ), 'migrate_from_wp_user_avatar_nonce' ) ) { - die(); - } - - // Run the migration script and store the number of avatars processed. - $count = $this->migrate_from_wp_user_avatar(); - - // Create the array we send back to javascript here. - $array_we_send_back = array( 'count' => $count ); - - // Make sure to json encode the output because that's what it is expecting. - echo wp_json_encode( $array_we_send_back ); - - // Make sure you die when finished doing ajax output. - wp_die(); - - } - - /** - * Migrate the user's avatar data from WP User Avatar/ProfilePress via the command line. - * - * ## OPTIONS - * - * [--yes] - * : Skips the confirmations (for automated systems). - * - * ## EXAMPLES - * - * $ wp simple-local-avatars migrate wp-user-avatar - * Success: Number of avatars successfully migrated from WP User Avatar: 5 - * - * @param array $args The arguments. - * @param array $assoc_args The associative arguments. - * - * @return void - */ - public function wp_cli_migrate_from_wp_user_avatar( $args, $assoc_args ) { - - // Argument --yes to prevent confirmation (for automated systems). - if ( ! isset( $assoc_args['yes'] ) ) { - WP_CLI::confirm( esc_html__( 'Do you want to migrate avatars from WP User Avatar?', 'simple-local-avatars' ) ); - } - - // Run the migration script and store the number of avatars processed. - $count = $this->migrate_from_wp_user_avatar(); - - // Error out if we don't process any avatars. - if ( 0 === absint( $count ) ) { - WP_CLI::error( esc_html__( 'No avatars were migrated from WP User Avatar.', 'simple-local-avatars' ) ); - } - - WP_CLI::success( - sprintf( - '%s: %s', - esc_html__( 'Number of avatars successfully migrated from WP User Avatar', 'simple-local-avatars' ), - esc_html( $count ) - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/readme.txt b/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/readme.txt deleted file mode 100644 index f051650f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/readme.txt +++ /dev/null @@ -1,227 +0,0 @@ -=== Simple Local Avatars === -Contributors: jakemgold, 10up, thinkoomph, jeffpaul, faisal03 -Donate link: https://10up.com/plugins/simple-local-avatars-wordpress/ -Tags: avatar, gravatar, user photos, users, profile -Requires at least: 5.7 -Tested up to: 6.2 -Requires PHP: 7.4 -Stable tag: 2.7.5 -License: GPLv2 or later -License URI: http://www.gnu.org/licenses/gpl-2.0.html - -Adds an avatar upload field to user profiles. Generates requested sizes on demand just like Gravatar! - -== Description == - -Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight. - -Just edit a user profile, and scroll down to the new "Avatar" field. The plug-in will take care of cropping and sizing! - -1. Stores avatars in the "uploads" folder where all of your other media is kept. -2. Has a simple, native interface. -3. Fully supports Gravatar and default avatars if no local avatar is set for the user - but also allows you turn off Gravatar. -4. Generates the requested avatar size on demand (and stores the new size for efficiency), so it looks great, just like Gravatar! -5. Lets you decide whether lower privilege users (subscribers, contributors) can upload their own avatar. -6. Enables rating of local avatars, just like Gravatar. - -== Installation == - -1. Install easily with the WordPress plugin control panel or manually download the plugin and upload the extracted folder to the `/wp-content/plugins/` directory -1. Activate the plugin through the 'Plugins' menu in WordPress -1. If you only want users with file upload capabilities to upload avatars, check the applicable option under Settings > Discussion -1. Start uploading avatars by editing user profiles! - -Use avatars in your theme using WordPress' built in `get_avatar()` function: [http://codex.wordpress.org/Function_Reference/get_avatar](http://codex.wordpress.org/Function_Reference/get_avatar "get_avatar function") - -You can also use `get_simple_local_avatar()` (with the same arguments) to retreive local avatars a bit faster, but this will make your theme dependent on this plug-in. - -== Screenshots == - -1. Avatar upload field on a user profile page - -== Changelog == - -## [2.7.5] - 2023-05-12 = -* **Added:** Ajax loading animation during process of uploading and deleting local avatars (props [@lllopo](https://github.com/lllopo), [@BhargavBhandari90](https://github.com/BhargavBhandari90), [@faisal-alvi](https://github.com/faisal-alvi) via [#204](https://github.com/10up/simple-local-avatars/pull/204)). -* **Changed:** Avatar removal button text (props [@jayedul](https://github.com/jayedul), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi) via [#208](https://github.com/10up/simple-local-avatars/pull/208)). -* **Changed:** WordPress "tested up to" version 6.2 (props [@jayedul](https://github.com/jayedul), [@faisal-alvi](https://github.com/faisal-alvi) via [#210](https://github.com/10up/simple-local-avatars/pull/210)). -* **Changed:** Run E2E tests on the zip generated by "Build release zip" action (props [@jayedul](https://github.com/jayedul), [@iamdharmesh](https://github.com/iamdharmesh), [@faisal-alvi](https://github.com/faisal-alvi) via [#205](https://github.com/10up/simple-local-avatars/pull/205)). -* **Security:** Bump `webpack` from 5.75.0 to 5.76.1 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#207](https://github.com/10up/simple-local-avatars/pull/207)). - -= 2.7.4 - 2023-02-23 = -* **Fixed:** Support passing `WP_User` to `get_avatar()` (props [@mattheu](https://github.com/mattheu), [@faisal-alvi](https://github.com/faisal-alvi) via [#193](https://github.com/10up/simple-local-avatars/pull/193)). -* **Fixed:** Remove trailing commas in function calls (props [@patrixer](https://github.com/patrixer), [@dkotter](https://github.com/dkotter), [@sekra24](https://github.com/sekra24), [@faisal-alvi](https://github.com/faisal-alvi) via [#196](https://github.com/10up/simple-local-avatars/pull/196)). -* **Security:** Bump `simple-git` from 3.15.1 to 3.16.0 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#191](https://github.com/10up/simple-local-avatars/pull/191)). -* **Security:** Bump `http-cache-semantics` from 4.1.0 to 4.1.1 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#197](https://github.com/10up/simple-local-avatars/pull/197)). - -= 2.7.3 - 2023-01-16 = -* **Fixed:** Issue causing fatal errors when avatars used on front end of site (props [@Rottinator](https://github.com/Rottinator), [@peterwilsoncc](https://github.com/peterwilsoncc), [@ravinderk](https://github.com/ravinderk), [@faisal-alvi](https://github.com/faisal-alvi) via [#187](https://github.com/10up/simple-local-avatars/pull/187)). -* **Fixed:** Deprecation error in admin on PHP 8.0 and later (props [@Rottinator](https://github.com/Rottinator), [@peterwilsoncc](https://github.com/peterwilsoncc), [@ravinderk](https://github.com/ravinderk), [@faisal-alvi](https://github.com/faisal-alvi) via [#187](https://github.com/10up/simple-local-avatars/pull/187)). - -= 2.7.2 - 2023-01-13 = -* **Added:** Filter hook `simple_local_avatars_upload_limit` to restrict image upload size & image file checking enhanced (props [@Shirkit](https://github.com/Shirkit), [@jayedul](https://github.com/jayedul), [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul) via [#171](https://github.com/10up/simple-local-avatars/pull/171)). -* **Added:** GitHub Actions summary on Cypress e2e test runs (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#174](https://github.com/10up/simple-local-avatars/pull/174)). -* **Changed:** Cypress integration migrated from 9.5.4 to 11.2.0 (props [@iamdharmesh](https://github.com/iamdharmesh), [@jayedul](https://github.com/jayedul), [@faisal-alvi](https://github.com/faisal-alvi) via [#172](https://github.com/10up/simple-local-avatars/pull/172)). -* **Fixed:** PHP8 support for `assign_new_user_avatar` (props [@lllopo](https://github.com/lllopo), [@mattwatsoncodes](https://github.com/mattwatsoncodes), [@faisal-alvi](https://github.com/faisal-alvi) via [#183](https://github.com/10up/simple-local-avatars/pull/183)). -* **Fixed:** Fixed the user profile language not respected issue (props [@dkotter](https://github.com/dkotter), [@lllopo](https://github.com/lllopo), [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul) via [#175](https://github.com/10up/simple-local-avatars/pull/175)). -* **Removed:** textdomain from the core strings and the function `update_avatar_ratings` as it's not required anymore (props [@dkotter](https://github.com/dkotter), [@lllopo](https://github.com/lllopo), [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul) via [#175](https://github.com/10up/simple-local-avatars/pull/175)). -* **Security:** Bump `json5` from 1.0.1 to 1.0.2 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#182](https://github.com/10up/simple-local-avatars/pull/182)). - -= 2.7.1 - 2022-12-08 = -* **Added:** Added missing files from the last release and changed the readme file to fix the bullet points and added fullstops. - -= 2.7.0 - 2022-12-08 = -* **Added:** Added `Build release zip` GitHub Action (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@faisal-alvi](https://github.com/faisal-alvi) via [#168](https://github.com/10up/simple-local-avatars/pull/168)). -* **Changed:** Set plugin defaults on `wp_initialize_site` instead of deprecated action `wpmu_new_blog` (props [@kadamwhite](https://github.com/kadamwhite), [@faisal-alvi](https://github.com/faisal-alvi) via [#156](https://github.com/10up/simple-local-avatars/pull/156)). -* **Changed:** Support Level from Active to Stable (props [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#159](https://github.com/10up/simple-local-avatars/pull/159)). -* **Changed:** Build tools: Allow PHPCS installer plugin to run without prompting user (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@jeffpaul](https://github.com/jeffpaul) via [#164](https://github.com/10up/simple-local-avatars/pull/164)). -* **Changed:** WP tested up to version bump to 6.1 (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@faisal-alvi](https://github.com/faisal-alvi) via [#165](https://github.com/10up/simple-local-avatars/pull/165)). -* **Fixed:** Non admin users can not crop avatar (props [@jayedul](https://github.com/jayedul), [@faisal-alvi](https://github.com/faisal-alvi), [@zamanq](https://github.com/zamanq), [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#155](https://github.com/10up/simple-local-avatars/pull/155)). -* **Security:** Bump `@wordpress/env` from 4.9.0 to 5.2.0 and `got` from 10.7.0 to 11.8.5 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#153](https://github.com/10up/simple-local-avatars/pull/153)). -* **Security:** Bump `loader-utils` from 2.0.2 to 2.0.3 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#160](https://github.com/10up/simple-local-avatars/pull/160)). -* **Security:** Bump `loader-utils` from 2.0.3 to 2.0.4 (props [@dependabot](https://github.com/dependabot), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#162](https://github.com/10up/simple-local-avatars/pull/162)). -* **Security:** Bump `simple-git` from 3.9.0 to 3.15.1 (props [@dependabot](https://github.com/dependabot) via [#176](https://github.com/10up/simple-local-avatars/pull/176)). - -= 2.6.0 - 2022-09-13 = -**Note that this release bumps the minimum required version of WordPress from 4.6 to 5.7 and PHP from 5.6 to 7.4.** - -* **Added:** If a default avatar image is used, ensure that outputs alt text. This will either be default text (Avatar photo) or the alt text from the uploaded default image (props [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi) via [#147](https://github.com/10up/simple-local-avatars/pull/147)) -* **Added:** Two hooks, `simple_local_avatar_updated` and `simple_local_avatar_deleted`, (props [@t-lock](https://github.com/t-lock), [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter) via [#149](https://github.com/10up/simple-local-avatars/pull/149)) -* **Changed:** Bump minimum required version of WordPress from 4.6 to 5.7 (props [@vikrampm1](https://github.com/vikrampm1), [@faisal-alvi](https://github.com/faisal-alvi), [@cadic](https://github.com/cadic) via [#143](https://github.com/10up/simple-local-avatars/pull/143)). -* **Changed:** Bump minimum required version of PHP from 5.6 to 7.4 (props [@vikrampm1](https://github.com/vikrampm1), [@faisal-alvi](https://github.com/faisal-alvi), [@cadic](https://github.com/cadic) via [#143](https://github.com/10up/simple-local-avatars/pull/143)). -* **Changed:**The plugin is now available via Composer without any additional steps required (props [@faisal-alvi](https://github.com/faisal-alvi), [@kovshenin](https://github.com/kovshenin), [@jeffpaul](https://github.com/jeffpaul) via [#145](https://github.com/10up/simple-local-avatars/pull/145)) -* **Security:** Bump `terser` from 5.14.1 to 5.14.2 (props [@dependabot](https://github.com/dependabot), [@faisal-alvi](https://github.com/faisal-alvi) via [#142](https://github.com/10up/simple-local-avatars/pull/142)) - -= 2.5.0 - 2022-06-24 = -* **Added:** Skip cropping button (props [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@dinhtungdu](https://github.com/dinhtungdu) via [#130](https://github.com/10up/simple-local-avatars/pull/130))! -* **Added:** Updated the button name from "Skip Crop" to "Default Crop" only on the edit profile page (props [@faisal-alvi](https://github.com/faisal-alvi), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#136](https://github.com/10up/simple-local-avatars/pull/136)). -* **Added:** If an image used for a local avatar has alt text assigned, ensure that alt text is used when rendering the image (props [@dkotter](https://github.com/dkotter), [@pixelloop](https://github.com/pixelloop), [@faisal-alvi](https://github.com/faisal-alvi) via [#127](https://github.com/10up/simple-local-avatars/pull/127)). -* **Added:** Support for bbPress by loading the JS at FE on the profile edit page (props [@foliovision](https://github.com/foliovision), [@faisal-alvi](https://github.com/faisal-alvi), [@iamdharmesh](https://github.com/iamdharmesh) via [#134](https://github.com/10up/simple-local-avatars/pull/134)). -* **Added:** Cypress E2E tests (props [@faisal-alvi](https://github.com/faisal-alvi), [@vikrampm1](https://github.com/vikrampm1), [@Sidsector9](https://github.com/Sidsector9) via [#115](https://github.com/10up/simple-local-avatars/pull/115)). -* **Fixed:** Broken avatar URLs for network-configured shared avatars with non-standard thumbnail sizes (props [@vladolaru](https://github.com/vladolaru), [@faisal-alvi](https://github.com/faisal-alvi) via [#125](https://github.com/10up/simple-local-avatars/pull/125)). -* **Fixed:** `HTTP_REFERER` is null and causing PHP warning (props [@alireza-salehi](https://github.com/alireza-salehi), [@faisal-alvi](https://github.com/faisal-alvi), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#129](https://github.com/10up/simple-local-avatars/pull/129)). - -= 2.4.0 - 2022-05-10 = -* **Added:** Ability to set a default avatar. (props [@mehulkaklotar](https://github.com/mehulkaklotar), [@jeffpaul](https://github.com/jeffpaul), [@dinhtungdu](https://github.com/dinhtungdu), [@faisal-alvi](https://github.com/faisal-alvi) via [#96](https://github.com/10up/simple-local-avatars/pull/96)). -* **Fixed:** Correct plugin name in changelog. (props [@grappler](https://github.com/grappler), [@jeffpaul](https://github.com/jeffpaul) via [#117](https://github.com/10up/simple-local-avatars/pull/117)). -* **Fixed:** Avatar cache not being cleared. (props [@thefrosty](https://github.com/thefrosty), [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#118](https://github.com/10up/simple-local-avatars/pull/118) & [#120](https://github.com/10up/simple-local-avatars/pull/120)). -* **Security:** Dev dependency `@wordpress/scripts` upgraded to resolve deeper level dependency security issues. (props [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi), [@cadic](https://github.com/cadic) via [#119](https://github.com/10up/simple-local-avatars/pull/119)). - -= 2.3.0 - 2022-04-25 = -* **Added:** Crop screen (props [@jeffpaul](https://github.com/jeffpaul), [@helen](https://github.com/helen), [@ajmaurya99](https://github.com/ajmaurya99), [@Antonio-Laguna](https://github.com/Antonio-Laguna), [@faisal-alvi](https://github.com/faisal-alvi)). -* **Added:** Avatar preview for Subscribers (props [@ankitguptaindia](https://github.com/ankitguptaindia), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter)). -* **Added:** More robust multisite support and shared avatar setting (props [@adamsilverstein](https://github.com/adamsilverstein), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi), [@holle75](https://github.com/holle75)). -* **Added:** Settings link to plugin action links (props [@rahulsprajapati](https://github.com/rahulsprajapati), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh)). -* **Added:** Dashboard setting and WP-CLI command to migrate avatars from [WP User Avatar](https://wordpress.org/plugins/wp-user-avatar/) (props [@jeffpaul](https://github.com/jeffpaul), [@claytoncollie](https://github.com/claytoncollie), [@helen](https://github.com/helen), [@faisal-alvi](https://github.com/faisal-alvi)). -* **Added:** Option to clear cache of user meta to remove image sizes that do not exist (props [@jeffpaul](https://github.com/jeffpaul), [@ituk](https://github.com/ituk), [@dinhtungdu](https://github.com/dinhtungdu), [@sparkbold](https://github.com/sparkbold), [@thrijith](https://github.com/thrijith)). -* **Added:** Package file (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@claytoncollie](https://github.com/claytoncollie), [@cadic](https://github.com/cadic)). -* **Added:** PHP Unit Tests (props [@faisal-alvi](https://github.com/faisal-alvi), [@iamdharmesh](https://github.com/iamdharmesh)). -* **Added:** "No Response" GitHub Action (props [@jeffpaul](https://github.com/jeffpaul)). -* **Changed:** Bump WordPress "tested up to" version to 5.9 (props [@jeffpaul](https://github.com/jeffpaul), [@ankitguptaindia](https://github.com/ankitguptaindia), [@dinhtungdu](https://github.com/dinhtungdu), [@phpbits](https://github.com/phpbits)). -* **Changed:** Bump WordPress "tested up to" version to 6.0 (props [@ajmaurya99](https://github.com/ajmaurya99) via [#110](https://github.com/10up/simple-local-avatars/pull/110)). -* **Changed:** Format admin script (props [@thrijith](https://github.com/thrijith), [@dinhtungdu](https://github.com/dinhtungdu)). -* **Fixed:** Media ID as string in REST API (props [@diodoe](https://github.com/diodoe), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter)). -* **Fixed:** Avatar rating text is not translated properly if a user has a custom language Set (props [@ActuallyConnor](https://github.com/ActuallyConnor), [@faisal-alvi](https://github.com/faisal-alvi)). -* **Security:** PHP 8 compatibility (props [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9)). -* **Security:** Bump `rmccue/requests` from 1.7.0 to 1.8.0 (props [dependabot@](https://github.com/dependabot)). -* **Security:** Bump `nanoid` from 3.1.28 to 3.2.0 (props [dependabot@](https://github.com/dependabot)). -* **Security:** Bump `minimist` from 1.2.5 to 1.2.6 (props [dependabot@](https://github.com/dependabot)). - -= 2.2.0 - 2020-10-27 = -* **Added:** `$args` parameter to `get_simple_local_avatar` function (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@heyjones](https://github.com/heyjones), [@dkotter](https://profiles.wordpress.org/dkotter/), [@sumnercreations](https://github.com/sumnercreations), [@dshanske](https://profiles.wordpress.org/dshanske/)). -* **Added:** `Simple_Local_Avatars::get_avatar_data()`, `Simple_Local_Avatars::get_simple_local_avatar_url()`, and `Simple_Local_Avatars::get_default_avatar_url()` methods (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@heyjones](https://github.com/heyjones), [@dkotter](https://profiles.wordpress.org/dkotter/), [@sumnercreations](https://github.com/sumnercreations), [@dshanske](https://profiles.wordpress.org/dshanske/)). -* **Added:** Ability to retrieve avatar with `WP_Post` object (props [@oscarssanchez](https://profiles.wordpress.org/oscarssanchez), [@blobaugh](https://profiles.wordpress.org/blobaugh)). -* **Added:** class and ID to Avatar section on Profile Page to allow easier styling (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)). -* **Added:** [WP Acceptance](https://github.com/10up/wpacceptance/) test coverage (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)). -* **Changed:** Switched to `pre_get_avatar_data` filter (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@heyjones](https://github.com/heyjones), [@dkotter](https://profiles.wordpress.org/dkotter/), [@sumnercreations](https://github.com/sumnercreations), [@dshanske](https://profiles.wordpress.org/dshanske/)). -* **Changed:** `assign_new_user_avatar` function to public (props [@tripflex](https://profiles.wordpress.org/tripflex/)). -* **Changed:** Split the main class into its own file, added unit tests, and set up testing GitHub action (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@helen](https://profiles.wordpress.org/helen/), [@stevegrunwell](https://profiles.wordpress.org/stevegrunwell/)). -* **Changed:** New plugin banner and icon (props [@JackieKjome](https://profiles.wordpress.org/jackiekjome/)). -* **Changed:** Bump WordPress version "tested up to" 5.5 (props [@Waka867](https://github.com/Waka867), [@tmoorewp](https://profiles.wordpress.org/tmoorewp), [@jeffpaul](https://profiles.wordpress.org/jeffpaul), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)). -* **Changed:** GitHub Actions from HCL to YAML workflow syntax (props [@jeffpaul](https://profiles.wordpress.org/jeffpaul)). -* **Changed:** Documentation updates (props [@jeffpaul](https://profiles.wordpress.org/jeffpaul)). -* **Fixed:** Initialize `Simple_Local_Avatars` on the `$simple_local_avatars` global, enabling bundling plugin with composer (props [@pauldewouters](https://profiles.wordpress.org/pauldewouters/), [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein)). -* **Removed:** `get_avatar` function that overrides the core function (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@heyjones](https://github.com/heyjones), [@dkotter](https://profiles.wordpress.org/dkotter/), [@sumnercreations](https://github.com/sumnercreations), [@dshanske](https://profiles.wordpress.org/dshanske/)). - -= 2.1.1 - 2019-05-07 = -* Fixed: Do not delete avatars just because they don't exist on the local filesystem. This was occasionally dumping avatars when WordPress uploads were stored elsewhere, e.g. a cloud service. - -= 2.1 - 2018-10-24 = -* *New:* All avatar uploads now go into the media library. Don't worry - users without the ability to upload files cannot otherwise see the contents of your media library. This allows local avatars to respect other functionality your site may have around uploaded images, such as external hosting. -* *New:* REST API support for getting and updating. -* *New:* Use .org language packs rather than bundling translations. -* *Fixed:* Avoid an `ArgumentCountError`. -* *Fixed:* A couple of internationalization issues. - -= 2.0 - 2013-06-02 = -* Choose or upload an avatar from the media library (for users with appropriate capabilities)! -* Local avatars are rated for appropriateness, just like Gravatar -* A new setting under Discussion enables administrators to turn off Gravatar (only use local avatars) -* Delete the local avatar with a single button click (like everywhere else in WordPress) -* Uploaded avatar file names are appended with the timestamp, addressing browser image caching issues -* New developer filter for preventing automatic rescaling: simple_local_avatars_dynamic_resize -* New developer filter for limiting upload size: simple_local_avatars_upload_limit -* Upgraded functions deprecated since WordPress 3.5 -* Fixed translations not working on front end (although translations are now a bit out of date...) -* Hungarian translation added (needs further updating again with new version) -* Assorted refactoring / improvements under the hood - -= 1.3.1 - 2011-12-29 = -* Brazilian Portuguese and Belarusian translations -* Bug fixes (most notably correct naming of image files based on user display name) -* Optimization for WordPress 3.2 / 3.3 (substitutes deprecated function) - -= 1.3 - 2011-09-22 = -* Avatar file name saved as "user-display-name_avatar" (or other image extension) -* Russian localization added -* Assorted minor code optimizations - -= 1.2.4 - 2011-07-02 = -* Support for front end avatar uploads (e.g. Theme My Profile) - -= 1.2.3 - 2011-04-04 = -* Russian localization - -= 1.2.2 - 2011-03-25 = -* Fix for avatars uploaded pre-1.2.1 having a broken path after upgrade - -= 1.2.1 - 2011-01-26 = -* French localization -* Simplify uninstall code - -= 1.2 - 2011-01-26 = -* Fix path issues on some IIS servers (resulting in missing avatar images) -* Fix rare uninstall issues related to deleted avatars -* Spanish localization -* Other minor under the hood optimizations - -= 1.1.3 - 2011-01-20 = -* Properly deletes old avatars upon changing avatar -* Fixes "foreach" warning in debug mode when updating avatar image - -= 1.1.2 - 2011-01-18 = -* Norwegian localization - -= 1.1.1 - 2011-01-18 = -* Italian localization - -= 1.1 - 2011-01-18 = -* All users (regardless of capabilities) can upload avatars by default. To limit avatar uploading to users with upload files capabilities (Authors and above), check the applicable option under Settings > Discussion. This was the default behavior in 1.0. -* Localization support; German included - -= 1.0 - 2011-01-18 = -* Initial release. - -== Upgrade Notice == - -= 2.6.0 = -**Note that this release bumps the minimum required version of WordPress from 4.6 to 5.7 and PHP from 5.6 to 7.4.** - -= 2.1 = -*Important note:* All avatar uploads now go into the media library. Don't worry - users without the ability to upload files cannot otherwise see the contents of your media library. This allows local avatars to respect other functionality your site may have around uploaded images, such as external hosting. - -= 2.0 = -Upgraded to take advantage of *WordPress 3.5 and newer*. Does not support older versions! This has also *not* been tested with front end profile plug-ins - feedback welcome. Note that several language strings have been added or modified - revised translations would be welcome! - -= 1.3.1 = -Like WordPress 3.2, now *REQUIRES* PHP 5.2 or newer. diff --git a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/simple-local-avatars.php b/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/simple-local-avatars.php deleted file mode 100644 index 15021494..00000000 --- a/wp-content/upgrade-temp-backup/plugins/simple-local-avatars/simple-local-avatars.php +++ /dev/null @@ -1,73 +0,0 @@ - tag for the user's avatar - */ -function get_simple_local_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = array() ) { - return apply_filters( 'simple_local_avatar', get_avatar( $id_or_email, $size, $default, $alt, $args ) ); -} - -register_uninstall_hook( __FILE__, 'simple_local_avatars_uninstall' ); -/** - * On uninstallation, remove the custom field from the users and delete the local avatars - */ -function simple_local_avatars_uninstall() { - $simple_local_avatars = new Simple_Local_Avatars(); - $users = get_users( - array( - 'meta_key' => 'simple_local_avatar', - 'fields' => 'ids', - ) - ); - - foreach ( $users as $user_id ) : - $simple_local_avatars->avatar_delete( $user_id ); - endforeach; - - delete_option( 'simple_local_avatars' ); - delete_option( 'simple_local_avatars_migrations' ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/languages/smtp-mailer.mo b/wp-content/upgrade-temp-backup/plugins/smtp-mailer/languages/smtp-mailer.mo deleted file mode 100644 index 8d576526..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/languages/smtp-mailer.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/languages/smtp-mailer.pot b/wp-content/upgrade-temp-backup/plugins/smtp-mailer/languages/smtp-mailer.pot deleted file mode 100644 index a67a4fd9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/languages/smtp-mailer.pot +++ /dev/null @@ -1,176 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: SMTP Mailer\n" -"POT-Creation-Date: 2015-12-20 14:09+1000\n" -"PO-Revision-Date: 2015-12-20 14:09+1000\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.5\n" -"X-Poedit-KeywordsList: _e;__\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: .\n" - -#: main.php:66 -msgid "Settings" -msgstr "" - -#: main.php:72 -msgid "SMTP Mailer" -msgstr "" - -#: main.php:77 -msgid "General" -msgstr "" - -#: main.php:78 -msgid "Test Email" -msgstr "" - -#: main.php:79 -msgid "Server Info" -msgstr "" - -#: main.php:82 -#, php-format -msgid "" -"Please visit the SMTP Mailer " -"documentation page for usage instructions." -msgstr "" - -#: main.php:141 -msgid "To" -msgstr "" - -#: main.php:143 -msgid "Email address of the recipient" -msgstr "" - -#: main.php:147 -msgid "Subject" -msgstr "" - -#: main.php:149 -msgid "Subject of the email" -msgstr "" - -#: main.php:153 -msgid "Message" -msgstr "" - -#: main.php:155 -msgid "Email body" -msgstr "" - -#: main.php:162 -msgid "Send Email" -msgstr "" - -#: main.php:256 -msgid "Settings Saved!" -msgstr "" - -#: main.php:286 -msgid "SMTP Host" -msgstr "" - -#: main.php:288 -msgid "" -"The SMTP server which will be used to send email. For example: smtp.gmail.com" -msgstr "" - -#: main.php:292 -msgid "SMTP Authentication" -msgstr "" - -#: main.php:295 -msgid "True" -msgstr "" - -#: main.php:296 -msgid "False" -msgstr "" - -#: main.php:298 -msgid "" -"Whether to use SMTP Authentication when sending an email (recommended: True)." -msgstr "" - -#: main.php:303 -msgid "SMTP Username" -msgstr "" - -#: main.php:305 -msgid "Your SMTP Username." -msgstr "" - -#: main.php:309 -msgid "SMTP Password" -msgstr "" - -#: main.php:311 -msgid "Your SMTP Password." -msgstr "" - -#: main.php:315 -msgid "Type of Encryption" -msgstr "" - -#: main.php:318 -msgid "TLS" -msgstr "" - -#: main.php:319 -msgid "SSL" -msgstr "" - -#: main.php:320 -msgid "No Encryption" -msgstr "" - -#: main.php:322 -msgid "" -"The encryption which will be used when sending an email (recommended: TLS)." -msgstr "" - -#: main.php:327 -msgid "SMTP Port" -msgstr "" - -#: main.php:329 -msgid "" -"The port which will be used when sending an email (587/465/25). If you " -"choose TLS it should be set to 587. For SSL use port 465 instead." -msgstr "" - -#: main.php:333 -msgid "From Email Address" -msgstr "" - -#: main.php:335 -msgid "" -"The email address which will be used as the From Address if it is not " -"supplied to the mail function." -msgstr "" - -#: main.php:339 -msgid "From Name" -msgstr "" - -#: main.php:341 -msgid "" -"The name which will be used as the From Name if it is not supplied to the " -"mail function." -msgstr "" - -#: main.php:348 -msgid "Save Changes" -msgstr "" - -#: main.php:368 -msgid "" -"SMTP Mailer plugin cannot send email until you enter your credentials in the " -"settings." -msgstr "" diff --git a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/main.php b/wp-content/upgrade-temp-backup/plugins/smtp-mailer/main.php deleted file mode 100644 index e72827e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/main.php +++ /dev/null @@ -1,878 +0,0 @@ -plugin_version); - define('SMTP_MAILER_SITE_URL', site_url()); - define('SMTP_MAILER_HOME_URL', home_url()); - define('SMTP_MAILER_URL', $this->plugin_url()); - define('SMTP_MAILER_PATH', $this->plugin_path()); - $this->plugin_includes(); - $this->loader_operations(); - } - - function plugin_includes() { - - } - - function loader_operations() { - add_action('plugins_loaded', array($this, 'plugins_loaded_handler')); - add_action('admin_menu', array($this, 'options_menu')); - //add_action('admin_notices', 'smtp_mailer_admin_notice'); - add_filter('pre_wp_mail', 'smtp_mailer_pre_wp_mail', 10, 2); - } - - function plugins_loaded_handler() - { - if(is_admin() && current_user_can('manage_options')){ - add_filter('plugin_action_links', array($this, 'add_plugin_action_links'), 10, 2); - } - load_plugin_textdomain('smtp-mailer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/'); - } - - function plugin_url() { - if ($this->plugin_url) - return $this->plugin_url; - return $this->plugin_url = plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__)); - } - - function plugin_path() { - if ($this->plugin_path) - return $this->plugin_path; - return $this->plugin_path = untrailingslashit(plugin_dir_path(__FILE__)); - } - - function add_plugin_action_links($links, $file) { - if ($file == plugin_basename(dirname(__FILE__) . '/main.php')) { - $links[] = ''.__('Settings', 'smtp-mailer').''; - } - return $links; - } - - function options_menu() { - add_options_page(__('SMTP Mailer', 'smtp-mailer'), __('SMTP Mailer', 'smtp-mailer'), 'manage_options', 'smtp-mailer-settings', array($this, 'options_page')); - } - - function options_page() { - $plugin_tabs = array( - 'smtp-mailer-settings' => __('General', 'smtp-mailer'), - 'smtp-mailer-settings&action=test-email' => __('Test Email', 'smtp-mailer'), - 'smtp-mailer-settings&action=server-info' => __('Server Info', 'smtp-mailer'), - ); - $url = "https://wphowto.net/smtp-mailer-plugin-for-wordpress-1482"; - $link_text = sprintf(__('Please visit the SMTP Mailer documentation page for usage instructions.', 'smtp-mailer'), esc_url($url)); - $allowed_html_tags = array( - 'a' => array( - 'href' => array(), - 'target' => array() - ) - ); - echo '

SMTP Mailer v' . SMTP_MAILER_VERSION . '

'; - echo '
'.wp_kses($link_text, $allowed_html_tags).'
'; - $current = ''; - $action = ''; - if (isset($_GET['page'])) { - $current = sanitize_text_field($_GET['page']); - if (isset($_GET['action'])) { - $action = sanitize_text_field($_GET['action']); - $current .= "&action=" . $action; - } - } - $content = ''; - $content .= ''; - $allowed_html_tags = array( - 'a' => array( - 'href' => array(), - 'class' => array() - ), - 'h2' => array( - 'href' => array(), - 'class' => array() - ) - ); - echo wp_kses($content, $allowed_html_tags); - if(!empty($action)) - { - switch($action) - { - case 'test-email': - $this->test_email_settings(); - break; - case 'server-info': - $this->server_info_settings(); - break; - } - } - else - { - $this->general_settings(); - } - echo '
'; - } - - function test_email_settings(){ - if(isset($_POST['smtp_mailer_send_test_email'])){ - $nonce = $_REQUEST['_wpnonce']; - if (!wp_verify_nonce($nonce, 'smtp_mailer_test_email')) { - wp_die(__('Error! Nonce Security Check Failed! please send the test email again.', 'smtp-mailer')); - } - $to = ''; - if(isset($_POST['smtp_mailer_to_email']) && !empty($_POST['smtp_mailer_to_email'])){ - $to = sanitize_email($_POST['smtp_mailer_to_email']); - } - $subject = ''; - if(isset($_POST['smtp_mailer_email_subject']) && !empty($_POST['smtp_mailer_email_subject'])){ - $subject = sanitize_text_field($_POST['smtp_mailer_email_subject']); - } - $message = ''; - if(isset($_POST['smtp_mailer_email_body']) && !empty($_POST['smtp_mailer_email_body'])){ - $message = sanitize_text_field($_POST['smtp_mailer_email_body']); - } - wp_mail($to, $subject, $message); - } - ?> -
- - - - - - - - - - - - - - - - - - - - - - - -
-

-

-

- -

-
- - - -

'; - echo __('Settings Saved!', 'smtp-mailer'); - echo '

'; - } - - $options = smtp_mailer_get_option(); - if(!is_array($options)){ - $options = smtp_mailer_get_empty_options_array(); - } - - // Avoid warning notice since this option was added later - if(!isset($options['disable_ssl_verification'])){ - $options['disable_ssl_verification'] = ''; - } - - ?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- -

-
-

-

- -

-
-

-

-

value="1"> -

- -

-
- - -
-

-
- 0 ) { - $from_name = substr( $content, 0, $bracket_pos ); - $from_name = str_replace( '"', '', $from_name ); - $from_name = trim( $from_name ); - } - - $from_email = substr( $content, $bracket_pos + 1 ); - $from_email = str_replace( '>', '', $from_email ); - $from_email = trim( $from_email ); - - // Avoid setting an empty $from_email. - } elseif ( '' !== trim( $content ) ) { - $from_email = trim( $content ); - } - break; - case 'content-type': - if ( str_contains( $content, ';' ) ) { - list( $type, $charset_content ) = explode( ';', $content ); - $content_type = trim( $type ); - if ( false !== stripos( $charset_content, 'charset=' ) ) { - $charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) ); - } elseif ( false !== stripos( $charset_content, 'boundary=' ) ) { - $boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) ); - $charset = ''; - } - - // Avoid setting an empty $content_type. - } elseif ( '' !== trim( $content ) ) { - $content_type = trim( $content ); - } - break; - case 'cc': - $cc = array_merge( (array) $cc, explode( ',', $content ) ); - break; - case 'bcc': - $bcc = array_merge( (array) $bcc, explode( ',', $content ) ); - break; - case 'reply-to': - $reply_to = array_merge( (array) $reply_to, explode( ',', $content ) ); - break; - default: - // Add it to our grand headers array. - $headers[ trim( $name ) ] = trim( $content ); - break; - } - } - } - } - - // Empty out the values that may be set. - $phpmailer->clearAllRecipients(); - $phpmailer->clearAttachments(); - $phpmailer->clearCustomHeaders(); - $phpmailer->clearReplyTos(); - $phpmailer->Body = ''; - $phpmailer->AltBody = ''; - - // Set "From" name and email. - - // If we don't have a name from the input headers. - if ( ! isset( $from_name ) ) { - $from_name = $options['from_name'];//'WordPress'; - } - - /* - * If we don't have an email from the input headers, default to wordpress@$sitename - * Some hosts will block outgoing mail from this address if it doesn't exist, - * but there's no easy alternative. Defaulting to admin_email might appear to be - * another option, but some hosts may refuse to relay mail from an unknown domain. - * See https://core.trac.wordpress.org/ticket/5007. - */ - if ( ! isset( $from_email ) ) { - // Get the site domain and get rid of www. - $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST ); - $from_email = 'wordpress@'; - - if ( null !== $sitename ) { - if ( str_starts_with( $sitename, 'www.' ) ) { - $sitename = substr( $sitename, 4 ); - } - - $from_email .= $sitename; - } - $from_email = $options['from_email'];//'wordpress@' . $sitename; - } - - /** - * Filters the email address to send from. - * - * @since 2.2.0 - * - * @param string $from_email Email address to send from. - */ - $from_email = apply_filters( 'wp_mail_from', $from_email ); - - /** - * Filters the name to associate with the "from" email address. - * - * @since 2.3.0 - * - * @param string $from_name Name associated with the "from" email address. - */ - $from_name = apply_filters( 'wp_mail_from_name', $from_name ); - - try { - $phpmailer->setFrom( $from_email, $from_name, false ); - } catch ( PHPMailer\PHPMailer\Exception $e ) { - $mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); - $mail_error_data['phpmailer_exception_code'] = $e->getCode(); - - /** This filter is documented in wp-includes/pluggable.php */ - do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) ); - - return false; - } - - // Set mail's subject and body. - $phpmailer->Subject = $subject; - $phpmailer->Body = $message; - - // Set destination addresses, using appropriate methods for handling addresses. - $address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' ); - - foreach ( $address_headers as $address_header => $addresses ) { - if ( empty( $addresses ) ) { - continue; - } - - foreach ( (array) $addresses as $address ) { - try { - // Break $recipient into name and address parts if in the format "Foo ". - $recipient_name = ''; - - if ( preg_match( '/(.*)<(.+)>/', $address, $matches ) ) { - if ( count( $matches ) === 3 ) { - $recipient_name = $matches[1]; - $address = $matches[2]; - } - } - - switch ( $address_header ) { - case 'to': - $phpmailer->addAddress( $address, $recipient_name ); - break; - case 'cc': - $phpmailer->addCc( $address, $recipient_name ); - break; - case 'bcc': - $phpmailer->addBcc( $address, $recipient_name ); - break; - case 'reply_to': - $phpmailer->addReplyTo( $address, $recipient_name ); - break; - } - } catch ( PHPMailer\PHPMailer\Exception $e ) { - continue; - } - } - } - - // Tell PHPMailer to use SMTP - $phpmailer->isSMTP(); //$phpmailer->isMail(); - // Set the hostname of the mail server - $phpmailer->Host = $options['smtp_host']; - // Whether to use SMTP authentication - if(isset($options['smtp_auth']) && $options['smtp_auth'] == "true"){ - $phpmailer->SMTPAuth = true; - // SMTP username - $phpmailer->Username = $options['smtp_username']; - // SMTP password - $phpmailer->Password = base64_decode($options['smtp_password']); - } - // Whether to use encryption - $type_of_encryption = $options['type_of_encryption']; - if($type_of_encryption=="none"){ - $type_of_encryption = ''; - } - $phpmailer->SMTPSecure = $type_of_encryption; - // SMTP port - $phpmailer->Port = $options['smtp_port']; - - // Whether to enable TLS encryption automatically if a server supports it - $phpmailer->SMTPAutoTLS = false; - //enable debug when sending a test mail - if(isset($_POST['smtp_mailer_send_test_email'])){ - $phpmailer->SMTPDebug = 4; - // Ask for HTML-friendly debug output - $phpmailer->Debugoutput = 'html'; - } - - //disable ssl certificate verification if checked - if(isset($options['disable_ssl_verification']) && !empty($options['disable_ssl_verification'])){ - $phpmailer->SMTPOptions = array( - 'ssl' => array( - 'verify_peer' => false, - 'verify_peer_name' => false, - 'allow_self_signed' => true - ) - ); - } - // Set Content-Type and charset. - - // If we don't have a Content-Type from the input headers. - if ( ! isset( $content_type ) ) { - $content_type = 'text/plain'; - } - - /** - * Filters the wp_mail() content type. - * - * @since 2.3.0 - * - * @param string $content_type Default wp_mail() content type. - */ - $content_type = apply_filters( 'wp_mail_content_type', $content_type ); - - $phpmailer->ContentType = $content_type; - - // Set whether it's plaintext, depending on $content_type. - if ( 'text/html' === $content_type ) { - $phpmailer->isHTML( true ); - } - - // If we don't have a charset from the input headers. - if ( ! isset( $charset ) ) { - $charset = get_bloginfo( 'charset' ); - } - - /** - * Filters the default wp_mail() charset. - * - * @since 2.3.0 - * - * @param string $charset Default email charset. - */ - $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); - - // Set custom headers. - if ( ! empty( $headers ) ) { - foreach ( (array) $headers as $name => $content ) { - // Only add custom headers not added automatically by PHPMailer. - if ( ! in_array( $name, array( 'MIME-Version', 'X-Mailer' ), true ) ) { - try { - $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); - } catch ( PHPMailer\PHPMailer\Exception $e ) { - continue; - } - } - } - - if ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) { - $phpmailer->addCustomHeader( sprintf( 'Content-Type: %s; boundary="%s"', $content_type, $boundary ) ); - } - } - - if ( isset( $attachments ) && ! empty( $attachments ) ) { - foreach ( $attachments as $filename => $attachment ) { - $filename = is_string( $filename ) ? $filename : ''; - - try { - $phpmailer->addAttachment( $attachment, $filename ); - } catch ( PHPMailer\PHPMailer\Exception $e ) { - continue; - } - } - } - - /** - * Fires after PHPMailer is initialized. - * - * @since 2.2.0 - * - * @param PHPMailer $phpmailer The PHPMailer instance (passed by reference). - */ - do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); - - $mail_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); - - // Send! - try { - $send = $phpmailer->send(); - - /** - * Fires after PHPMailer has successfully sent an email. - * - * The firing of this action does not necessarily mean that the recipient(s) received the - * email successfully. It only means that the `send` method above was able to - * process the request without any errors. - * - * @since 5.9.0 - * - * @param array $mail_data { - * An array containing the email recipient(s), subject, message, headers, and attachments. - * - * @type string[] $to Email addresses to send message. - * @type string $subject Email subject. - * @type string $message Message contents. - * @type string[] $headers Additional headers. - * @type string[] $attachments Paths to files to attach. - * } - */ - do_action( 'wp_mail_succeeded', $mail_data ); - - return $send; - } catch ( PHPMailer\PHPMailer\Exception $e ) { - $mail_data['phpmailer_exception_code'] = $e->getCode(); - - /** - * Fires after a PHPMailer\PHPMailer\Exception is caught. - * - * @since 4.4.0 - * - * @param WP_Error $error A WP_Error object with the PHPMailer\PHPMailer\Exception message, and an array - * containing the mail recipient, subject, message, headers, and attachments. - */ - do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_data ) ); - - return false; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/readme.txt b/wp-content/upgrade-temp-backup/plugins/smtp-mailer/readme.txt deleted file mode 100644 index 150465ad..00000000 --- a/wp-content/upgrade-temp-backup/plugins/smtp-mailer/readme.txt +++ /dev/null @@ -1,163 +0,0 @@ -=== SMTP Mailer === -Contributors: naa986 -Donate link: https://wphowto.net/ -Tags: email, mail, smtp, phpmailer -Requires at least: 6.3 -Tested up to: 6.3 -Stable tag: 1.1.9 -License: GPLv2 or later -License URI: http://www.gnu.org/licenses/gpl-2.0.html - -Configure a SMTP server to send email from your WordPress site. Configure the wp_mail() function to use SMTP instead of the PHP mail() function. - -== Description == - -[SMTP Mailer](https://wphowto.net/smtp-mailer-plugin-for-wordpress-1482) plugin allows you to configure a mail server which handles all outgoing email from your website. It takes control of the wp_mail function and use SMTP instead. - -https://www.youtube.com/watch?v=7O_jgtykcEk&rel=0 - -=== SMTP Mailer Settings === - -* **SMTP Host**: Your outgoing mail server (e.g. smtp.gmail.com). -* **SMTP Authentication**: Whether to use SMTP authentication when sending an email (True/False). If you choose to authenticate you will also need to provide your username and password. -* **SMTP Username**: The username to connect to your SMTP server. -* **SMTP Password**: The password to connect to your SMTP server. -* **Type of Encryption**: The encryption to be used when sending an email (TLS/SSL/No Encryption. TLS is recommended). -* **SMTP Port**: The port to be used when sending an email (587/465/25). If you choose TLS the port should be set to 587. For SSL use port 465 instead. -* **From Email Address**: The email address to be used as the From Address when sending an email. -* **From Name**: The name to be used as the From Name when sending an email. - -=== SMTP Mailer Test Email === - -Once you have configured the settings you can send a test email to check the functionality of the plugin. - -* **To**: Email address of the recipient. -* **Subject**: Subject of the email. -* **Message**: Email body. - -=== Known Compatibility === - -SMTP Mailer should work with any plugin that uses the WordPress Mail function. However, It has been tested with the following form and contact form plugins: - -* Contact Form 7 -* Jetpack Contact Form -* Visual Form Builder -* Fast Secure Contact Form -* Formidable Forms -* Contact Form by BestWebSoft - -For detailed setup instructions please visit the [SMTP Mailer](https://wphowto.net/smtp-mailer-plugin-for-wordpress-1482) plugin page. - -== Installation == - -1. Go to the Add New plugins screen in your WordPress Dashboard -1. Click the upload tab -1. Browse for the plugin file (smtp-mailer.zip) on your computer -1. Click "Install Now" and then hit the activate button - -== Frequently Asked Questions == - -= Can I send email via SMTP from my website using this plugin? = - -Yes. - -= Can I use this plugin with Gmail SMTP? = - -Yes. - -= Can I use this plugin on any SMTP port? = - -Yes. - -= Can I use this plugin with Sendinblue SMTP? = - -Yes. - -= Can I use this plugin with Mailgun SMTP? = - -Yes. - -= Can I use this plugin with SendGrid SMTP? = - -Yes. - -= Can I use this plugin with Postmark SMTP? = - -Yes. - -= Can I use this plugin with Office365 SMTP? = - -Yes. - -= Can I use this plugin with ZohoMail SMTP? = - -Yes. - -== Screenshots == - -1. SMTP Mailer Settings -2. SMTP Mailer Test Email Tab - -== Upgrade Notice == -none - -== Changelog == - -= 1.1.9 = -* Additional check for the settings link. - -= 1.1.8 = -* Removed admin notices to avoid confusion since configurations can vary on different servers. - -= 1.1.7 = -* WordPress 6.3 compatibility update. - -= 1.1.6 = -* WordPress 6.2 compatibility update. - -= 1.1.5 = -* Compatibility update for WordPress 6.1. - -= 1.1.4 = -* Updated the mail function for WordPress 6.0. - -= 1.1.3 = -* Updated the mail function for WordPress 5.9. - -= 1.1.2 = -* Fixed an issue that could cause an Undefined variable error if $attachments was not set. - -= 1.1.1 = -* WordPress 5.7 compatibility update. - -= 1.1.0 = -* The password field can be left empty when updating the settings. - -= 1.0.9 = -* Updated the code to be compatible with WordPress 5.5. - -= 1.0.8 = -* SMTP Mailer is compatible with WordPress 5.3. - -= 1.0.7 = -* SMTP Mailer now checks for a valid nonce when sending a test email. - -= 1.0.6 = -* SMTP Mailer no longer shows the saved password in the settings. - -= 1.0.5 = -* SMTP Mailer is now compatible with WordPress 4.9. - -= 1.0.4 = -* Updated the mail() function by setting its minimum requirements to WordPress 4.8. -* "phpmailer_init" action hook is now enabled so it can be used by other plugins. - -= 1.0.3 = -* Fixed a bug where an apostrophe in the password would cause SMTP authentication failure. - -= 1.0.2 = -* SMTP Mailer now supports the "wp_mail_failed" hook which fires after a phpmailerException is caught. -* Added a new option to bypass this error on some servers where the SSL certificate is not properly configured - Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed. - -= 1.0.1 = -* First commit diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Base_Page_Settings.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Base_Page_Settings.php deleted file mode 100644 index 5c0023ef..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Base_Page_Settings.php +++ /dev/null @@ -1,281 +0,0 @@ -_config = Dispatcher::config(); - $this->_config_master = Dispatcher::config_master(); - $this->_page = Util_Admin::get_current_page(); - } - - /** - * Render header. - */ - public function options() { - $this->view(); - } - - /** - * Render footer. - */ - public function render_footer() { - include W3TC_INC_OPTIONS_DIR . '/common/footer.php'; - } - - /** - * Returns true if config section is sealed. - * - * @param string $section Config section. - * - * @return boolean - */ - protected function is_sealed( $section ) { - return true; - } - - /** - * Returns true if we edit master config. - * - * @return boolean - */ - protected function is_master() { - return $this->_config->is_master(); - } - - /** - * Prints checkbox with config option value. - * - * @param string $option_id Option ID. - * @param bool $disabled Disabled flag. - * @param string $class_prefix Class prefix. - * @param bool $label Label. - * @param bool $force_value Override value. - */ - protected function checkbox( $option_id, $disabled = false, $class_prefix = '', $label = true, $force_value = null ) { - $disabled = $disabled || $this->_config->is_sealed( $option_id ); - $name = Util_Ui::config_key_to_http_name( $option_id ); - - if ( ! $disabled ) { - echo ''; - } - - if ( $label ) { - echo ''; - } - } - - /** - * Echos an element - * - * @param string $type - * @param string $id - * @param string $name - * @param mixed $value - * @param bool $disabled - */ - public static function element( $type, $id, $name, $value, $disabled = false ) { - switch ( $type ) { - case 'textbox': - self::textbox( $id, $name, $value, $disabled ); - break; - case 'password': - self::passwordbox( $id, $name, $value, $disabled ); - break; - case 'textarea': - self::textarea( $id, $name, $value, $disabled ); - break; - case 'checkbox': - default: - self::checkbox( $id, $name, $value, $disabled ); - break; - } - } - - public static function checkbox2( $e ) { - self::checkbox( - $e['name'], - $e['name'], - $e['value'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ), - ( isset( $e['label'] ) ? $e['label'] : null ) - ); - } - - public static function radiogroup2( $e ) { - self::radiogroup( - $e['name'], - $e['value'], - $e['values'], - $e['disabled'], - $e['separator'] - ); - } - - public static function selectbox2( $e ) { - self::selectbox( - $e['name'], - $e['name'], - $e['value'], - $e['values'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ), - ( isset( $e['optgroups'] ) ? $e['optgroups'] : null ) - ); - } - - public static function textbox2( $e ) { - self::textbox( - $e['name'], - $e['name'], - $e['value'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ), - ( ! empty( $e['size'] ) ? $e['size'] : 20 ), - ( ! empty( $e['type'] ) ? $e['type'] : 'text' ), - ( ! empty( $e['placeholder'] ) ? $e['placeholder'] : '' ) - ); - } - - public static function textarea2( $e ) { - self::textarea( - $e['name'], - $e['name'], - $e['value'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ) - ); - } - - public static function control2( $a ) { - if ( 'checkbox' === $a['control'] ) { - self::checkbox2( - array( - 'name' => $a['control_name'], - 'value' => $a['value'], - 'disabled' => $a['disabled'], - 'label' => $a['checkbox_label'], - ) - ); - } elseif ( 'radiogroup' === $a['control'] ) { - self::radiogroup2( - array( - 'name' => $a['control_name'], - 'value' => $a['value'], - 'disabled' => $a['disabled'], - 'values' => $a['radiogroup_values'], - 'separator' => isset( $a['radiogroup_separator'] ) ? $a['radiogroup_separator'] : '', - ) - ); - } elseif ( 'selectbox' === $a['control'] ) { - self::selectbox2( - array( - 'name' => $a['control_name'], - 'value' => $a['value'], - 'disabled' => $a['disabled'], - 'values' => $a['selectbox_values'], - 'optgroups' => isset( $a['selectbox_optgroups'] ) ? $a['selectbox_optgroups'] : null, - ) - ); - } elseif ( 'textbox' === $a['control'] ) { - self::textbox2( - array( - 'name' => $a['control_name'], - 'value' => $a['value'], - 'disabled' => $a['disabled'], - 'type' => isset( $a['textbox_type'] ) ? $a['textbox_type'] : null, - 'size' => isset( $a['textbox_size'] ) ? $a['textbox_size'] : null, - 'placeholder' => isset( $a['textbox_placeholder'] ) ? $a['textbox_placeholder'] : null, - ) - ); - } elseif ( 'textarea' === $a['control'] ) { - self::textarea2( - array( - 'name' => $a['control_name'], - 'value' => $a['value'], - 'disabled' => $a['disabled'], - ) - ); - } elseif ( 'none' === $a['control'] ) { - echo wp_kses( $a['none_label'], self::get_allowed_html_for_wp_kses_from_content( $a['none_label'] ) ); - } elseif ( 'button' === $a['control'] ) { - echo ''; - } - } - - /** - * Get table classes for tables including pro features. - * - * When on the free version, tables with pro features have additional classes added to help highlight - * the premium feature. If the user is on pro, this class is omitted. - * - * @since 0.14.3 - * - * @return string - */ - public static function table_class() { - $table_class[] = 'form-table'; - - if ( ! Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { - $table_class[] = 'w3tc-pro-feature'; - } - - return implode( ' ', $table_class ); - } - - /** - * Renders element with controls - * id => - * label => - * label_class => - * => details - * style - default is label,controls view, - * alternative is one-column view - */ - public static function table_tr( $a ) { - $id = isset( $a['id'] ) ? $a['id'] : ''; - $a = apply_filters( 'w3tc_ui_settings_item', $a ); - - echo ''; - if ( isset( $a['label'] ) ) { - self::label( $id, $a['label'] ); - } - - echo "\n\n"; - - foreach ( $a as $key => $e ) { - if ( 'checkbox' === $key ) { - self::checkbox( - $id, - isset( $e['name'] ) ? $e['name'] : null, - $e['value'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ), - ( isset( $e['label'] ) ? $e['label'] : null ) - ); - } elseif ( 'description' === $key ) { - echo '

' . wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ) . '

'; - } elseif ( 'hidden' === $key ) { - self::hidden( '', $e['name'], $e['value'] ); - } elseif ( 'html' === $key ) { - echo wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ); - } elseif ( 'radiogroup' === $key ) { - self::radiogroup( - $e['name'], - $e['value'], - $e['values'], - $e['disabled'], - $e['separator'] - ); - } elseif ( 'selectbox' === $key ) { - self::selectbox( - $id, - $e['name'], - $e['value'], - $e['values'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ), - ( isset( $e['optgroups'] ) ? $e['optgroups'] : null ) - ); - } elseif ( 'textbox' === $key ) { - self::textbox( - $id, - $e['name'], - $e['value'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ), - ( ! empty( $e['size'] ) ? $e['size'] : 20 ), - ( ! empty( $e['type'] ) ? $e['type'] : 'text' ), - ( ! empty( $e['placeholder'] ) ? $e['placeholder'] : '' ) - ); - } elseif ( 'textarea' === $key ) { - self::textarea( - $id, - $e['name'], - $e['value'], - ( isset( $e['disabled'] ) ? $e['disabled'] : false ) - ); - } - } - - echo "\n"; - } - - /** - * Prints configuration item UI based on description - * key => configuration key - * label => configuration key's as its introduced to the user - * value => it's value - * disabled => if disabled - * - * control => checkbox | radiogroup | selectbox | textbox - * checkbox_label => text shown after the textbox - * radiogroup_values => array of possible values for radiogroup - * selectbox_values => array of possible values for dropdown - * selectbox_optgroups => - * textbox_size => - * - * control_after => something after control to add - * description => description shown to the user below - */ - public static function config_item( $a ) { - /* - * Some items we do not want shown in the free edition. - * - * By default, they will show in free, unless 'show_in_free' is specifically passed in as false. - */ - $is_w3tc_free = ! Util_Environment::is_w3tc_pro( Dispatcher::config() ); - $show_in_free = ! isset( $a['show_in_free'] ) || (bool) $a['show_in_free']; - if ( ! $show_in_free && $is_w3tc_free ) { - return; - } - - $a = self::config_item_preprocess( $a ); - - if ( 'w3tc_single_column' === $a['label_class'] ) { - echo ''; - } else { - echo ''; - - if ( ! empty( $a['label'] ) ) { - self::label( $a['control_name'], $a['label'] ); - } - - echo "\n\n"; - } - - self::control2( $a ); - - if ( isset( $a['control_after'] ) ) { - echo wp_kses( - $a['control_after'], - self::get_allowed_html_for_wp_kses_from_content( $a['control_after'] ) - ); - } - if ( isset( $a['description'] ) ) { - echo wp_kses( - sprintf( - '%1$s%2$s%3$s', - '

', - $a['description'], - '

' - ), - array( - 'p' => array( - 'class' => array(), - ), - 'acronym' => array( - 'title' => array(), - ), - ) - ); - } - - echo ( isset( $a['style'] ) ? '' : '' ); - echo "\n"; - } - - public static function config_item_extension_enabled( $a ) { - if ( 'w3tc_single_column' === $a['label_class'] ) { - echo ''; - } else { - echo ''; - - if ( ! empty( $a['label'] ) ) { - self::label( $a['control_name'], $a['label'] ); - } - - echo "\n\n"; - } - - if ( isset( $a['pro'] ) ) { - self::pro_wrap_maybe_start(); - } - - $c = Dispatcher::config(); - self::checkbox2( - array( - 'name' => 'extension__' . self::config_key_to_http_name( $a['extension_id'] ), - 'value' => $c->is_extension_active_frontend( $a['extension_id'] ), - 'label' => $a['checkbox_label'], - 'disabled' => isset( $a['disabled'] ) ? $a['disabled'] : false, - ) - ); - - if ( isset( $a['description'] ) ) { - echo '

' . wp_kses( $a['description'], self::get_allowed_html_for_wp_kses_from_content( $a['description'] ) ) . '

'; - } - - if ( isset( $a['pro'] ) ) { - self::pro_wrap_maybe_end( 'extension__' . self::config_key_to_http_name( $a['extension_id'] ) ); - } - - echo ( isset( $a['style'] ) ? '' : '' ); - echo "\n"; - } - - public static function config_item_pro( $a ) { - $a = self::config_item_preprocess( $a ); - - if ( 'w3tc_single_column' === $a['label_class'] ) { - echo ''; - } elseif ( 'w3tc_no_trtd' !== $a['label_class'] ) { - echo ''; - - if ( ! empty( $a['label'] ) ) { - self::label( $a['control_name'], $a['label'] ); - } - - echo "\n\n"; - } - - // If wrap_separate is not set we wrap everything. - if ( ! isset( $a['wrap_separate'] ) ) { - self::pro_wrap_maybe_start(); - } - - self::control2( $a ); - - if ( isset( $a['control_after'] ) ) { - echo wp_kses( $a['control_after'], self::get_allowed_html_for_wp_kses_from_content( $a['control_after'] ) ); - } - - // If wrap_separate is set we wrap only the description. - if ( isset( $a['wrap_separate'] ) ) { - // If not pro we add a spacer for better separation of control element and wrapper. - if ( ! Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { - echo '

'; - } - self::pro_wrap_maybe_start(); - } - - if ( isset( $a['description'] ) ) { - self::pro_wrap_description( $a['excerpt'], $a['description'], $a['control_name'] ); - } - - self::pro_wrap_maybe_end( $a['control_name'] ); - - if ( 'w3tc_no_trtd' !== $a['label_class'] ) { - echo ( isset( $a['style'] ) ? '' : '' ); - echo "\n"; - } - } - - public static function config_item_preprocess( $a ) { - $c = Dispatcher::config(); - - if ( ! isset( $a['value'] ) || is_null( $a['value'] ) ) { - $a['value'] = $c->get( $a['key'] ); - if ( is_array( $a['value'] ) ) { - $a['value'] = implode( "\n", $a['value'] ); - } - } - - if ( ! isset( $a['disabled'] ) || is_null( $a['disabled'] ) ) { - $a['disabled'] = $c->is_sealed( $a['key'] ); - } - - if ( empty( $a['label'] ) ) { - $a['label'] = self::config_label( $a['key'] ); - } - - $a['control_name'] = self::config_key_to_http_name( $a['key'] ); - $a['label_class'] = empty( $a['label_class'] ) ? '' : $a['label_class']; - if ( empty( $a['label_class'] ) && 'checkbox' === $a['control'] ) { - $a['label_class'] = 'w3tc_config_checkbox'; - } - - $action_key = $a['key']; - if ( is_array( $action_key ) ) { - $action_key = 'extension.' . $action_key[0] . '.' . $action_key[1]; - } - - return apply_filters( 'w3tc_ui_config_item_' . $action_key, $a ); - } - - /** - * Displays config item - caching engine selectbox - */ - public static function config_item_engine( $a ) { - if ( isset( $a['empty_value'] ) && $a['empty_value'] ) { - $values[''] = array( - 'label' => 'Please select a method', - ); - } - - $values['file'] = array( - 'label' => __( 'Disk', 'w3-total-cache' ), - 'optgroup' => 0, - ); - $values['apc'] = array( - 'disabled' => ! Util_Installed::apc(), - 'label' => __( 'Opcode: Alternative PHP Cache (APC / APCu)', 'w3-total-cache' ), - 'optgroup' => 1, - ); - $values['eaccelerator'] = array( - 'disabled' => ! Util_Installed::eaccelerator(), - 'label' => __( 'Opcode: eAccelerator', 'w3-total-cache' ), - 'optgroup' => 1, - ); - $values['xcache'] = array( - 'disabled' => ! Util_Installed::xcache(), - 'label' => __( 'Opcode: XCache', 'w3-total-cache' ), - 'optgroup' => 1, - ); - $values['wincache'] = array( - 'disabled' => ! Util_Installed::wincache(), - 'label' => __( 'Opcode: WinCache', 'w3-total-cache' ), - 'optgroup' => 1, - ); - $values['memcached'] = array( - 'disabled' => ! Util_Installed::memcached(), - 'label' => __( 'Memcached', 'w3-total-cache' ), - 'optgroup' => 2, - ); - $values['redis'] = array( - 'disabled' => ! Util_Installed::redis(), - 'label' => __( 'Redis', 'w3-total-cache' ), - 'optgroup' => 2, - ); - - $item_engine_config = array( - 'key' => $a['key'], - 'label' => ( isset( $a['label'] ) ? $a['label'] : null ), - 'disabled' => ( isset( $a['disabled'] ) ? $a['disabled'] : null ), - 'control' => 'selectbox', - 'selectbox_values' => $values, - 'selectbox_optgroups' => array( - __( 'Shared Server:', 'w3-total-cache' ), - __( 'Dedicated / Virtual Server:', 'w3-total-cache' ), - __( 'Multiple Servers:', 'w3-total-cache' ), - ), - 'control_after' => isset( $a['control_after'] ) ? $a['control_after'] : null, - ); - - if ( isset( $a['pro'] ) ) { - self::config_item_pro( $item_engine_config ); - } else { - self::config_item( $item_engine_config ); - } - } - - public static function pro_wrap_maybe_start() { - if ( Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { - return; - } - - ?> -
-
★ PRO
-
- ' . wp_kses( $excerpt_clean, self::get_allowed_html_for_wp_kses_from_content( $excerpt_clean ) ) . '

'; - - if ( ! empty( $description ) ) { - $d = array_map( - function( $e ) { - return '

' . wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ) . '

'; - }, - $description - ); - - $descriptions = implode( "\n", $d ); - - echo '
' . wp_kses( $descriptions, self::get_allowed_html_for_wp_kses_from_content( $descriptions ) ) . '
'; - echo '' . esc_html( __( 'Show More', 'w3-total-cache' ) ) . ''; - } - } - - public static function pro_wrap_maybe_end( $button_data_src ) { - if ( Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { - return; - } - - ?> -
-
- -
-
- -
-

- -

-
- -
-
- is_master() ) { - return; - } - - if ( $c->get_boolean( $a['key'] ) ) { - $name = 'w3tc_config_overloaded_disable~' . self::config_key_to_http_name( $a['key'] ); - $value = __( 'Use common settings', 'w3-total-cache' ); - } else { - $name = 'w3tc_config_overloaded_enable~' . self::config_key_to_http_name( $a['key'] ); - $value = __( 'Use specific settings', 'w3-total-cache' ); - } - - echo '
'; - echo ''; - echo '
'; - } - - /** - * Get the admin URL based on the path and the interface (network or site). - * - * @param string $path Admin path/URI. - * @return string - */ - public static function admin_url( $path ) { - return is_network_admin() ? network_admin_url( $path ) : admin_url( $path ); - } - - /** - * Returns a preview link with current state - * - * @return string - */ - public static function preview_link() { - return self::button_link( - __( 'Preview', 'w3-total-cache' ), - self::url( array( 'w3tc_default_previewing' => 'y' ) ), - true - ); - } - - /** - * Takes seconds and converts to array('Nh ','Nm ', 'Ns ', 'Nms ') or "Nh Nm Ns Nms" - * - * @param unknown $input - * @param bool $string - * @return array|string - */ - public static function secs_to_time( $input, $string = true ) { - $input = (float) $input; - $time = array(); - $msecs = floor( $input * 1000 % 1000 ); - $seconds = $input % 60; - - $minutes = floor( $input / 60 ) % 60; - $hours = floor( $input / 60 / 60 ) % 60; - - if ( $hours ) { - $time[] = $hours; - } - if ( $minutes ) { - $time[] = sprintf( '%dm', $minutes ); - } - if ( $seconds ) { - $time[] = sprintf( '%ds', $seconds ); - } - if ( $msecs ) { - $time[] = sprintf( '%dms', $msecs ); - } - - if ( empty( $time ) ) { - $time[] = sprintf( '%dms', 0 ); - } - if ( $string ) { - return implode( ' ', $time ); - } - return $time; - } - - /** - * Returns option name accepted by W3TC as http paramter - * from it's id (full name from config file) - */ - public static function config_key_to_http_name( $id ) { - if ( is_array( $id ) ) { - $id = $id[0] . '___' . $id[1]; - } - - return str_replace( '.', '__', $id ); - } - - /* - * Converts configuration key returned in http _GET/_POST - * to configuration key - */ - public static function config_key_from_http_name( $http_key ) { - $a = explode( '___', $http_key ); - if ( count( $a ) === 2 ) { - $a[0] = self::config_key_from_http_name( $a[0] ); - $a[1] = self::config_key_from_http_name( $a[1] ); - return $a; - } - - return str_replace( '__', '.', $http_key ); - } - - public static function get_allowed_html_for_wp_kses_from_content( $content ) { - $allowed_html = array(); - - if ( empty( $content ) ) { - return $allowed_html; - } - - $dom = new DOMDocument(); - @$dom->loadHTML( $content ); - foreach ( $dom->getElementsByTagName( '*' ) as $tag ) { - $tagname = $tag->tagName; - foreach ( $tag->attributes as $attribute_name => $attribute_val ) { - $allowed_html[ $tagname ][ $attribute_name ] = array(); - } - $allowed_html[ $tagname ] = empty( $allowed_html[ $tagname ] ) ? array() : $allowed_html[ $tagname ]; - } - return $allowed_html; - } - - /** - * Prints breadcrumb - * - * @return void - */ - public static function print_breadcrumb() { - $page = ! empty( Util_Admin::get_current_extension() ) ? Util_Admin::get_current_extension() : Util_Admin::get_current_page(); - $page_mapping = Util_PageUrls::get_page_mapping( $page ); - $parent = isset( $page_mapping['parent_name'] ) ? '' . esc_html( $page_mapping['parent_name'] ) . '' : ''; - $current = '' . esc_html( $page_mapping['page_name'] ) . ''; - ?> -

- - W3 Total Cache - - -

- get_string( 'license.status' ) - ); - - switch ( $page ) { - case 'w3tc_general': - if ( ! empty( $_REQUEST['view'] ) ) { - break; - } - - $message_bus_link = array(); - if ( Util_Environment::is_w3tc_pro( $config ) ) { - $message_bus_link = array( - array( - 'id' => 'amazon_sns', - 'text' => esc_html__( 'Message Bus', 'w3-total-cache' ), - ), - ); - } - - $licensing_link = array(); - if ( $licensing_visible ) { - $licensing_link = array( - array( - 'id' => 'licensing', - 'text' => esc_html__( 'Licensing', 'w3-total-cache' ), - ), - ); - } - - $links = array_merge( - array( - array( - 'id' => 'general', - 'text' => esc_html__( 'General', 'w3-total-cache' ), - ), - array( - 'id' => 'page_cache', - 'text' => esc_html__( 'Page Cache', 'w3-total-cache' ), - ), - array( - 'id' => 'minify', - 'text' => esc_html__( 'Minify', 'w3-total-cache' ), - ), - array( - 'id' => 'system_opcache', - 'text' => esc_html__( 'Opcode Cache', 'w3-total-cache' ), - ), - array( - 'id' => 'database_cache', - 'text' => esc_html__( 'Database Cache', 'w3-total-cache' ), - ), - array( - 'id' => 'object_cache', - 'text' => esc_html__( 'Object Cache', 'w3-total-cache' ), - ), - array( - 'id' => 'browser_cache', - 'text' => esc_html__( 'Browser Cache', 'w3-total-cache' ), - ), - array( - 'id' => 'cdn', - 'text' => wp_kses( - sprintf( - // translators: 1 opening HTML abbr tag, 2 closing HTML abbr tag. - __( - '%1$sCDN%2$s', - 'w3-total-cache' - ), - '', - '' - ), - array( - 'abbr' => array( - 'title' => array(), - ), - ) - ), - ), - array( - 'id' => 'reverse_proxy', - 'text' => esc_html__( 'Reverse Proxy', 'w3-total-cache' ), - ), - ), - $message_bus_link, - $custom_areas, - $licensing_link, - array( - array( - 'id' => 'miscellaneous', - 'text' => esc_html__( 'Miscellaneous', 'w3-total-cache' ), - ), - array( - 'id' => 'debug', - 'text' => esc_html__( 'Debug', 'w3-total-cache' ), - ), - array( - 'id' => 'image_service', - 'text' => esc_html__( 'WebP Converter', 'w3-total-cache' ), - ), - array( - 'id' => 'google_pagespeed', - 'text' => __( 'Google PageSpeed', 'w3-total-cache' ), - ), - array( - 'id' => 'settings', - 'text' => esc_html__( 'Import / Export Settings', 'w3-total-cache' ), - ), - ) - ); - - $links_buff = array(); - foreach ( $links as $link ) { - $links_buff[] = "{$link['text']}"; - } - - ?> -
- array( - 'href' => array(), - 'class' => array(), - ), - ) - ); - ?> -
- -
- | - | - | - | - | - | - -
- - - -
- | - -
- -
- -
- - - -
- | - | - -
- -
- | - | - | - -
- -
- get_array( 'extensions.active' ); - if ( array_key_exists( 'user-experience-defer-scripts', $extensions_active ) ) { - // If more items are added this will only encompase the Defer Scripts, but if only 1 item show no sub-nav. - ?> - | - - -
- - - -
- | - -
- -
- | - | - -
- -
- | - | - -
- -
- | - -
- -
- -
- -
- | - -
- -
- | - | - | - -
- -
- 500000000 ) - return sprintf( '%.1f GB', $v / 1024 /*KB*/ / 1024 /*MB*/ / 1024/*GB*/ ); - if ( $v > 500000 ) - return sprintf( '%.1f MB', $v / 1024 /*KB*/ / 1024 /*MB*/ ); - else - return sprintf( '%.1f KB', $v / 1024 /*KB*/ ); - } - - - - static public function bytes_to_size2( $a, $p1, $p2 = null, $p3 = null ) { - $v = self::v( $a, $p1, $p2, $p3 ); - if ( is_null( $v ) ) - return 'n/a'; - - return self::bytes_to_size( $v ); - } - - - - static public function percent( $v1, $v2 ) { - if ( $v2 == 0 ) { - return '0 %'; - } elseif ($v1 > $v2 ) { - return '100 %'; - } else { - return sprintf( '%d', $v1 / $v2 * 100 ) . ' %'; - } - } - - - - static public function percent2( $a, $property1, $property2 ) { - if ( !isset( $a[$property1] ) || !isset( $a[$property2] ) ) - return 'n/a'; - else if ( $a[$property2] == 0 ) - return '0 %'; - else - return sprintf( '%d', $a[$property1] / $a[$property2] * 100 ) . ' %'; - } - - - - static public function sum( $history, $property ) { - $v = 0; - foreach ( $history as $i ) { - $item_value = self::v3( $i, $property ); - if ( !empty( $item_value ) ) { - $v += $item_value; - } - } - return $v; - } - - - - static public function avg( $history, $property ) { - $v = 0; - $count = 0; - foreach ( $history as $i ) { - $item_value = self::v3( $i, $property ); - if ( !empty( $item_value ) ) { - $v += $item_value; - $count++; - } - } - return ( $count <= 0 ? 0 : $v / $count ); - } - - - - /** - * Sum up all positive metric values which names start with specified prefix - **/ - static public function sum_by_prefix_positive( &$output, $history, $property_prefix ) { - $property_prefix_len = strlen( $property_prefix ); - - foreach ( $history as $i ) { - foreach ( $i as $key => $value ) { - if ( substr( $key, 0, $property_prefix_len ) == $property_prefix && - $value > 0 ) { - if ( !isset( $output[$key] ) ) { - $output[$key] = 0; - } - - $output[$key] += $value; - } - } - } - } - - - - static public function time_mins( $timestamp ) { - return date( 'm/d/Y H:i', $timestamp ); - } - - - - static public function integer( $v ) { - return number_format( $v ); - } - - - - static public function integer_divideby( $v, $divide_by ) { - if ( $divide_by == 0 ) { - return 'n/a'; - } - - return self::integer( $v / $divide_by ); - } - - - - static public function integer2( $a, $p1, $p2 = null, $p3 = null ) { - $v = self::v( $a, $p1, $p2, $p3 ); - if ( is_null( $v ) ) - return 'n/a'; - else - return number_format( $v ); - } - - - - static public function v( $a, $p1, $p2 = null, $p3 = null ) { - if ( !isset( $a[$p1] ) ) - return null; - - $v = $a[$p1]; - if ( is_null( $p2 ) ) - return $v; - if ( !isset( $v[$p2] ) ) - return null; - - $v = $v[$p2]; - if ( is_null( $p3 ) ) - return $v; - if ( !isset( $v[$p3] ) ) - return null; - - return $v[$p3]; - } - - - - static public function v3( $a, $p ) { - if ( !is_array( $p ) ) { - $p = array( $p ); - } - - $actual = &$a; - for ( $i = 0; $i < count( $p ); $i++) { - $property = $p[$i]; - - if ( !isset( $actual[$property] ) ) { - return null; - } - - $actual = &$actual[$property]; - } - - return $actual; - } - - - - static public function value_per_second( $a, $property1, $property2 ) { - if ( !isset( $a[$property1] ) || !isset( $a[$property2] ) ) - return 'n/a'; - else if ( $a[$property2] == 0 ) - return '0'; - else - return sprintf( '%.1f', $a[$property1] / $a[$property2] * 100 ); - } - - - - static public function value_per_period_seconds( $total, $summary ) { - if ( empty( $summary['period']['seconds'] ) ) - return 'n/a'; - - $period_seconds = $summary['period']['seconds']; - - return sprintf( '%.1f', $total / $period_seconds ); - } - - - - /** - * Special shared code for cache size counting - */ - static public function get_or_init_size_transient( $transient, $summary ) { - $should_count = false; - - $v = get_transient( $transient ); - if ( is_array( $v ) && isset( $v['timestamp_end'] ) && - $v['timestamp_end'] == $summary['period']['timestamp_end'] ) { - return array( $v, false ); - } - - // limit number of processing counting it at the same time - $v = array( - 'timestamp_end' => $summary['period']['timestamp_end'], - 'size_used' => '...counting', - 'items' => '...counting' - ); - set_transient( $transient, $v, 120 ); - return array( $v, true ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php deleted file mode 100644 index 320e8b04..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php +++ /dev/null @@ -1,269 +0,0 @@ -" . __( 'View all', 'w3-total-cache' ) . ''; - self::add( $widget_id, $name, $w3tc_registered_widgets[ $widget_id ]['callback'], $w3tc_registered_widget_controls[ $widget_id ]['callback'] ); - } - - if ( 'POST' === isset( $_SERVER['REQUEST_METHOD'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) : '' && ! empty( Util_Request::get_string( 'widget_id' ) ) ) { - check_admin_referer( 'edit-dashboard-widget_' . Util_Request::get_string( 'widget_id' ), 'dashboard-widget-nonce' ); - ob_start(); // The same hack "wp-admin/widgets.php" uses. - self::trigger_widget_control( Util_Request::get_string( 'widget_id' ) ); - ob_end_clean(); - } - - if ( $update ) { - update_option( 'w3tc_dashboard_widget_options', $widget_options ); - } - - do_action( 'do_meta_boxes', $screen->id, 'normal', '' ); - do_action( 'do_meta_boxes', $screen->id, 'side', '' ); - } - - /** - * Add 2. - * - * @static - * - * @param string $widget_id Widget id. - * @param int $priority Prioroty. - * @param string $widget_name Widget name. - * @param callable $callback Callback. - * @param callable $control_callback Control callback. - * @param string $location Location. - * @param string $header_text Header text. - * @param string $header_class Header class. - */ - public static function add2( $widget_id, $priority, $widget_name, $callback, - $control_callback = null, $location = 'normal', $header_text = null, - $header_class = '' ) { - $o = new _Util_Widget_Postponed( - array( - 'widget_id' => $widget_id, - 'widget_name' => $widget_name, - 'callback' => $callback, - 'control_callback' => $control_callback, - 'location' => $location, - 'header_text' => $header_text, - 'header_class' => $header_class, - ) - ); - - add_action( - 'w3tc_widget_setup', - array( $o, 'wp_dashboard_setup' ), - $priority - ); - - add_action( - 'w3tc_network_dashboard_setup', - array( $o, 'wp_dashboard_setup' ), - $priority - ); - - self::$w3tc_dashboard_widgets[ $widget_id ] = '*'; - } - - /** - * Registers widget. - * - * @static - * - * @param string $widget_id Widget id. - * @param string $widget_name Widget name. - * @param callable $callback Callback. - * @param callable $control_callback Control callback. - * @param string $location Location. - * @param string $header_text Header text. - * @param string $header_class Header class. - */ - public static function add( $widget_id, $widget_name, $callback, - $control_callback = null, $location = 'normal', $header_text = null, - $header_class = '' ) { - $screen = get_current_screen(); - - global $w3tc_dashboard_control_callbacks; - - if ( substr( $widget_name, 0, 1 ) !== '<' ) { - $widget_name = '
' . $widget_name . '
'; - } - - // Link. - if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_string( $control_callback ) ) { - if ( ! $header_text ) { - $header_text = __( 'Configure' ); - } - - $widget_name .= ' ' . - '' . $header_text . ''; - } - - // Ajax callback. - if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) { - $w3tc_dashboard_control_callbacks[ $widget_id ] = $control_callback; - $edit_val = Util_Request::get_string( 'edit' ); - - if ( ! empty( $edit_val ) && $widget_id === $edit_val ) { - list( $url ) = explode( '#', add_query_arg( 'edit', false ), 2 ); - $widget_name .= ' ' . __( 'Cancel', 'w3-total-cache' ) . ''; - - $callback = array( - '\W3TC\Util_Widget', - '_dashboard_control_callback', - ); - } else { - list( $url ) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 ); - $widget_name .= ' ' . __( 'Configure' ) . ''; - } - } - - $side_widgets = array(); - - $priority = 'core'; - - add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority ); - } - - /** - * Dashboard Widgets Controls. - * - * @static - * - * @param string $dashboard Dashboard id. - * @param array $meta_box Meta box info. - */ - public static function _dashboard_control_callback( $dashboard, $meta_box ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore - echo '
'; - self::trigger_widget_control( $meta_box['id'] ); - wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' ); - echo ''; - submit_button( __( 'Submit' ) ); - echo '
'; - } - - /** - * List widgets. - * - * @static - * - * @return string - */ - public static function list_widgets() { - return implode( ',', array_keys( self::$w3tc_dashboard_widgets ) ); - } - - /** - * Calls widget control callback. - * - * @since 0.9.2.6 - * @static - * - * @param int|bool $widget_control_id Registered widget id. - */ - public static function trigger_widget_control( $widget_control_id = false ) { - global $w3tc_dashboard_control_callbacks; - - if ( is_scalar( $widget_control_id ) && $widget_control_id && - isset( $w3tc_dashboard_control_callbacks[ $widget_control_id ] ) && - is_callable( $w3tc_dashboard_control_callbacks[ $widget_control_id ] ) ) { - call_user_func( - $w3tc_dashboard_control_callbacks[ $widget_control_id ], - '', - array( - 'id' => $widget_control_id, - 'callback' => $w3tc_dashboard_control_callbacks[ $widget_control_id ], - ) - ); - } - } -} - -/** - * Class: Util_Widget_Postponed - */ -class _Util_Widget_Postponed { // phpcs:ignore - /** - * Data. - * - * @var array - * @access private - */ - private $data = array(); - - /** - * Constructor. - * - * @param array $data Data. - */ - public function __construct( $data ) { - $this->data = $data; - } - - /** - * Dashboard setup. - */ - public function wp_dashboard_setup() { - Util_Widget::add( - $this->data['widget_id'], - $this->data['widget_name'], - $this->data['callback'], - $this->data['control_callback'], - $this->data['location'], - $this->data['header_text'], - $this->data['header_class'] - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php deleted file mode 100644 index c71e0c79..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php +++ /dev/null @@ -1,356 +0,0 @@ -errors ) && - $wp_filesystem->errors->has_errors() ) { - $status['error'] = esc_html( $wp_filesystem->errors->get_error_message() ); - } - - wp_send_json_error( $status ); - } - } - - /** - * Tries to write file content - * - * @param string $filename path to file - * @param string $content data to write - * @param string $method Which method to use when creating - * @param string $url Where to redirect after creation - * @param bool|string $context folder in which to write file - * @throws Util_WpFile_FilesystemWriteException - * @return void - */ - static public function write_to_file( $filename, $content ) { - if ( @file_put_contents( $filename, $content ) ) - return; - - try { - self::request_filesystem_credentials(); - } catch ( Util_WpFile_FilesystemOperationException $ex ) { - throw new Util_WpFile_FilesystemWriteException( $ex->getMessage(), - $ex->credentials_form(), $filename, $content ); - } - - global $wp_filesystem; - if ( !$wp_filesystem->put_contents( $filename, $content ) ) { - throw new Util_WpFile_FilesystemWriteException( - 'FTP credentials don\'t allow to write to file ' . - $filename . '', self::get_filesystem_credentials_form(), - $filename, $content ); - } - } - - /** - * Copy file using WordPress filesystem functions. - * - * @param unknown $source_filename - * @param unknown $destination_filename - * @param string $method Which method to use when creating - * @param string $url Where to redirect after creation - * @param bool|string $context folder to copy files too - * @throws Util_WpFile_FilesystemCopyException - */ - static public function copy_file( $source_filename, $destination_filename ) { - $contents = @file_get_contents( $source_filename ); - if ( $contents ) { - @file_put_contents( $destination_filename, $contents ); - } - if ( @file_exists( $destination_filename ) ) { - if ( @file_get_contents( $destination_filename ) == $contents ) - return; - } - - try { - self::request_filesystem_credentials(); - } catch ( Util_WpFile_FilesystemOperationException $ex ) { - throw new Util_WpFile_FilesystemCopyException( $ex->getMessage(), - $ex->credentials_form(), - $source_filename, $destination_filename ); - } - - global $wp_filesystem; - if ( !$wp_filesystem->put_contents( $destination_filename, $contents, - FS_CHMOD_FILE ) ) { - throw new Util_WpFile_FilesystemCopyException( - 'FTP credentials don\'t allow to copy to file ' . - $destination_filename . '', - self::get_filesystem_credentials_form(), - $source_filename, $destination_filename ); - } - } - - /** - * - * - * @param unknown $folder - * @param string $method Which method to use when creating - * @param string $url Where to redirect after creation - * @param bool|string $context folder to create folder in - * @throws Util_WpFile_FilesystemMkdirException - */ - static private function create_folder( $folder, $from_folder ) { - if ( @is_dir( $folder ) ) - return; - - if ( Util_File::mkdir_from_safe( $folder, $from_folder ) ) - return; - - try { - self::request_filesystem_credentials(); - } catch ( Util_WpFile_FilesystemOperationException $ex ) { - throw new Util_WpFile_FilesystemMkdirException( $ex->getMessage(), - $ex->credentials_form(), $folder ); - } - - global $wp_filesystem; - if ( !$wp_filesystem->mkdir( $folder, FS_CHMOD_DIR ) ) { - throw new Util_WpFile_FilesystemMkdirException( - 'FTP credentials don\'t allow to create folder ' . - $folder . '', - self::get_filesystem_credentials_form(), - $folder ); - } - } - - /** - * - * - * @param unknown $folder - * @param string $method Which method to use when creating - * @param string $url Where to redirect after creation - * @param bool|string $context folder to create folder in - * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials - * @throws FileOperationException - */ - static public function create_writeable_folder( $folder, $from_folder ) { - self::create_folder( $folder, $from_folder ); - - $permissions = array( 0755, 0775, 0777 ); - - for ( $set_index = 0; $set_index < count( $permissions ); $set_index++ ) { - if ( is_writable( $folder ) ) - break; - - self::chmod( $folder, $permissions[$set_index] ); - } - } - - /** - * - * - * @param unknown $folder - * @param string $method Which method to use when creating - * @param string $url Where to redirect after creation - * @param bool|string $context path folder where delete folders resides - * @throws Util_WpFile_FilesystemRmdirException - */ - static public function delete_folder( $folder ) { - if ( !@is_dir( $folder ) ) - return; - - Util_File::rmdir( $folder ); - if ( !@is_dir( $folder ) ) - return; - - try { - self::request_filesystem_credentials(); - } catch ( Util_WpFile_FilesystemOperationException $ex ) { - throw new Util_WpFile_FilesystemRmdirException( $ex->getMessage(), - $ex->credentials_form(), $folder ); - } - - global $wp_filesystem; - if ( !$wp_filesystem->rmdir( $folder ) ) { - throw new Util_WpFile_FilesystemRmdirException( - __( 'FTP credentials don\'t allow to delete folder ', 'w3-total-cache' ) . - '' . $folder . '', - self::get_filesystem_credentials_form(), - $folder ); - } - } - - /** - * - * - * @param string $filename - * @param int $permission - * @return void - * @throws Util_WpFile_FilesystemChmodException - */ - static private function chmod( $filename, $permission ) { - if ( @chmod( $filename, $permission ) ) - return; - - - try { - self::request_filesystem_credentials(); - } catch ( Util_WpFile_FilesystemOperationException $ex ) { - throw new Util_WpFile_FilesystemChmodException( $ex->getMessage(), - $ex->credentials_form(), $filename, $permission ); - } - - global $wp_filesystem; - if ( !$wp_filesystem->chmod( $filename, $permission, true ) ) { - throw new Util_WpFile_FilesystemChmodException( - __( 'FTP credentials don\'t allow to chmod ', 'w3-total-cache' ) . - '' . $filename . '', - self::get_filesystem_credentials_form(), - $filename, $permission ); - } - - return true; - } - - /** - * - * - * @param unknown $file - * @param string $method - * @param string $url - * @param bool|string $context folder where file to be deleted resides - * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials - */ - static public function delete_file( $filename ) { - if ( !@file_exists( $filename ) ) - return; - if ( @unlink( $filename ) ) - return; - - try { - self::request_filesystem_credentials(); - } catch ( Util_WpFile_FilesystemOperationException $ex ) { - throw new Util_WpFile_FilesystemRmException( $ex->getMessage(), - $ex->credentials_form(), $filename ); - } - - global $wp_filesystem; - if ( !$wp_filesystem->delete( $filename ) ) { - throw new Util_WpFile_FilesystemRmException( - __( 'FTP credentials don\'t allow to delete ', 'w3-total-cache' ) . - '' . $filename . '', - self::get_filesystem_credentials_form(), - $filename ); - } - } - - /** - * Get WordPress filesystems credentials. Required for WP filesystem usage. - * - * @param string $method Which method to use when creating - * @param string $url Where to redirect after creation - * @param bool|string $context path to folder that should be have filesystem credentials. - * If false WP_CONTENT_DIR is assumed - * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials - */ - private static function request_filesystem_credentials( $method = '', $url = '', $context = false ) { - if ( strlen( $url ) <= 0 ) { - $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; - } - - $url = preg_replace( '/&w3tc_note=([^&]+)/', '', $url ); - - // Ensure request_filesystem_credentials() is available. - require_once ABSPATH . 'wp-admin/includes/file.php'; - require_once ABSPATH . 'wp-admin/includes/template.php'; - - $success = true; - ob_start(); - if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, $context, array() ) ) ) { - $success = false; - } - $form = ob_get_contents(); - ob_end_clean(); - - ob_start(); - // If first check failed try again and show error message - if ( !WP_Filesystem( $creds ) && $success ) { - request_filesystem_credentials( $url, $method, true, false, array() ); - $success = false; - $form = ob_get_contents(); - } - ob_end_clean(); - - $error = ''; - if ( preg_match( "/(.+)<\/div>/", $form, $matches ) ) { - $error = $matches[2]; - $form = str_replace( $matches[0], '', $form ); - } - - if ( !$success ) { - throw new Util_WpFile_FilesystemOperationException( $error, $form ); - } - } - - /** - * - * - * @param string $method - * @param string $url - * @param bool|string $context - * @return Util_WpFile_FilesystemOperationException with S/FTP form - */ - static private function get_filesystem_credentials_form( $method = '', $url = '', - $context = false ) { - // Ensure request_filesystem_credentials() is available. - require_once ABSPATH . 'wp-admin/includes/file.php'; - require_once ABSPATH . 'wp-admin/includes/template.php'; - - ob_start(); - // If first check failed try again and show error message - request_filesystem_credentials( $url, $method, true, false, array() ); - $success = false; - $form = ob_get_contents(); - - ob_end_clean(); - - $error = ''; - if ( preg_match( "/(.+)<\/div>/", $form, $matches ) ) { - $form = str_replace( $matches[0], '', $form ); - } - - $form = str_replace( 'filename = $filename; - $this->permission = $permission; - } - - public function filename() { - return $this->filename; - } - - public function permission() { - return $this->permission; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php deleted file mode 100644 index 3ebd9816..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php +++ /dev/null @@ -1,23 +0,0 @@ -source_filename = $source_filename; - $this->destination_filename = $destination_filename; - } - - public function source_filename() { - return $this->source_filename; - } - - public function destination_filename() { - return $this->destination_filename; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php deleted file mode 100644 index 4b33cd3b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php +++ /dev/null @@ -1,16 +0,0 @@ -folder = $folder; - } - - public function folder() { - return $this->folder; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php deleted file mode 100644 index 154eb4ed..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php +++ /dev/null @@ -1,29 +0,0 @@ -modification_description = $modification_description; - $this->filename = $filename; - $this->file_contents = $file_contents; - } - - function modification_description() { - return $this->modification_description; - } - - public function filename() { - return $this->filename; - } - - public function file_contents() { - return $this->file_contents; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php deleted file mode 100644 index ccd495eb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php +++ /dev/null @@ -1,19 +0,0 @@ -credentials_form = $credentials_form; - } - - public function credentials_form() { - return $this->credentials_form; - - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php deleted file mode 100644 index c98cb124..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php +++ /dev/null @@ -1,16 +0,0 @@ -filename = $filename; - } - - public function filename() { - return $this->filename; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php deleted file mode 100644 index 764228fd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php +++ /dev/null @@ -1,16 +0,0 @@ -folder = $folder; - } - - public function folder() { - return $this->folder; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php deleted file mode 100644 index c89337aa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php +++ /dev/null @@ -1,23 +0,0 @@ -filename = $filename; - $this->file_contents = $file_contents; - } - - public function filename() { - return $this->filename; - } - - public function file_contents() { - return $this->file_contents; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php deleted file mode 100644 index 48c370b5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php +++ /dev/null @@ -1,157 +0,0 @@ -blog mapfile - */ - static public function register_new_item( $config ) { - if ( !isset( $GLOBALS['current_blog'] ) ) { - return false; - } - - - // find blog_home_url - if ( Util_Environment::is_wpmu_subdomain() ) { - $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item']; - } else { - $home_url = rtrim( get_home_url(), '/' ); - if ( substr( $home_url, 0, 7 ) == 'http://' ) { - $home_url = substr( $home_url, 7 ); - } else if ( substr( $home_url, 0, 8 ) == 'https://' ) { - $home_url = substr( $home_url, 8 ); - } - - if ( substr( $GLOBALS['w3tc_blogmap_register_new_item'], 0, - strlen( $home_url ) ) == $home_url ) { - $blog_home_url = $home_url; - } else { - $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item']; - } - } - - - // write contents - $filename = Util_WpmuBlogmap::blogmap_filename_by_home_url( $blog_home_url ); - - if ( !@file_exists( $filename ) ) { - $blog_ids = array(); - } else { - $data = @file_get_contents( $filename ); - $blog_ids = @json_decode( $data, true ); - if ( !is_array( $blog_ids ) ) { - $blog_ids = array(); - } - } - - if ( isset( $blog_ids[$blog_home_url] ) ) { - return false; - } - - $data = $config->get_boolean( 'common.force_master' ) ? 'm' : 'c'; - $blog_home_url = preg_replace( '/[^a-zA-Z0-9\+\.%~!:()\/\-\_]/', '', $blog_home_url ); - $blog_ids[$blog_home_url] = $data . $GLOBALS['current_blog']->blog_id; - - $data = json_encode( $blog_ids ); - - try { - Util_File::file_put_contents_atomic( $filename, $data ); - } catch ( \Exception $ex ) { - return false; - } - - unset( self::$content_by_filename[$filename] ); - unset( $GLOBALS['w3tc_blogmap_register_new_item'] ); - - return true; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php deleted file mode 100644 index 6660d759..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php +++ /dev/null @@ -1,430 +0,0 @@ -_config = Dispatcher::config(); - - $this->_debug = $this->_config->get_boolean( 'varnish.debug' ); - $this->_servers = $this->_config->get_array( 'varnish.servers' ); - $this->_timeout = $this->_config->get_integer( 'timelimit.varnish_purge' ); - } - - /** - * Purge URI - * - * @param string $url - * @return boolean - */ - protected function _purge( $url ) { - @set_time_limit( $this->_timeout ); - $return = true; - - foreach ( (array) $this->_servers as $server ) { - $response = $this->_request( $server, $url ); - - if ( is_wp_error( $response ) ) { - $this->_log( $url, sprintf( 'Unable to send request: %s.', implode( '; ', $response->get_error_messages() ) ) ); - $return = false; - } elseif ( $response['response']['code'] !== 200 ) { - $this->_log( $url, 'Bad response: ' . $response['response']['status'] ); - $return = false; - } else { - $this->_log( $url, 'PURGE OK' ); - } - } - - return $return; - } - - /* - * Sends purge request. Cannt use default wp HTTP implementation - * if we send request to different host than specified in $url - * - * @param $url string - */ - function _request( $varnish_server, $url ) { - $parse_url = @parse_url( $url ); - - if ( !$parse_url || !isset( $parse_url['host'] ) ) - return new \WP_Error( 'http_request_failed', 'Unrecognized URL format ' . $url ); - - $host = $parse_url['host']; - $port = ( isset( $parse_url['port'] ) ? (int) $parse_url['port'] : 80 ); - $path = ( !empty( $parse_url['path'] ) ? $parse_url['path'] : '/' ); - $query = ( isset( $parse_url['query'] ) ? $parse_url['query'] : '' ); - $request_uri = $path . ( $query != '' ? '?' . $query : '' ); - - list( $varnish_host, $varnish_port ) = - Util_Content::endpoint_to_host_port( $varnish_server, 80 ); - - // if url host is the same as varnish server - we can use regular - // wordpress http infrastructure, otherwise custom request should be - // sent using fsockopen, since we send request to other server than - // specified by $url - if ( $host == $varnish_host && $port == $varnish_port ) - return Util_Http::request( $url, array( 'method' => 'PURGE' ) ); - - $request_headers_array = array( - sprintf( 'PURGE %s HTTP/1.1', $request_uri ), - sprintf( 'Host: %s', $host ), - sprintf( 'User-Agent: %s', W3TC_POWERED_BY ), - 'Connection: close' - ); - - $request_headers = implode( "\r\n", $request_headers_array ); - $request = $request_headers . "\r\n\r\n"; - - // log what we are about to do - $this->_log( $url, sprintf( 'Connecting to %s ...', $varnish_host ) ); - $this->_log( $url, sprintf( 'PURGE %s HTTP/1.1', $request_uri ) ); - $this->_log( $url, sprintf( 'Host: %s', $host ) ); - - $errno = null; - $errstr = null; - $fp = @fsockopen( $varnish_host, $varnish_port, $errno, $errstr, 10 ); - if ( !$fp ) - return new \WP_Error( 'http_request_failed', $errno . ': ' . $errstr ); - - @stream_set_timeout( $fp, 60 ); - - @fputs( $fp, $request ); - - $response = ''; - while ( !@feof( $fp ) ) - $response .= @fgets( $fp, 4096 ); - - @fclose( $fp ); - - list( $response_headers, $contents ) = explode( "\r\n\r\n", $response, 2 ); - $matches = null; - if ( preg_match( '~^HTTP/1.[01] (\d+)~', $response_headers, $matches ) ) { - $code = (int)$matches[1]; - $a = explode( "\n", $response_headers ); - $status = ( count( $a ) >= 1 ? $a[0] : '' ); - $return = array( - 'response' => array( - 'code' => $code, - 'status' => $status - ) - ); - return $return; - } - - return new \WP_Error( 'http_request_failed', - 'Unrecognized response header' . $response_headers ); - } - - /** - * Write log entry - * - * @param string $url - * @param string $msg - * @return bool|int - */ - function _log( $url, $msg ) { - if ( $this->_debug ) { - $data = sprintf( "[%s] [%s] %s\n", date( 'r' ), $url, $msg ); - $data = strtr( $data, '<>', '' ); - - $filename = Util_Debug::log_filename( 'varnish' ); - - return @file_put_contents( $filename, $data, FILE_APPEND ); - } - - return true; - } - - - - /** - * Flush varnish cache - */ - function flush() { - $this->flush_operation_requested = true; - return true; - } - - private function do_flush() { - if ( !is_network_admin() ) { - $full_urls = array( get_home_url() . '/.*' ); - $full_urls = Util_PageUrls::complement_with_mirror_urls( - $full_urls ); - - foreach ( $full_urls as $url ) - $this->_purge( $url ); - } else { - // todo: remove. doesnt work for all caches. - // replace with tool to flush network - global $wpdb; - $protocall = Util_Environment::is_https() ? 'https://' : 'http://'; - - // If WPMU Domain Mapping plugin is installed and active - if ( defined( 'SUNRISE_LOADED' ) && SUNRISE_LOADED && isset( $wpdb->dmtable ) && !empty( $wpdb->dmtable ) ) { - $blogs = $wpdb->get_results( " - SELECT {$wpdb->blogs}.domain, {$wpdb->blogs}.path, {$wpdb->dmtable}.domain AS mapped_domain - FROM {$wpdb->dmtable} - RIGHT JOIN {$wpdb->blogs} ON {$wpdb->dmtable}.blog_id = {$wpdb->blogs}.blog_id - WHERE site_id = {$wpdb->siteid} - AND spam = 0 - AND deleted = 0 - AND archived = '0'" ); - foreach ( $blogs as $blog ) { - if ( !isset( $blog->mapped_domain ) ) - $url = $protocall . $blog->domain . ( strlen( $blog->path )>1? '/' . trim( $blog->path, '/' ) : '' ) . '/.*'; - else - $url = $protocall . $blog->mapped_domain . '/.*'; - $this->_purge( $url ); - } - - }else { - if ( !Util_Environment::is_wpmu_subdomain() ) { - $this->_purge( get_home_url().'/.*' ); - } else { - $blogs = $wpdb->get_results( " - SELECT domain, path - FROM {$wpdb->blogs} - WHERE site_id = '{$wpdb->siteid}' - AND spam = 0 - AND deleted = 0 - AND archived = '0'" ); - - foreach ( $blogs as $blog ) { - $url = $protocall . $blog->domain . ( strlen( $blog->path )>1? '/' . trim( $blog->path, '/' ) : '' ) . '/.*'; - $this->_purge( $url ); - } - } - } - } - } - - /** - * Flushes varnish post cache - * - * @param integer $post_id Post ID. - * @param boolean $force Force flag (optional). - * - * @return boolean - */ - function flush_post( $post_id, $force ) { - if ( !$post_id ) { - $post_id = Util_Environment::detect_post_id(); - } - - if ( $post_id ) { - $full_urls = array(); - - $post = null; - $terms = array(); - - $feeds = $this->_config->get_array( 'pgcache.purge.feed.types' ); - $limit_post_pages = $this->_config->get_integer( 'pgcache.purge.postpages_limit' ); - - if ( $this->_config->get_boolean( 'pgcache.purge.terms' ) || $this->_config->get_boolean( 'varnish.pgcache.feed.terms' ) ) { - $taxonomies = get_post_taxonomies( $post_id ); - $terms = wp_get_post_terms( $post_id, $taxonomies ); - } - - switch ( true ) { - case $this->_config->get_boolean( 'pgcache.purge.author' ): - case $this->_config->get_boolean( 'pgcache.purge.archive.daily' ): - case $this->_config->get_boolean( 'pgcache.purge.archive.monthly' ): - case $this->_config->get_boolean( 'pgcache.purge.archive.yearly' ): - case $this->_config->get_boolean( 'pgcache.purge.feed.author' ): - $post = get_post( $post_id ); - } - - $front_page = get_option( 'show_on_front' ); - - /** - * Home (Frontpage) URL - */ - if ( ( $this->_config->get_boolean( 'pgcache.purge.home' ) && $front_page == 'posts' )|| - $this->_config->get_boolean( 'pgcache.purge.front_page' ) ) { - $full_urls = array_merge( $full_urls, - Util_PageUrls::get_frontpage_urls( $limit_post_pages ) ); - } - - /** - * Home (Post page) URL - */ - if ( $this->_config->get_boolean( 'pgcache.purge.home' ) && $front_page != 'posts' ) { - $full_urls = array_merge( $full_urls, - Util_PageUrls::get_postpage_urls( $limit_post_pages ) ); - } - - /** - * Post URL - */ - if ( $this->_config->get_boolean( 'pgcache.purge.post' ) || $force ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_urls( $post_id ) ); - } - - /** - * Post comments URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.comments' ) && function_exists( 'get_comments_pagenum_link' ) ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_comments_urls( $post_id ) ); - } - - /** - * Post author URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.author' ) && $post ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_author_urls( $post->post_author, $limit_post_pages ) ); - } - - /** - * Post terms URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.terms' ) ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_terms_urls( $terms, $limit_post_pages ) ); - } - - /** - * Daily archive URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.archive.daily' ) && $post ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_daily_archive_urls( $post, $limit_post_pages ) ); - } - - /** - * Monthly archive URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.archive.monthly' ) && $post ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_monthly_archive_urls( $post, $limit_post_pages ) ); - } - - /** - * Yearly archive URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.archive.yearly' ) && $post ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_yearly_archive_urls( $post, $limit_post_pages ) ); - } - - /** - * Feed URLs - */ - if ( $this->_config->get_boolean( 'pgcache.purge.feed.blog' ) ) { - $full_urls = array_merge( $full_urls, - Util_PageUrls::get_feed_urls( $feeds ) ); - } - - if ( $this->_config->get_boolean( 'pgcache.purge.feed.comments' ) ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_comments_urls( $post_id, $feeds ) ); - } - - if ( $this->_config->get_boolean( 'pgcache.purge.feed.author' ) && $post ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_author_urls( $post->post_author, $feeds ) ); - } - - if ( $this->_config->get_boolean( 'pgcache.purge.feed.terms' ) ) { - $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_terms_urls( $terms, $feeds ) ); - } - - /** - * Purge selected pages - */ - if ( $this->_config->get_array( 'pgcache.purge.pages' ) ) { - $pages = $this->_config->get_array( 'pgcache.purge.pages' ); - $full_urls = array_merge( $full_urls, Util_PageUrls::get_pages_urls( $pages ) ); - } - - if ( $this->_config->get_string( 'pgcache.purge.sitemap_regex' ) ) { - $sitemap_regex = $this->_config->get_string( 'pgcache.purge.sitemap_regex' ); - $full_urls[] = Util_Environment::home_domain_root_url() . '/' . trim( $sitemap_regex, "^$" ); - } - - // add mirror urls - $full_urls = Util_PageUrls::complement_with_mirror_urls( - $full_urls ); - - $full_urls = apply_filters( 'varnish_flush_post_queued_urls', - $full_urls ); - - /** - * Queue flush - */ - if ( count( $full_urls ) ) { - foreach ( $full_urls as $url ) - $this->queued_urls[$url] = '*'; - } - - return true; - } - - return false; - } - - /** - * Flush a single url - * - * @param unknown $url - */ - function flush_url( $url ) { - $this->_purge( $url ); - } - - /** - * Flushes global and repeated urls - */ - function flush_post_cleanup() { - if ( $this->flush_operation_requested ) { - $this->do_flush(); - $count = 999; - - $this->flush_operation_requested = false; - $this->queued_urls = array(); - } else { - $count = count( $this->queued_urls ); - if ( $count > 0 ) { - foreach ( $this->queued_urls as $url => $nothing ) - $this->flush_url( $url ); - - $this->queued_urls = array(); - } - } - - return $count; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php deleted file mode 100644 index cea5e159..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php +++ /dev/null @@ -1,89 +0,0 @@ -flush(); - - return $v; - } - - /** - * Purges post from varnish - * - * @param integer $post_id Post ID. - * @param boolean $force Force flag (optional). - * - * @return mixed - */ - public function varnish_flush_post( $post_id, $force = false ) { - $varnishflush = Dispatcher::component( 'Varnish_Flush' ); - $v = $varnishflush->flush_post( $post_id, $force ); - - return $v; - } - - /** - * Purges post from varnish - * - * @param string $url - * @return mixed - */ - public function varnish_flush_url( $url ) { - $varnishflush = Dispatcher::component( 'Varnish_Flush' ); - $v = $varnishflush->flush_url( $url ); - - return $v; - } - - public function w3tc_admin_bar_menu( $menu_items ) { - $menu_items['20610.varnish'] = array( - 'id' => 'w3tc_flush_varnish', - 'parent' => 'w3tc_flush', - 'title' => __( 'Varnish Cache', 'w3-total-cache' ), - 'href' => wp_nonce_url( admin_url( - 'admin.php?page=w3tc_dashboard&w3tc_flush_varnish' ), - 'w3tc' ) - ); - - return $menu_items; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php deleted file mode 100644 index 3b0b4c31..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php +++ /dev/null @@ -1,51 +0,0 @@ -config = w3tc_config(); - - // get value of config option and use it - if ( $this->config->get_boolean( array( 'example' , 'is_title_postfix' ) ) ) - add_filter( 'the_title', array( $this, 'the_title' ), 10, 2 ); - } - - - - /** - * the_title filter handler. - * This extension adds specified postfix to each post title if extensions - * is configured so on its settings page - */ - public function the_title( $title, $id ) { - return $title . - $this->config->get_string( array( 'example' , 'title_postfix' ) ); - } -} - - - -/* -This file is simply loaded by W3 Total Cache in a case if extension is active. -Its up to extension what will it do or which way will it do. -*/ -$p = new Extension_Example(); -$p->run(); - -if ( is_admin() ) { - $p = new Extension_Example_Admin(); - $p->run(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php deleted file mode 100644 index 562ddcbf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php +++ /dev/null @@ -1,120 +0,0 @@ - 'Example Extension', - 'author' => 'W3 EDGE', - 'description' => __( 'Example extension' ), - 'author_uri' => 'https://www.w3-edge.com/', - 'extension_uri' => 'https://www.w3-edge.com/', - 'extension_id' => 'example', - 'settings_exists' => true, - 'version' => '1.0', - 'enabled' => true, - 'requirements' => '', - 'path' => 'w3-total-cache-example/Extension_Example.php' - ); - - return $extensions; - } - - - - /** - * Entry point of extension for wp-admin/ requests - * Called from Extension_Example.php - */ - public function run() { - // handle settings page of this extension - add_action( 'w3tc_extension_page_example', array( - $this, - 'w3tc_extension_page' - ) ); - - // get control when configuration is changed by user - add_action( 'w3tc_config_ui_save', array( - $this, - 'w3tc_config_ui_save' - ), 10, 2 ); - - // Register widget on W3 Total Cache Dashboard page - add_action( 'w3tc_widget_setup', array( - $this, - 'w3tc_widget_setup' - ) ); - - // get control when extension is deactivated - add_action( 'w3tc_deactivate_extension_example', array( - $this, 'w3tc_deactivate_extension' ) ); - - } - - - - /** - * Show settings page - */ - public function w3tc_extension_page() { - include dirname( __FILE__ ) . '/Extension_Example_Page_View.php'; - } - - - - /** - * Get control when configuration is changed by user - */ - public function w3tc_config_ui_save( $config, $old_config ) { - if ( $config->get( array( 'example', 'is_title_postfix' ) ) != - $old_config->get( array( 'example', 'is_title_postfix' ) ) || - $config->get( array( 'example', 'title_postfix' ) ) != - $old_config->get( array( 'example', 'title_postfix' ) ) ) { - // flush all content caches, since our extension will now alter - // content - w3tc_flush_posts(); - } - } - - - - /** - * Registers widget on W3 Total Cache Dashboard page - */ - public function w3tc_widget_setup() { - $screen = get_current_screen(); - add_meta_box( 'example', 'example', array( $this, 'widget_content' ), - $screen, 'normal', 'core' ); - } - - - - /** - * Renders content of widget - */ - public function widget_content() { - echo "Example extension's widget"; - } - - - - /** - * Called when extension is deactivated. - * Perform a cleanup here - */ - public function w3tc_deactivate_extension() { - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php deleted file mode 100644 index cd8059a9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php +++ /dev/null @@ -1,46 +0,0 @@ - -

- | - -

-

- -
- - - array( 'example', 'is_title_postfix' ), - 'control' => 'checkbox', - 'label' => __( 'Add postfix to page titles', 'w3-total-cache' ), - 'checkbox_label' => __( 'Enable', 'w3-total-cache' ), - 'description' => __( 'Check if you want to add postfix to each post title.', 'w3-total-cache' ), - ) - ); - \W3TC\Util_Ui::config_item( - array( - 'key' => array( 'example', 'title_postfix' ), - 'control' => 'textbox', - 'label' => __( 'Postfix to page titles', 'w3-total-cache' ), - ) - ); - ?> -
- -
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php deleted file mode 100644 index 4fdc6600..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php +++ /dev/null @@ -1,59 +0,0 @@ - - - W3 Total Cache is distributed under the GNU General Public License, Version 2, - June 1991. Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin - St, Fifth Floor, Boston, MA 02110, USA - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -if ( !defined( 'ABSPATH' ) ) { - die(); -} - -/** - * Class autoloader - * - * @param string $class Classname - */ -function w3tc_example_class_autoload( $class ) { - if ( substr( $class, 0, 12 ) == 'W3TCExample\\' ) { - $filename = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . - substr( $class, 12 ) . '.php'; - - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { - if ( !file_exists( $filename ) ) { - debug_print_backtrace(); - } - } - - require $filename; - } -} - -spl_autoload_register( 'w3tc_example_class_autoload' ); - -add_action( 'w3tc_extensions', array( - '\W3TCExample\Extension_Example_Admin', - 'w3tc_extensions' - ), 10, 2 ); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php deleted file mode 100644 index 24557bcc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php +++ /dev/null @@ -1,25 +0,0 @@ - - - -

Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.

-

Thanks for using W3 Total Cache.

- - diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php deleted file mode 100644 index 5afe70bf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php +++ /dev/null @@ -1,7 +0,0 @@ - - - -

Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.

-

Thanks for using W3 Total Cache.

- - diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php deleted file mode 100644 index a8e8f5e3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php +++ /dev/null @@ -1,50 +0,0 @@ - - - - -

- '; - echo esc_html__( 'Version: ', 'w3-total-cache' ) . esc_html( W3TC_VERSION ) . '
'; - echo esc_html__( 'URL: ', 'w3-total-cache' ) . '' . esc_html( $url ) . '
'; - echo esc_html__( 'Name: ', 'w3-total-cache' ) . esc_html( $name ) . '
'; - echo esc_html__( 'E-Mail: ', 'w3-total-cache' ) . '' . esc_html( $email ) . '
'; - - if ( $twitter ) { - echo esc_html__( 'Twitter: ', 'w3-total-cache' ) . '' . esc_html( $twitter ) . '
'; - } - - if ( $phone ) { - echo esc_html__( 'Phone: ', 'w3-total-cache' ) . esc_html( $phone ) . '
'; - } - - if ( $forum_url ) { - echo esc_html__( 'Forum Topic URL: ', 'w3-total-cache' ) . '' . esc_url( $forum_url ) . '
'; - } - - if ( $request_data_url ) { - echo esc_html__( 'Request data: ', 'w3-total-cache' ) . '' . esc_url( $request_data_url ) . '
'; - } - - echo esc_html__( 'Subject: ', 'w3-total-cache' ) . esc_html( $subject ); - ?> -

- -

- -

- -
- - - '; - echo esc_html__( 'User Agent: ', 'w3-total-cache' ) . esc_html( $_SERVER['HTTP_USER_AGENT'] ); - ?> - - - diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php deleted file mode 100644 index 94d057c5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php +++ /dev/null @@ -1,14 +0,0 @@ - - - > - - - Error - - - -

- -

- - \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/index.html deleted file mode 100644 index e69de29b..00000000 diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/index.html deleted file mode 100644 index e69de29b..00000000 diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php deleted file mode 100644 index d3022825..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php +++ /dev/null @@ -1,160 +0,0 @@ - -

Minify: Help Wizard

- -

- - - -

- -
-

JavaScript:

- -
    - $js_files ) : - foreach ( $js_files as $js_file ) : - $index++; - ?> -
  • - - - - - - - - - - - - - - - - -
     
    - /> - . - - - - - - - - -
    -
  • - - -
-

- -

- -

- - -

- - -
    - $css_files ) : - foreach ( $css_files as $css_file ) : - $index++; - ?> -
  • - - - - - - - - - - - - - - -
     
    - /> - . - - - - - -
    -
  • - - -
-

- -

- -

No files found.

- -
- -
-

- -

- -
- - -
    -
  • -
  • - ', - '' - ), - array( - 'a' => array( - 'href' => array(), - ), - ) - ); - ?> -
  • -
-
-
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php deleted file mode 100644 index 879d54c9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php +++ /dev/null @@ -1,4 +0,0 @@ -
- -
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php deleted file mode 100644 index 01090709..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php +++ /dev/null @@ -1,520 +0,0 @@ - -

- -
- - -

- ', - '', - '
' - ), - array( - 'span' => array( - 'style' => array(), - ), - 'br' => array(), - ) - ); - echo wp_kses( - sprintf( - // translators: 1 opening HTML span with background, 2 closing HTML span tag, 3 HTML line break tag. - __( - '%1$sNot detected/Not available/Off%2$s: May be installed, but cannot be automatically confirmed. Functionality may be limited.%3$s', - 'w3-total-cache' - ), - '', - '', - '
' - ), - array( - 'span' => array( - 'style' => array(), - ), - 'br' => array(), - ) - ); - echo wp_kses( - sprintf( - // translators: 1 opening HTML span with background, 2 closing HTML span tag, 3 HTML line break tag. - __( - '%1$sNot installed/Error/No/False%2$s: Plugin or some functions may not work.%3$s', - 'w3-total-cache' - ), - '', - '', - '
' - ), - array( - 'span' => array( - 'style' => array(), - ), - 'br' => array(), - ) - ); - ?> -

-
- -
-

- -
    -
  • - -
  • - -
  • - - ; -
  • - -
  • - Web Server: - - Apache - - Lite Speed - - nginx - - lighttpd - - Microsoft IIS - - Not detected - -
  • - -
  • - FTP functions: - - Installed - - Not detected - - - ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> - -
  • - -
  • - - - - - - - -
  • - -
  • - - - - - - - -
  • - -
  • - zlib extension: - - - - - - -
  • - -
  • - brotli extension: - - - - - - -
  • - -
  • - Opcode cache: - - - - - - - - - = 6 ) : ?> - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - - - - - -
  • - -
  • - - - - - - - - - - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> - -
  • - -
  • - - - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - SSH2 extension: - - - - - - - ', - '', - '', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> - -
  • - - -
    - -
  • - : - - - - - - - - - - -
  • - - -
- -

-
    - ' . wp_kses( $check, Util_Ui::get_allowed_html_for_wp_kses_from_content( $check ) ) . ''; - endforeach; - ?> -
- - -

- -
    - - -
  • - : - - - - - - - - - - - - - -
  • - - -
  • - : - - - - - -
  • - -
  • - - : - - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - - - - - - -
  • - -
  • - - - - - - -
  • - -
  • - - - () - - - -
  • -
-
- -
- -
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php deleted file mode 100644 index 101f208b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php +++ /dev/null @@ -1,152 +0,0 @@ - -
- -
-
-

Frederick Townes

-

CEO, W3 EDGE

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

- -
    -
  • - -
  • -
  • - -
  • -
-

-
- - -

- get_string( 'license.community_terms' ) !== 'accept' ) : ?> -

- - -

- -
- -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php deleted file mode 100644 index bc465e4b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php +++ /dev/null @@ -1,40 +0,0 @@ - -
- -
- -
-
- W3 TOTAL CACHE
- -
-
- -
- - - - - - - -
- -
- -
- -
- -
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php deleted file mode 100644 index a2bd34e6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php +++ /dev/null @@ -1,630 +0,0 @@ - 'application/vnd.lotus-1-2-3', - '3dml' => 'text/vnd.in3d.3dml', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gpp', - 'aab|x32|u32|vox' => 'application/x-authorware-bin', - 'aac' => 'audio/x-aac', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afp|listafp|list3820' => 'application/vnd.ibm.modcap', - 'aif|aiff|aifc' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ai|eps|ps' => 'application/postscript', - 'ami' => 'application/vnd.amiga.ami', - 'apk' => 'application/vnd.android.package-archive', - 'application' => 'application/x-ms-application', - 'apr' => 'application/vnd.lotus-approach', - 'asc|sig' => 'application/pgp-signature', - 'asf|asx' => 'video/x-ms-asf', - 'aso' => 'application/vnd.accpac.simply.aso', - 'atc|acutc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au|snd' => 'audio/basic', - 'avi' => 'video/x-msvideo', - 'avif' => 'image/avif', - 'avifs' => 'image/avif-sequence', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azw' => 'application/vnd.amazon.ebook', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin|dms|lha|lrf|lzh|so|iso|dmg|dist|distz|pkg|bpk|dump|elc|deploy' => 'application/octet-stream', - 'bmi' => 'application/vnd.bmi', - 'bmp' => 'image/bmp', - 'box' => 'application/vnd.previewsystems.box', - 'btif' => 'image/prs.btif', - 'bz' => 'application/x-bzip', - 'bz2|boz' => 'application/x-bzip2', - 'c4g|c4d|c4f|c4p|c4u' => 'application/vnd.clonk.c4group', - 'cab' => 'application/vnd.ms-cab-compressed', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/java-vm', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'cpio' => 'application/x-cpio', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'csh' => 'application/x-csh', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'c|cc|cxx|cpp|h|hh|dic' => 'text/x-c', - 'daf' => 'application/vnd.mobius.daf', - 'davmount' => 'application/davmount+xml', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'deb|udeb' => 'application/x-debian-package', - 'der|crt' => 'application/x-x509-ca-cert', - 'df' => 'application/x-deflate', - 'dfac' => 'application/vnd.dreamfactory', - 'dir|dcr|dxr|cst|cct|cxt|w3d|fgd|swa' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'djvu|djv' => 'image/vnd.djvu', - 'dna' => 'application/vnd.dna', - 'docm' => 'application/vnd.ms-word.document.macroenabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'doc|dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dsc' => 'text/prs.lines.tag', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dvi' => 'application/x-dvi', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'eml|all' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'epub' => 'application/epub+zip', - 'es3|et3' => 'application/vnd.eszigno3+xml', - 'esf' => 'application/vnd.epson.esf', - 'etx' => 'text/x-setext', - 'exe|dll|com|bat|msi' => 'application/x-msdownload', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f4v' => 'video/x-f4v', - 'fbs' => 'image/vnd.fastbidsheet', - 'fdf' => 'application/vnd.fdf', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fh|fhc|fh4|fh5|fh7' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm|frame|maker|book' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'fpx' => 'image/vnd.fpx', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fzs' => 'application/vnd.fuzzysheet', - 'f|for|f77|f90' => 'text/x-fortran', - 'g3' => 'image/g3fax', - 'gac' => 'application/vnd.groove-account', - 'gdl' => 'model/vnd.gdl', - 'geo' => 'application/vnd.dynageo', - 'gex|gre' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gph' => 'application/vnd.flographit', - 'gqf|gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gz' => 'application/x-gzip', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hbci' => 'application/vnd.hbci', - 'hdf' => 'application/x-hdf', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'htc' => 'text/x-component', - 'htke' => 'application/vnd.kenameaapp', - 'html|htm' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'icc|icm' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'ico' => 'image/x-icon', - 'ics|ifb' => 'text/calendar', - 'ief' => 'image/ief', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'igl' => 'application/vnd.igloader', - 'igs|iges' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'java' => 'text/x-java-source', - 'jisp' => 'application/vnd.jisp', - 'jlt' => 'application/vnd.hp-jlyt', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jpeg|jpg|jpe' => 'image/jpeg', - 'jpgv' => 'video/jpeg', - 'jpm|jpgm' => 'video/jpm', - 'js' => 'application/x-javascript', - 'json' => 'application/json', - 'karbon' => 'application/vnd.kde.karbon', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne|knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr|kpt' => 'application/vnd.kde.kpresenter', - 'ksp' => 'application/vnd.kde.kspread', - 'ktz|ktr' => 'application/vnd.kahootz', - 'kwd|kwt' => 'application/vnd.kde.kword', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'less' => 'text/less', - 'link66' => 'application/vnd.route66.link66+xml', - 'lostxml' => 'application/lost+xml', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'm3u' => 'audio/x-mpegurl', - 'm4v' => 'video/x-m4v', - 'mag' => 'application/vnd.ecowin.chart', - 'mathml' => 'application/mathml+xml', - 'ma|nb|mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'mfm' => 'application/vnd.mfmp', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid|midi|kar|rmi' => 'audio/midi', - 'mif' => 'application/vnd.mif', - 'mj2|mjp2' => 'video/mj2', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mny' => 'application/x-msmoney', - 'movie' => 'video/x-sgi-movie', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4|mp4v|mpg4' => 'video/mp4', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpeg|mpg|mpe|m1v|m2v' => 'video/mpeg', - 'mpga|mp2|mp2a|mp3|m2a|m3a' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp|mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msh|mesh|silo' => 'model/mesh', - 'msl' => 'application/vnd.mobius.msl', - 'msty' => 'application/vnd.muvee.style', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb|m13|m14' => 'application/x-msmediaview', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxml|xhvml|xvml|xvm' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu|m4u' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'ncx' => 'application/x-dtbncx+xml', - 'nc|cdf' => 'application/x-netcdf', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nsf' => 'application/vnd.lotus-notes', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga|ogg|spx' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'org' => 'application/vnd.lotus-organizer', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => array( 'application/x-font-otf', 'application/vnd.ms-opentype' ), - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otm' => 'application/vnd.oasis.opendocument.text-master', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p10' => 'application/pkcs10', - 'p12|pfx' => 'application/x-pkcs12', - 'p7b|spc' => 'application/x-pkcs7-certificates', - 'p7m|p7c' => 'application/pkcs7-all', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb|pqa|oprc' => 'application/vnd.palm', - 'pdf' => 'application/pdf', - 'pfa|pfb|pfm|afm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp-encrypted', - 'pic|pct' => 'image/x-pict', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ppt|pps|pot' => 'application/vnd.ms-powerpoint', - 'prc|mobi' => 'application/x-mobipocket-ebook', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'image/vnd.adobe.photoshop', - 'psf' => 'application/x-font-linux-psf', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'p|pas' => 'text/x-pascal', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt|mov' => 'video/quicktime', - 'qxd|qxt|qwd|qwt|qxl|qxb' => 'application/vnd.quark.quarkxpress', - 'ram|ra' => 'audio/x-pn-realaudio', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'application/vnd.rn-realmedia', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rnc' => 'application/relax-ng-compact-syntax', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsd' => 'application/rsd+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'rtx' => 'text/richtext', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkm|sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'see' => 'application/vnd.seemail', - 'seed|dataless' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgml|sgm' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shf' => 'application/shf+xml', - 'sis|sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'skp|skd|skt|skm' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slt' => 'application/vnd.epson.salt', - 'smf' => 'application/vnd.stardivision.math', - 'smi|smil' => 'application/smil+xml', - 'snf' => 'application/x-font-snf', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'src' => 'application/x-wais-source', - 'srx' => 'application/sparql-results+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'application/vnd.ms-pki.stl', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sus|susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svd' => 'application/vnd.svd', - 'svg|svgz' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.arastra.swi', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 's|asm' => 'text/x-asm', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'teacher' => 'application/vnd.smart.teacher', - 'tex' => 'application/x-tex', - 'texinfo|texi' => 'application/x-texinfo', - 'tfm' => 'application/x-tex-tfm', - 'tiff|tif' => 'image/tiff', - 'tmo' => 'application/vnd.tmobile-livetv', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tra' => 'application/vnd.trueapp', - 'trm' => 'application/x-msterminal', - 'tsv' => 'text/tab-separated-values', - 'ttf|ttc' => array( 'application/x-font-ttf', 'application/vnd.ms-opentype' ), - 'twd|twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt|text|conf|def|list|log|in' => 'text/plain', - 't|tr|roff|man|me|ms' => 'text/troff', - 'ufd|ufdl' => 'application/vnd.ufdl', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri|uris|urls' => 'text/uri-list', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vor' => 'application/vnd.stardivision.writer', - 'vsd|vst|vss|vsw' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'wad' => 'application/x-doom', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/vnd.wap.wbxml', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'application/x-msmetafile', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-ms-wmz', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps|wks|wcm|wdb' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl|vrml' => 'model/vrml', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x3d' => 'application/vnd.hzn-3d-crossword', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xhtml|xht' => 'application/xhtml+xml', - 'xif' => 'image/vnd.xiff', - 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xls|xlm|xla|xlc|xlt|xlw' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xml|xsl' => 'application/xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw|xpx' => 'application/vnd.intercon.formnet', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir|zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml' -); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php deleted file mode 100644 index 5a3bb414..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php +++ /dev/null @@ -1,15 +0,0 @@ - 'text/css', - 'htc' => 'text/x-component', - 'less' => 'text/css', - //JS - varieties - 'js' => 'application/x-javascript', - 'js2' => 'application/javascript', - 'js3' => 'text/javascript', - 'js4' => 'text/x-js', -); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php deleted file mode 100644 index 191d59c5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php +++ /dev/null @@ -1,13 +0,0 @@ - 'text/html', - 'rtf|rtx' => 'text/richtext', - 'txt' => 'text/plain', - 'xsd' => 'text/xsd', - 'xsl' => 'text/xsl', - 'xml' => 'text/xml' -); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/index.html deleted file mode 100644 index e69de29b..00000000 diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php deleted file mode 100644 index f254c337..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php +++ /dev/null @@ -1,59 +0,0 @@ - 'video/asf', - 'avi' => 'video/avi', - 'avif' => 'image/avif', - 'avifs' => 'image/avif-sequence', - 'bmp' => 'image/bmp', - 'class' => 'application/java', - 'divx' => 'video/divx', - 'doc|docx' => 'application/msword', - 'eot' => 'application/vnd.ms-fontobject', - 'exe' => 'application/x-msdownload', - 'gif' => 'image/gif', - 'gz|gzip' => 'application/x-gzip', - 'ico' => 'image/x-icon', - 'jpg|jpeg|jpe' => 'image/jpeg', - 'webp' => 'image/webp', - 'json' => 'application/json', - 'mdb' => 'application/vnd.ms-access', - 'mid|midi' => 'audio/midi', - 'mov|qt' => 'video/quicktime', - 'mp3|m4a' => 'audio/mpeg', - 'mp4|m4v' => 'video/mp4', - 'mpeg|mpg|mpe' => 'video/mpeg', - 'webm' => 'video/webm', - 'mpp' => 'application/vnd.ms-project', - 'otf' => 'application/x-font-otf', - '_otf' => 'application/vnd.ms-opentype', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'pdf' => 'application/pdf', - 'png' => 'image/png', - 'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint', - 'ra|ram' => 'audio/x-realaudio', - 'svg|svgz' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif|tiff' => 'image/tiff', - 'ttf|ttc' => 'application/x-font-ttf', - '_ttf' => 'application/vnd.ms-opentype', - 'wav' => 'audio/wav', - 'wma' => 'audio/wma', - 'wri' => 'application/vnd.ms-write', - 'woff' => 'application/font-woff', - 'woff2' => 'application/font-woff2', - 'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel', - 'zip' => 'application/zip' -); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php deleted file mode 100644 index 1e1a6ac7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php +++ /dev/null @@ -1,261 +0,0 @@ - - - -
-

- memcached', - '', - '' - ), - array( - 'a' => array( - 'href' => array(), - 'target' => array(), - ), - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
    -
  • -
  • -
  • -
  • - ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
  • - ', - '', - '', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
  • -
  • - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
  • - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ) - ?> -
  • -
  • - ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
  • -
  • -
  • -
  • - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
  • -
  • - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
  • - ', - '' - ), - array( - 'a' => array( - 'href' => array(), - ), - ) - ); - ?> -
  • -
  • -
  • - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
- -

- -

- -

- - - -

-
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php deleted file mode 100644 index 7fb6e988..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php +++ /dev/null @@ -1,725 +0,0 @@ - 'Default', - 'on' => 'Enable', - 'off' => 'Disable', -); - -?> - - -
-

- ' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . '' - ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ); - ?> -

-

- array( - 'type' => array(), - 'name' => array(), - 'value' => array(), - ), - ) - ); - ?> - - ' - ), - array( - 'input' => array( - 'type' => array(), - 'name' => array(), - 'value' => array(), - 'disabled' => array(), - 'class' => array(), - ), - ) - ); - ?> -

-
-
- -
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 'browsercache.rewrite', - 'disabled' => Util_Ui::sealing_disabled( 'browsercache.' ), - 'control' => 'checkbox', - 'checkbox_label' => wp_kses( - sprintf( - // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag. - __( - 'Rewrite %1$sURL%2$s structure of objects', - 'w3-total-cache' - ), - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ), - 'description' => wp_kses( - sprintf( - // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag. - __( - 'Generate unique %1$sURI%2$s for each file protected from caching by browser.', - 'w3-total-cache' - ), - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ), - 'label_class' => 'w3tc_single_column', - ) - ); - ?> -
- -

-
- -

-
- -

-
- -

-
- -

-
- -

-
- -

-
- -

-
- -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- -

-
- checkbox( 'browsercache.no404wp', ! Util_Rule::can_check_rules() ); ?> -

-

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- - - - ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ), - '', - 'css_js' - ); - ?> -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- checkbox( 'browsercache.cssjs.last_modified' ); ?> -

-
- checkbox( 'browsercache.cssjs.expires' ); ?> -

-
- - - - name="browsercache__cssjs__lifetime" value="_config->get_integer( 'browsercache.cssjs.lifetime' ) ); ?>" size="8" /> -
- checkbox( 'browsercache.cssjs.cache.control' ); ?> -

-
- - - - -

- -
- checkbox( 'browsercache.cssjs.etag' ); ?> -

-
- checkbox( 'browsercache.cssjs.w3tc' ); ?> -

-
- checkbox( 'browsercache.cssjs.compression' ); ?> -

-
- checkbox( 'browsercache.cssjs.brotli', ! function_exists( 'brotli_compress' ) ); ?> -

-
- checkbox( 'browsercache.cssjs.replace' ); ?> -

-
- checkbox( 'browsercache.cssjs.querystring' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- checkbox( 'browsercache.cssjs.nocookies' ); ?> -

-
- - - - ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ), - '', - 'html_xml' - ); - ?> -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- checkbox( 'browsercache.html.last_modified' ); ?> -

-
- checkbox( 'browsercache.html.expires' ); ?> -

-
- - - - value="_config->get_integer( 'browsercache.html.lifetime' ) ); ?>" - size="8" /> -
- checkbox( 'browsercache.html.cache.control' ); ?> -

-
- - - - -

- -
- checkbox( 'browsercache.html.etag' ); ?> -

-
- checkbox( 'browsercache.html.w3tc' ); ?> -

-
- checkbox( 'browsercache.html.compression' ); ?> -

-
- checkbox( 'browsercache.html.brotli', ! function_exists( 'brotli_compress' ) ); ?> -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- checkbox( 'browsercache.other.last_modified' ); ?> -

-
- checkbox( 'browsercache.other.expires' ); ?> -

-
- - - - name="browsercache__other__lifetime" value="_config->get_integer( 'browsercache.other.lifetime' ) ); ?>" size="8" /> -
- checkbox( 'browsercache.other.cache.control' ); ?> -

-
- - - - -

- -
- checkbox( 'browsercache.other.etag' ); ?> -

-
- checkbox( 'browsercache.other.w3tc' ); ?> -

-
- checkbox( 'browsercache.other.compression' ); ?> -

-
- checkbox( 'browsercache.other.brotli', ! function_exists( 'brotli_compress' ) ); ?> -

-
- checkbox( 'browsercache.other.replace' ); ?> -

-
- checkbox( 'browsercache.other.querystring' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- checkbox( 'browsercache.other.nocookies' ); ?> -

-
- - - - -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php deleted file mode 100644 index 8e61c1e4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php +++ /dev/null @@ -1,898 +0,0 @@ - - -

- ' . Cache::engine_name( $this->_config->get_string( 'cdn.engine' ) ) . '', - '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . '' - ), - array( - 'strong' => array(), - 'span' => array( - 'class' => array(), - ), - ) - ); - ?> -

-
- -

- Maximize CDN usage by or - -

- -

- objects from the CDN' : ''; - $cdn_mirror_purge_button = $cdn_mirror_purge_all ? ( $can_purge ? ' or ' : '' ) . '' : ''; - echo $cdn_purge_button . $cdn_mirror_purge_button; - ?> -

- - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> - . - Check - - - ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> - - - -

- array( - 'type' => array(), - 'name' => array(), - 'value' => array(), - ), - ) - ); - ?> - class="button" /> -

-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - checkbox( - 'cdn.uploads.enable', - ! $upload_blogfiles_enabled, - '', - true, - $force_value - ); - ?> - -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - if ( ! $upload_blogfiles_enabled ) : - echo wp_kses( - sprintf( - // translators: 1 HTML line break. - __( - '%1$sTo enable that, switch off "Use single network configuration file for all sites" option at General settings page and use specific settings for each blog.', - 'w3-total-cache' - ), - '
' - ), - array( - 'br' => array(), - ) - ); - endif; - ?> -

-
- /> -
> - checkbox( 'cdn.includes.enable' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- -
> - checkbox( 'cdn.theme.enable' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- -
> - checkbox( 'cdn.minify.enable', ! $minify_enabled ); ?> -

- ', - '', - '', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- /> -
> - checkbox( 'cdn.custom.enable' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- /> -
- checkbox( 'cdn.force.rewrite' ); ?> -

-
- checkbox( 'cdn.canonical_header' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- checkbox( 'cdn.flush_manually' ); - echo wp_kses( - sprintf( - // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag. - __( - 'Only purge %1$sCDN%2$s manually', - 'w3-total-cache' - ), - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-

-
- checkbox( 'cdn.reject.ssl' ); ?> -

- ', - '', - '', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- checkbox( 'cdn.admin.media_library' ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- checkbox( 'cdn.cors_header' ); ?> Add CORS header -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- checkbox( 'cdn.reject.logged_roles' ); ?> -

- -
- _config->get_array( 'cdn.reject.roles' ); ?> -
- $role_data ) : ?> - id="role_" /> - - -
-
- -

- ', - '', - '', - '' - ), - array( - 'a' => array( - 'href' => array(), - ), - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- checkbox( 'minify.upload', $this->_config->get_boolean( 'minify.auto' ) ); ?> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- _config->get_string( 'cdn.engine' ) ) { - $disabled = true; - $force_value = false; - } - - $this->checkbox( - 'cdn.autoupload.enabled', - $disabled, - '', - true, - $force_value - ); - ?> - -

-
- - value="_config->get_integer( 'cdn.autoupload.interval' ) ); ?>" size="8" /> -

-
- - name="cdn__queue__interval" value="_config->get_integer( 'cdn.queue.interval' ) ); ?>" size="10" /> -

-
- - name="cdn__queue__limit" value="_config->get_integer( 'cdn.queue.limit' ) ); ?>" size="10" /> -

-
- - name="cdn__includes__files" value="_config->get_string( 'cdn.includes.files' ) ); ?>" size="100" /> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- - value="_config->get_string( 'cdn.theme.files' ) ); ?>" size="100" /> -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- - value="_config->get_string( 'cdn.import.files' ) ); ?>" size="100" /> -

-
- -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> - -
- - -

-
- -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- -

- ', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- - - -

- ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

-
- - - - - - - - -
-
    -
  • -
  • - ', - '', - '', - '', - '', - '' - ), - array( - 'a' => array( - 'href' => array(), - ), - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -
  • -
-
- -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php deleted file mode 100644 index 0f98972c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php +++ /dev/null @@ -1,138 +0,0 @@ - - - - - name="cdn__akamai__username" value="_config->get_string( 'cdn.akamai.username' ) ); ?>" size="60" /> - - - - - - type="password" name="cdn__akamai__password" value="_config->get_string( 'cdn.akamai.password' ) ); ?>" size="60" /> - - - - - - -

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

- ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

- - - - - - _config->get_array( 'cdn.akamai.domain' ); - require W3TC_INC_DIR . '/options/cdn/common/cnames.php'; - ?> -

- ', - '', - '', - '' - ), - array( - 'acronym' => array( - 'title' => array(), - ), - ) - ); - ?> -

- - - - - - - diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php deleted file mode 100644 index 8ab59997..00000000 --- a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php +++ /dev/null @@ -1,112 +0,0 @@ - - - - - name="cdn__att__account" value="_config->get_string( 'cdn.att.account' ) ); ?>" size="60" /> - - - -