debug-bar
4 years ago
3rd-party.php
3 years ago
bbpress.php
4 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-jetpack-crm-data.php
3 years ago
class-jetpack-modules-overrides.php
4 years ago
class-salesforce-lead-form.php
3 years ago
class.jetpack-amp-support.php
3 years ago
creative-mail.php
4 years ago
crowdsignal.php
5 years ago
debug-bar.php
5 years ago
jetpack-backup.php
4 years ago
jetpack-boost.php
4 years ago
qtranslate-x.php
5 years ago
vaultpress.php
5 years ago
web-stories.php
5 years ago
woocommerce-services.php
4 years ago
woocommerce.php
5 years ago
wpml.php
5 years ago
3rd-party.php
74 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 | /** |
| 14 | * Loads the individual 3rd-party compat files. |
| 15 | */ |
| 16 | function load_3rd_party() { |
| 17 | // Array of third-party compat files to always require. |
| 18 | $compat_files = array( |
| 19 | 'bbpress.php', |
| 20 | 'beaverbuilder.php', |
| 21 | 'bitly.php', |
| 22 | 'buddypress.php', |
| 23 | 'class.jetpack-amp-support.php', |
| 24 | 'class-jetpack-crm-data.php', |
| 25 | 'class-jetpack-modules-overrides.php', // Special case. Tools to be used to override module settings. |
| 26 | 'class-salesforce-lead-form.php', // not a module but the handler for Salesforce forms |
| 27 | 'creative-mail.php', |
| 28 | 'jetpack-backup.php', |
| 29 | 'jetpack-boost.php', |
| 30 | 'debug-bar.php', |
| 31 | 'class-domain-mapping.php', |
| 32 | 'crowdsignal.php', |
| 33 | 'qtranslate-x.php', |
| 34 | 'vaultpress.php', |
| 35 | 'web-stories.php', |
| 36 | 'wpml.php', |
| 37 | 'woocommerce.php', |
| 38 | 'woocommerce-services.php', |
| 39 | ); |
| 40 | |
| 41 | foreach ( $compat_files as $file ) { |
| 42 | if ( file_exists( JETPACK__PLUGIN_DIR . '/3rd-party/' . $file ) ) { |
| 43 | require_once JETPACK__PLUGIN_DIR . '/3rd-party/' . $file; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | add_filter( 'jetpack_development_version', __NAMESPACE__ . '\atomic_weekly_override' ); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Handles suppressing development version notices on Atomic-hosted sites. |
| 52 | * |
| 53 | * @param bool $development_version Filterable value if this is a development version of Jetpack. |
| 54 | * |
| 55 | * @return bool |
| 56 | */ |
| 57 | function atomic_weekly_override( $development_version ) { |
| 58 | if ( ( new Host() )->is_atomic_platform() ) { |
| 59 | $haystack = Constants::get_constant( 'JETPACK__PLUGIN_DIR' ); |
| 60 | $needle = '/jetpack-dev/'; |
| 61 | if ( |
| 62 | ( function_exists( 'str_ends_with' ) && str_ends_with( $haystack, $needle ) ) || // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound |
| 63 | 0 === substr_compare( $haystack, $needle, -13 ) |
| 64 | ) { |
| 65 | return $development_version; // Returns the default response if the active Jetpack version is from the beta plugin. |
| 66 | } |
| 67 | |
| 68 | $development_version = false; // Returns false for regular installs on Atomic. |
| 69 | } |
| 70 | return $development_version; // Return default if not on Atomic. |
| 71 | } |
| 72 | |
| 73 | load_3rd_party(); |
| 74 |