| 1 |
<?php |
| 2 |
/** |
| 3 |
* Load all Jetpack files that do not get loaded via the autoloader. |
| 4 |
* |
| 5 |
* @package automattic/jetpack |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Returns the location of Jetpack's lib directory. This filter is applied |
| 10 |
* in require_lib(). |
| 11 |
* |
| 12 |
* @since 4.0.2 |
| 13 |
* @deprecated since 11.3 Use `JETPACK__PLUGIN_DIR . '_inc/lib/'` instead. |
| 14 |
* |
| 15 |
* @return string Location of Jetpack library directory. |
| 16 |
* |
| 17 |
* @filter require_lib_dir |
| 18 |
*/ |
| 19 |
function jetpack_require_lib_dir() { |
| 20 |
return JETPACK__PLUGIN_DIR . '_inc/lib'; |
| 21 |
} |
| 22 |
add_filter( 'jetpack_require_lib_dir', 'jetpack_require_lib_dir' ); |
| 23 |
|
| 24 |
/** |
| 25 |
* Checks if the code debug mode turned on, and returns false if it is. When Jetpack is in |
| 26 |
* code debug mode, it shouldn't use minified assets. Note that this filter is not being used |
| 27 |
* in every place where assets are enqueued. The filter is added at priority 9 to be overridden |
| 28 |
* by any default priority filter that runs after it. |
| 29 |
* |
| 30 |
* @since 6.2.0 |
| 31 |
* |
| 32 |
* @return boolean |
| 33 |
* |
| 34 |
* @filter jetpack_should_use_minified_assets |
| 35 |
*/ |
| 36 |
function jetpack_should_use_minified_assets() { |
| 37 |
return ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG; |
| 38 |
} |
| 39 |
add_filter( 'jetpack_should_use_minified_assets', 'jetpack_should_use_minified_assets', 9 ); |
| 40 |
|
| 41 |
// @todo: Abstract out the admin functions, and only include them if is_admin() |
| 42 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack.php'; |
| 43 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-network.php'; |
| 44 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php'; |
| 45 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php'; |
| 46 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php'; |
| 47 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php'; |
| 48 |
require_once JETPACK__PLUGIN_DIR . 'class.photon.php'; |
| 49 |
require_once JETPACK__PLUGIN_DIR . 'functions.photon.php'; |
| 50 |
require_once JETPACK__PLUGIN_DIR . 'functions.global.php'; |
| 51 |
require_once JETPACK__PLUGIN_DIR . 'functions.compat.php'; |
| 52 |
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-gallery-settings.php'; |
| 53 |
require_once JETPACK__PLUGIN_DIR . 'functions.cookies.php'; |
| 54 |
require_once JETPACK__PLUGIN_DIR . 'require-lib.php'; |
| 55 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php'; |
| 56 |
require_once JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php'; |
| 57 |
require_once JETPACK__PLUGIN_DIR . 'modules/module-headings.php'; |
| 58 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php'; |
| 59 |
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-connection-widget.php'; |
| 60 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php'; |
| 61 |
// Used by the API endpoints. |
| 62 |
require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-utils.php'; |
| 63 |
require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-titles.php'; |
| 64 |
require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-posts.php'; |
| 65 |
require_once JETPACK__PLUGIN_DIR . 'modules/verification-tools/verification-tools-utils.php'; |
| 66 |
|
| 67 |
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-xmlrpc-methods.php'; |
| 68 |
Jetpack_XMLRPC_Methods::init(); |
| 69 |
|
| 70 |
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-connection-status.php'; |
| 71 |
Jetpack_Connection_Status::init(); |
| 72 |
|
| 73 |
jetpack_require_lib( 'class-jetpack-recommendations' ); |
| 74 |
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-recommendations-banner.php'; |
| 75 |
|
| 76 |
if ( is_admin() ) { |
| 77 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'; |
| 78 |
jetpack_require_lib( 'debugger' ); |
| 79 |
} |
| 80 |
|
| 81 |
// Play nice with https://wp-cli.org/. |
| 82 |
if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| 83 |
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php'; |
| 84 |
} |
| 85 |
|
| 86 |
require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php'; |
| 87 |
require_once JETPACK__PLUGIN_DIR . '_inc/blogging-prompts.php'; |
| 88 |
|
| 89 |
add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 ); |
| 90 |
add_filter( 'is_jetpack_site', '__return_true' ); |
| 91 |
|
| 92 |
require_once JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php'; |
| 93 |
|
| 94 |
Jetpack::init(); |
| 95 |
|