PluginProbe
ActivityPub / 7.8.2
ActivityPub v7.8.2
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
activitypub / integration / load.php

load.php in ActivityPub 7.8.2, at integration/load.php

207 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Load the ActivityPub integrations.
4 *
5 * @package Activitypub
6 */
7
8 namespace Activitypub\Integration;
9
10 use function Activitypub\site_supports_blocks;
11
12 \Activitypub\Autoloader::register_path( __NAMESPACE__, __DIR__ );
13
14 /**
15 * Initialize the ActivityPub integrations.
16 */
17 function plugin_init() {
18 /**
19 * Adds Akismet support.
20 *
21 * This class handles the compatibility with the Akismet plugin.
22 *
23 * @see https://wordpress.org/plugins/akismet/
24 */
25 if ( \defined( 'AKISMET_VERSION' ) ) {
26 Akismet::init();
27 }
28
29 /**
30 * Adds Classic Editor support.
31 *
32 * This class handles the compatibility with the Classic Editor plugin
33 * and sites without block editor support.
34 *
35 * @see https://wordpress.org/plugins/classic-editor/
36 */
37 if ( class_exists( '\Classic_Editor' ) || ! site_supports_blocks() ) {
38 Classic_Editor::init();
39 }
40
41 /**
42 * Adds Enable Mastodon Apps support.
43 *
44 * This class handles the compatibility with the Enable Mastodon Apps plugin.
45 *
46 * @see https://wordpress.org/plugins/enable-mastodon-apps/
47 */
48 if ( \defined( 'ENABLE_MASTODON_APPS_VERSION' ) ) {
49 Enable_Mastodon_Apps::init();
50 }
51
52 /**
53 * Adds Jetpack support.
54 *
55 * This class handles the compatibility with Jetpack.
56 *
57 * @see https://jetpack.com/
58 */
59 if ( \defined( 'JETPACK__VERSION' ) ) {
60 Jetpack::init();
61 }
62
63 /**
64 * Adds LiteSpeed Cache support.
65 *
66 * The check for whether LiteSpeed Cache is loaded and initialized happens inside Litespeed_Cache::init().
67 *
68 * @see https://wordpress.org/plugins/litespeed-cache/
69 */
70 Litespeed_Cache::init();
71
72 /**
73 * Adds Multisite Language Switcher support.
74 *
75 * This class handles the compatibility with the Multisite Language Switcher plugin.
76 *
77 * @see https://wordpress.org/plugins/multisite-language-switcher/
78 */
79 if ( \defined( 'MSLS_PLUGIN_VERSION' ) ) {
80 Multisite_Language_Switcher::init();
81 }
82
83 /**
84 * Adds NodeInfo (plugin) support.
85 *
86 * This class handles the compatibility with the NodeInfo plugin
87 * and coordinates the internal NodeInfo implementation.
88 *
89 * @see https://wordpress.org/plugins/nodeinfo/
90 */
91 Nodeinfo::init();
92
93 /**
94 * Adds OpenGraph support.
95 *
96 * This class handles the compatibility with the OpenGraph plugin.
97 *
98 * @see https://wordpress.org/plugins/opengraph/
99 */
100 if ( '1' === \get_option( 'activitypub_use_opengraph', '1' ) ) {
101 Opengraph::init();
102 }
103
104 /**
105 * Adds Seriously Simple Podcasting support.
106 *
107 * This class handles the compatibility with Seriously Simple Podcasting.
108 *
109 * @see https://wordpress.org/plugins/seriously-simple-podcasting/
110 */
111 if ( \defined( 'SSP_VERSION' ) ) {
112 add_filter(
113 'activitypub_transformer',
114 static function ( $transformer, $data, $object_class ) {
115 if (
116 'WP_Post' === $object_class &&
117 \get_post_meta( $data->ID, 'audio_file', true )
118 ) {
119 return new Seriously_Simple_Podcasting( $data );
120 }
121 return $transformer;
122 },
123 10,
124 3
125 );
126 }
127
128 /**
129 * Adds Stream support.
130 *
131 * This class handles the compatibility with the Stream plugin.
132 *
133 * @see https://wordpress.org/plugins/stream/
134 */
135 Stream\Stream::init();
136
137 /**
138 * Adds Surge support.
139 *
140 * Only load code that needs Surge to run once Surge is loaded and initialized.
141 *
142 * @see https://wordpress.org/plugins/surge/
143 */
144 Surge::init();
145
146 /**
147 * Adds WebFinger (plugin) support.
148 *
149 * This class handles the compatibility with the WebFinger plugin
150 * and coordinates the internal WebFinger implementation.
151 *
152 * @see https://wordpress.org/plugins/webfinger/
153 */
154 Webfinger::init();
155
156 /**
157 * Adds WP REST Cache support.
158 *
159 * This class handles the compatibility with the WP REST Cache plugin.
160 *
161 * @see https://wordpress.org/plugins/wp-rest-cache/
162 */
163 if ( \class_exists( 'WP_Rest_Cache_Plugin\Includes\Plugin' ) ) {
164 WP_Rest_Cache::init();
165 }
166
167 /**
168 * Adds WPML Multilingual CMS (plugin) support.
169 *
170 * This class handles the compatibility with the WPML plugin.
171 *
172 * @see https://wpml.org/
173 */
174 if ( \defined( 'ICL_SITEPRESS_VERSION' ) ) {
175 WPML::init();
176 }
177
178 /**
179 * Adds Yoast SEO support.
180 *
181 * This class handles the compatibility with Yoast SEO.
182 *
183 * @see https://wordpress.org/plugins/wordpress-seo/
184 */
185 if ( \defined( 'WPSEO_VERSION' ) ) {
186 Yoast_Seo::init();
187 }
188 }
189 \add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_init' );
190
191 // Register activation and deactivation hooks for Surge integration.
192 \register_activation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\Surge', 'add_cache_config' ) );
193 \register_deactivation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\Surge', 'remove_cache_config' ) );
194
195 // Register activation and deactivation hooks for LiteSpeed Cache integration.
196 \register_activation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\LiteSpeed_Cache', 'add_htaccess_rules' ) );
197 \register_deactivation_hook( ACTIVITYPUB_PLUGIN_FILE, array( __NAMESPACE__ . '\LiteSpeed_Cache', 'remove_htaccess_rules' ) );
198
199 /**
200 * Load the BuddyPress integration.
201 *
202 * Only load code that needs BuddyPress to run once BP is loaded and initialized.
203 *
204 * @see https://buddypress.org/
205 */
206 \add_action( 'bp_include', array( __NAMESPACE__ . '\Buddypress', 'init' ), 0 );
207