debug-bar
4 years ago
3rd-party.php
3 years ago
amp.php
3 years ago
atomic.php
3 years ago
bbpress.php
3 years ago
beaverbuilder.php
5 years ago
bitly.php
3 years ago
buddypress.php
5 years ago
class-domain-mapping.php
4 years ago
class-jetpack-bbpress-rest-api.php
3 years ago
class-salesforce-lead-form.php
3 years ago
class.jetpack-amp-support.php
3 years ago
creative-mail.php
3 years ago
crowdsignal.php
5 years ago
debug-bar.php
5 years ago
jetpack-backup.php
3 years ago
jetpack-boost.php
3 years ago
qtranslate-x.php
5 years ago
vaultpress.php
5 years ago
web-stories.php
5 years ago
woocommerce-services.php
3 years ago
woocommerce.php
5 years ago
wpml.php
5 years ago
3rd-party.php
98 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Compatibility files for third-party plugins. |
| 4 | * This is used to improve compatibility of specific Jetpack features with third-party plugins. |
| 5 | * |
| 6 | * @package automattic/jetpack |
| 7 | */ |
| 8 | |
| 9 | namespace Automattic\Jetpack; |
| 10 | |
| 11 | use Automattic\Jetpack\Status\Host; |
| 12 | |
| 13 | add_action( 'plugins_loaded', __NAMESPACE__ . '\load_3rd_party_compat_filters', 11 ); |
| 14 | /** |
| 15 | * Loads the individual 3rd-party compat functions. |
| 16 | * |
| 17 | * This is a refactor of load_3rd_party() to load the individual compat files only when needed instead of universally. |
| 18 | */ |
| 19 | function load_3rd_party_compat_filters() { |
| 20 | // SalesForce |
| 21 | // @todo This one probably makes more sense to move to the Forms package (and the module until it is fully deprecated). |
| 22 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/class-salesforce-lead-form.php'; // not a module but the handler for Salesforce forms |
| 23 | |
| 24 | // bbPress |
| 25 | if ( function_exists( 'bbpress' ) ) { |
| 26 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/bbpress.php'; |
| 27 | } |
| 28 | |
| 29 | // Beaver Builder |
| 30 | if ( class_exists( 'FLBuilder' ) ) { |
| 31 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/beaverbuilder.php'; |
| 32 | } |
| 33 | |
| 34 | // Bitly |
| 35 | if ( class_exists( 'Bitly' ) ) { |
| 36 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/bitly.php'; |
| 37 | } |
| 38 | |
| 39 | // BuddyPress |
| 40 | if ( class_exists( 'BuddyPress' ) ) { |
| 41 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/buddypress.php'; |
| 42 | } |
| 43 | |
| 44 | // AMP. AMP__DIR__ is defined in the AMP plugin since the very first version. |
| 45 | if ( Constants::is_defined( 'AMP__DIR__' ) ) { |
| 46 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/amp.php'; |
| 47 | } |
| 48 | |
| 49 | // Domain Mapping. All assume multisite, so it's an easy check. |
| 50 | if ( Constants::is_defined( 'SUNRISE' ) ) { |
| 51 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/class-domain-mapping.php'; |
| 52 | } |
| 53 | |
| 54 | // Debug Bar |
| 55 | if ( class_exists( 'Debug_Bar' ) ) { |
| 56 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/debug-bar.php'; |
| 57 | } |
| 58 | |
| 59 | // Letting these always load since it handles somethings upon plugin activation. |
| 60 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/creative-mail.php'; |
| 61 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/jetpack-backup.php'; |
| 62 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/jetpack-boost.php'; |
| 63 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/woocommerce-services.php'; |
| 64 | |
| 65 | // Crowdsignal. @todo Review the usage of modern Jetpack with outdated Crowdsignal. |
| 66 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/crowdsignal.php'; |
| 67 | |
| 68 | // qTranslate. Plugin closed in 2021, but leaving support for now to allow sites to drop it. |
| 69 | if ( Constants::is_defined( 'QTX_VERSION' ) ) { |
| 70 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/qtranslate-x.php'; |
| 71 | } |
| 72 | |
| 73 | // VaultPress. |
| 74 | if ( Constants::is_defined( 'VAULTPRESS__VERSION' ) || class_exists( 'VaultPress' ) ) { |
| 75 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/vaultpress.php'; |
| 76 | } |
| 77 | |
| 78 | // Web Stories |
| 79 | if ( Constants::is_defined( 'WEBSTORIES_VERSION' ) ) { |
| 80 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/web-stories.php'; |
| 81 | } |
| 82 | |
| 83 | // WooCommerce |
| 84 | if ( class_exists( 'WooCommerce' ) ) { |
| 85 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/woocommerce.php'; |
| 86 | } |
| 87 | |
| 88 | // Atomic Weekly |
| 89 | if ( ( new Host() )->is_atomic_platform() ) { |
| 90 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/atomic.php'; |
| 91 | } |
| 92 | |
| 93 | // WPML |
| 94 | if ( defined( 'ICL_SITEPRESS_VERSION' ) ) { |
| 95 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/wpml.php'; |
| 96 | } |
| 97 | } |
| 98 |