PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | integration/load.php +56 -128 9.2.05.7.0 View file →
@@ -6,40 +6,33 @@
6 6 */
7 7
8 8 namespace Activitypub\Integration;
9 9
10 -use Activitypub\Autoloader;
10 +\Activitypub\Autoloader::register_path( __NAMESPACE__, __DIR__ );
11 11
12 -use function Activitypub\site_supports_blocks;
13 -
14 -Autoloader::register_path( __NAMESPACE__, __DIR__ );
15 -
16 12 /**
17 13 * Initialize the ActivityPub integrations.
18 14 */
19 15 function plugin_init() {
20 16 /**
21 - * Adds Akismet support.
17 + * Adds WebFinger (plugin) support.
22 18 *
23 - * This class handles the compatibility with the Akismet plugin.
19 + * This class handles the compatibility with the WebFinger plugin
20 + * and coordinates the internal WebFinger implementation.
24 21 *
25 - * @see https://wordpress.org/plugins/akismet/
22 + * @see https://wordpress.org/plugins/webfinger/
26 23 */
27 - if ( \defined( 'AKISMET_VERSION' ) ) {
28 - Akismet::init();
29 - }
24 + Webfinger::init();
30 25
31 26 /**
32 - * Adds Classic Editor support.
27 + * Adds NodeInfo (plugin) support.
33 28 *
34 - * This class handles the compatibility with the Classic Editor plugin
35 - * and sites without block editor support.
29 + * This class handles the compatibility with the NodeInfo plugin
30 + * and coordinates the internal NodeInfo implementation.
36 31 *
37 - * @see https://wordpress.org/plugins/classic-editor/
32 + * @see https://wordpress.org/plugins/nodeinfo/
38 33 */
39 - if ( \class_exists( '\Classic_Editor' ) || \function_exists( 'classicpress_version' ) || ! site_supports_blocks() ) {
40 - Classic_Editor::init();
41 - }
34 + Nodeinfo::init();
42 35
43 36 /**
44 37 * Adds Enable Mastodon Apps support.
45 38 *
@@ -51,88 +44,41 @@
51 44 Enable_Mastodon_Apps::init();
52 45 }
53 46
54 47 /**
55 - * Adds Jetpack support.
48 + * Adds OpenGraph support.
56 49 *
57 - * This class handles the compatibility with Jetpack.
50 + * This class handles the compatibility with the OpenGraph plugin.
58 51 *
59 - * @see https://jetpack.com/
52 + * @see https://wordpress.org/plugins/opengraph/
60 53 */
61 - if ( \defined( 'JETPACK__VERSION' ) ) {
62 - Jetpack::init();
54 + if ( '1' === \get_option( 'activitypub_use_opengraph', '1' ) ) {
55 + Opengraph::init();
63 56 }
64 57
65 58 /**
66 - * Adds LiteSpeed Cache support.
59 + * Adds Jetpack support.
67 60 *
68 - * The check for whether LiteSpeed Cache is loaded and initialized happens inside Litespeed_Cache::init().
61 + * This class handles the compatibility with Jetpack.
69 62 *
70 - * @see https://wordpress.org/plugins/litespeed-cache/
63 + * @see https://jetpack.com/
71 64 */
72 - Litespeed_Cache::init();
73 -
74 - /**
75 - * Adds Multisite Language Switcher support.
76 - *
77 - * This class handles the compatibility with the Multisite Language Switcher plugin.
78 - *
79 - * @see https://wordpress.org/plugins/multisite-language-switcher/
80 - */
81 - if ( \defined( 'MSLS_PLUGIN_VERSION' ) ) {
82 - Multisite_Language_Switcher::init();
65 + if ( \defined( 'JETPACK__VERSION' ) && ! \defined( 'IS_WPCOM' ) ) {
66 + Jetpack::init();
83 67 }
84 68
85 69 /**
86 - * Adds NodeInfo (plugin) support.
70 + * Adds Akismet support.
87 71 *
88 - * This class handles the compatibility with the NodeInfo plugin
89 - * and coordinates the internal NodeInfo implementation.
72 + * This class handles the compatibility with the Akismet plugin.
90 73 *
91 - * @see https://wordpress.org/plugins/nodeinfo/
74 + * @see https://wordpress.org/plugins/akismet/
92 75 */
93 - Nodeinfo::init();
94 -
95 - /**
96 - * Adds OpenGraph support.
97 - *
98 - * This class handles the compatibility with the OpenGraph plugin.
99 - *
100 - * @see https://wordpress.org/plugins/opengraph/
101 - */
102 - if ( '1' === \get_option( 'activitypub_use_opengraph', '1' ) ) {
103 - Opengraph::init();
76 + if ( \defined( 'AKISMET_VERSION' ) ) {
77 + Akismet::init();
104 78 }
105 79
106 80 /**
107 - * Adds Podlove Podcast Publisher support.
108 - *
109 - * This class handles the compatibility with Podlove Podcast Publisher.
110 - *
111 - * @see https://wordpress.org/plugins/podlove-podcasting-plugin-for-wordpress/
112 - */
113 - if ( \defined( 'Podlove\PLUGIN_FILE' ) ) {
114 - // Enable ActivityPub support for the podcast post type.
115 - \add_post_type_support( 'podcast', 'activitypub' );
116 -
117 - \add_filter(
118 - 'activitypub_transformer',
119 - static function ( $transformer, $data, $object_class ) {
120 - if (
121 - 'WP_Post' === $object_class &&
122 - 'podcast' === $data->post_type &&
123 - \Podlove\Model\Episode::find_one_by_post_id( $data->ID )
124 - ) {
125 - return new Podlove_Podcast_Publisher( $data );
126 - }
127 - return $transformer;
128 - },
129 - 10,
130 - 3
131 - );
132 - }
133 -
134 - /**
135 81 * Adds Seriously Simple Podcasting support.
136 82 *
137 83 * This class handles the compatibility with Seriously Simple Podcasting.
138 84 *
@@ -138,11 +84,11 @@
138 84 *
139 85 * @see https://wordpress.org/plugins/seriously-simple-podcasting/
140 86 */
141 87 if ( \defined( 'SSP_VERSION' ) ) {
142 - \add_filter(
88 + add_filter(
143 89 'activitypub_transformer',
144 - static function ( $transformer, $data, $object_class ) {
90 + function ( $transformer, $data, $object_class ) {
145 91 if (
146 92 'WP_Post' === $object_class &&
147 93 \get_post_meta( $data->ID, 'audio_file', true )
148 94 ) {
@@ -155,36 +101,8 @@
155 101 );
156 102 }
157 103
158 104 /**
159 - * Adds Stream support.
160 - *
161 - * This class handles the compatibility with the Stream plugin.
162 - *
163 - * @see https://wordpress.org/plugins/stream/
164 - */
165 - Stream\Stream::init();
166 -
167 - /**
168 - * Adds Surge support.
169 - *
170 - * Only load code that needs Surge to run once Surge is loaded and initialized.
171 - *
172 - * @see https://wordpress.org/plugins/surge/
173 - */
174 - Surge::init();
175 -
176 - /**
177 - * Adds WebFinger (plugin) support.
178 - *
179 - * This class handles the compatibility with the WebFinger plugin
180 - * and coordinates the internal WebFinger implementation.
181 - *
182 - * @see https://wordpress.org/plugins/webfinger/
183 - */
184 - Webfinger::init();
185 -
186 - /**
187 105 * Adds WPML Multilingual CMS (plugin) support.
188 106 *
189 107 * This class handles the compatibility with the WPML plugin.
190 108 *
@@ -192,30 +110,40 @@
192 110 */
193 111 if ( \defined( 'ICL_SITEPRESS_VERSION' ) ) {
194 112 WPML::init();
195 113 }
114 +}
115 +\add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_init' );
196 116
197 - /**
198 - * Adds Yoast SEO support.
199 - *
200 - * This class handles the compatibility with Yoast SEO.
201 - *
202 - * @see https://wordpress.org/plugins/wordpress-seo/
203 - */
204 - if ( \defined( 'WPSEO_VERSION' ) ) {
205 - Yoast_Seo::init();
117 +/**
118 + * Register the Stream Connector for ActivityPub.
119 + *
120 + * @param array $classes The Stream connectors.
121 + *
122 + * @return array The Stream connectors with the ActivityPub connector.
123 + */
124 +function register_stream_connector( $classes ) {
125 + $class = new Stream_Connector();
126 +
127 + if ( method_exists( $class, 'is_dependency_satisfied' ) && $class->is_dependency_satisfied() ) {
128 + $classes[] = $class;
206 129 }
130 +
131 + return $classes;
207 132 }
208 -\add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_init' );
133 +add_filter( 'wp_stream_connectors', __NAMESPACE__ . '\register_stream_connector' );
209 134
210 -// Register activation and deactivation hooks for Surge integration.
211 -\register_activation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\Surge', 'add_cache_config' ) );
212 -\register_deactivation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\Surge', 'remove_cache_config' ) );
135 +// Excluded ActivityPub post types from the Stream.
136 +add_filter(
137 + 'wp_stream_posts_exclude_post_types',
138 + function ( $post_types ) {
139 + $post_types[] = 'ap_follower';
140 + $post_types[] = 'ap_extrafield';
141 + $post_types[] = 'ap_extrafield_blog';
142 + return $post_types;
143 + }
144 +);
213 145
214 -// Register activation and deactivation hooks for LiteSpeed Cache integration.
215 -\register_activation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\LiteSpeed_Cache', 'add_htaccess_rules' ) );
216 -\register_deactivation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\LiteSpeed_Cache', 'remove_htaccess_rules' ) );
217 -
218 146 /**
219 147 * Load the BuddyPress integration.
220 148 *
221 149 * Only load code that needs BuddyPress to run once BP is loaded and initialized.
@@ -221,5 +149,5 @@
221 149 * Only load code that needs BuddyPress to run once BP is loaded and initialized.
222 150 *
223 151 * @see https://buddypress.org/
224 152 */
225 -\add_action( 'bp_include', array( __NAMESPACE__ . '\Buddypress', 'init' ), 0 );
153 +add_action( 'bp_include', array( __NAMESPACE__ . '\Buddypress', 'init' ), 0 );