| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: ActivityPub |
| 4 | 4 | * Plugin URI: https://github.com/Automattic/wordpress-activitypub |
| 5 | 5 | * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. |
| 6 | - * Version: 9.2.0 | |
| 6 | + * Version: 8.0.2 | |
| 7 | 7 | * Author: Matthias Pfefferle & Automattic |
| 8 | 8 | * Author URI: https://automattic.com/ |
| 9 | 9 | * License: MIT |
| 10 | 10 | * License URI: http://opensource.org/licenses/MIT |
| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | namespace Activitypub; |
| 19 | 19 | |
| 20 | -\define( 'ACTIVITYPUB_PLUGIN_VERSION', '9.2.0' ); | |
| 20 | +\define( 'ACTIVITYPUB_PLUGIN_VERSION', '8.0.2' ); | |
| 21 | 21 | |
| 22 | 22 | // Plugin related constants. |
| 23 | 23 | \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 24 | 24 | \define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
| @@ -52,25 +52,16 @@ | ||
| 52 | 52 | Rest\Server::init(); |
| 53 | 53 | ( new Rest\Actors_Controller() )->register_routes(); |
| 54 | 54 | ( new Rest\Actors_Inbox_Controller() )->register_routes(); |
| 55 | 55 | ( new Rest\Admin\Actions_Controller() )->register_routes(); |
| 56 | - ( new Rest\Admin\Statistics_Controller() )->register_routes(); | |
| 57 | 56 | ( new Rest\Application_Controller() )->register_routes(); |
| 58 | - ( new Rest\Stats_Image_Controller() )->register_routes(); | |
| 59 | 57 | ( new Rest\Collections_Controller() )->register_routes(); |
| 60 | 58 | ( new Rest\Comments_Controller() )->register_routes(); |
| 61 | 59 | ( new Rest\Followers_Controller() )->register_routes(); |
| 62 | 60 | ( new Rest\Following_Controller() )->register_routes(); |
| 63 | - ( new Rest\Liked_Controller() )->register_routes(); | |
| 64 | 61 | ( new Rest\Inbox_Controller() )->register_routes(); |
| 65 | 62 | ( new Rest\Interaction_Controller() )->register_routes(); |
| 66 | 63 | ( new Rest\Moderators_Controller() )->register_routes(); |
| 67 | - if ( \get_option( 'activitypub_api', false ) ) { | |
| 68 | - ( new Rest\Actor_Autocomplete_Controller() )->register_routes(); | |
| 69 | - ( new Rest\OAuth\Authorization_Controller() )->register_routes(); | |
| 70 | - ( new Rest\OAuth\Clients_Controller() )->register_routes(); | |
| 71 | - ( new Rest\OAuth\Token_Controller() )->register_routes(); | |
| 72 | - } | |
| 73 | 64 | ( new Rest\Outbox_Controller() )->register_routes(); |
| 74 | 65 | ( new Rest\Post_Controller() )->register_routes(); |
| 75 | 66 | ( new Rest\Replies_Controller() )->register_routes(); |
| 76 | 67 | ( new Rest\Webfinger_Controller() )->register_routes(); |
| @@ -78,9 +69,8 @@ | ||
| 78 | 69 | // Load NodeInfo endpoints only if blog is public. |
| 79 | 70 | if ( is_blog_public() ) { |
| 80 | 71 | ( new Rest\Nodeinfo_Controller() )->register_routes(); |
| 81 | 72 | } |
| 82 | - ( new Rest\Proxy_Controller() )->register_routes(); | |
| 83 | 73 | } |
| 84 | 74 | \add_action( 'rest_api_init', __NAMESPACE__ . '\rest_init' ); |
| 85 | 75 | |
| 86 | 76 | /** |
| @@ -87,18 +77,13 @@ | ||
| 87 | 77 | * Initialize plugin. |
| 88 | 78 | */ |
| 89 | 79 | function plugin_init() { |
| 90 | 80 | \add_action( 'init', array( __NAMESPACE__ . '\Activitypub', 'init' ) ); |
| 91 | - \add_action( 'init', array( __NAMESPACE__ . '\Application', 'init' ) ); | |
| 92 | 81 | \add_action( 'init', array( __NAMESPACE__ . '\Avatars', 'init' ) ); |
| 93 | - \add_action( 'init', array( __NAMESPACE__ . '\Blurhash', 'init' ) ); | |
| 94 | 82 | \add_action( 'init', array( __NAMESPACE__ . '\Cache', 'init' ) ); |
| 95 | 83 | \add_action( 'init', array( __NAMESPACE__ . '\Comment', 'init' ) ); |
| 96 | 84 | \add_action( 'init', array( __NAMESPACE__ . '\Dispatcher', 'init' ) ); |
| 97 | 85 | \add_action( 'init', array( __NAMESPACE__ . '\Embed', 'init' ) ); |
| 98 | - if ( \get_option( 'activitypub_api', false ) ) { | |
| 99 | - \add_action( 'init', array( __NAMESPACE__ . '\Event_Stream', 'init' ) ); | |
| 100 | - } | |
| 101 | 86 | \add_action( 'init', array( __NAMESPACE__ . '\Handler', 'init' ) ); |
| 102 | 87 | \add_action( 'init', array( __NAMESPACE__ . '\Hashtag', 'init' ) ); |
| 103 | 88 | \add_action( 'init', array( __NAMESPACE__ . '\Link', 'init' ) ); |
| 104 | 89 | \add_action( 'init', array( __NAMESPACE__ . '\Mailer', 'init' ) ); |
| @@ -111,12 +96,8 @@ | ||
| 111 | 96 | // Priority 0 ensures Scheduler hooks are registered before Migration (priority 1) runs. |
| 112 | 97 | \add_action( 'init', array( __NAMESPACE__ . '\Scheduler', 'init' ), 0 ); |
| 113 | 98 | \add_action( 'init', array( __NAMESPACE__ . '\Search', 'init' ) ); |
| 114 | 99 | \add_action( 'init', array( __NAMESPACE__ . '\Signature', 'init' ) ); |
| 115 | - // Only load OAuth Server if the ActivityPub API is enabled. | |
| 116 | - if ( \get_option( 'activitypub_api', false ) ) { | |
| 117 | - \add_action( 'init', array( __NAMESPACE__ . '\OAuth\Server', 'init' ) ); | |
| 118 | - } | |
| 119 | 100 | |
| 120 | 101 | if ( site_supports_blocks() ) { |
| 121 | 102 | \add_action( 'init', array( __NAMESPACE__ . '\Blocks', 'init' ) ); |
| 122 | 103 | } |
| @@ -132,8 +113,16 @@ | ||
| 132 | 113 | if ( \file_exists( $loader_file ) && \is_readable( $loader_file ) ) { |
| 133 | 114 | require_once $loader_file; |
| 134 | 115 | } |
| 135 | 116 | } |
| 117 | + | |
| 118 | + if ( \defined( 'WP_DEBUG' ) && WP_DEBUG ) { | |
| 119 | + $debug_file = __DIR__ . '/includes/debug.php'; | |
| 120 | + if ( \file_exists( $debug_file ) && \is_readable( $debug_file ) ) { | |
| 121 | + require_once $debug_file; | |
| 122 | + Debug::init(); | |
| 123 | + } | |
| 124 | + } | |
| 136 | 125 | } |
| 137 | 126 | \add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_init' ); |
| 138 | 127 | |
| 139 | 128 | /** |
| @@ -151,9 +140,8 @@ | ||
| 151 | 140 | \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\Blog_Settings_Fields', 'init' ) ); |
| 152 | 141 | \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\Health_Check', 'init' ) ); |
| 153 | 142 | \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\Settings', 'init' ) ); |
| 154 | 143 | \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\Settings_Fields', 'init' ) ); |
| 155 | - \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\Dashboard', 'init' ) ); | |
| 156 | 144 | \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\User_Settings_Fields', 'init' ) ); |
| 157 | 145 | \add_action( 'admin_init', array( __NAMESPACE__ . '\WP_Admin\Welcome_Fields', 'init' ) ); |
| 158 | 146 | |
| 159 | 147 | if ( defined( 'WP_LOAD_IMPORTERS' ) && WP_LOAD_IMPORTERS ) { |
| @@ -179,7 +167,4 @@ | ||
| 179 | 167 | // Check for CLI env, to add the CLI commands. |
| 180 | 168 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| 181 | 169 | Cli::register(); |
| 182 | 170 | } |
| 183 | - | |
| 184 | -// Register OAuth login form handler early (before wp-login.php processes). | |
| 185 | -\add_action( 'login_form_activitypub_authorize', array( __NAMESPACE__ . '\OAuth\Server', 'login_form_authorize' ) ); | |