kollapsminoriteten/wp-content/plugins/jetpack/load-jetpack.php

85 lines
3.6 KiB
PHP
Raw Normal View History

2019-11-15 23:26:29 +01:00
<?php
/**
* Load all Jetpack files that do not get loaded via the autoloader.
*
2021-04-27 08:32:47 +02:00
* @package automattic/jetpack
2019-11-15 23:26:29 +01:00
*/
2025-12-12 13:13:07 +01:00
if ( ! defined( 'ABSPATH' ) ) {
exit( 0 );
}
2019-11-15 23:26:29 +01:00
/**
* Checks if the code debug mode turned on, and returns false if it is. When Jetpack is in
* code debug mode, it shouldn't use minified assets. Note that this filter is not being used
* in every place where assets are enqueued. The filter is added at priority 9 to be overridden
* by any default priority filter that runs after it.
*
* @since 6.2.0
*
* @return boolean
*
* @filter jetpack_should_use_minified_assets
*/
function jetpack_should_use_minified_assets() {
2020-03-03 18:49:45 +01:00
return ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG;
2019-11-15 23:26:29 +01:00
}
add_filter( 'jetpack_should_use_minified_assets', 'jetpack_should_use_minified_assets', 9 );
// @todo: Abstract out the admin functions, and only include them if is_admin()
require_once JETPACK__PLUGIN_DIR . 'class.jetpack.php';
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-network.php';
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php';
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php';
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php';
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php';
require_once JETPACK__PLUGIN_DIR . 'class.photon.php';
require_once JETPACK__PLUGIN_DIR . 'functions.photon.php';
require_once JETPACK__PLUGIN_DIR . 'functions.global.php';
require_once JETPACK__PLUGIN_DIR . 'functions.compat.php';
2022-06-16 14:01:47 +02:00
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-gallery-settings.php';
2020-01-26 12:53:20 +01:00
require_once JETPACK__PLUGIN_DIR . 'functions.cookies.php';
2019-11-15 23:26:29 +01:00
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php';
require_once JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php';
require_once JETPACK__PLUGIN_DIR . 'modules/module-headings.php';
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php';
2025-12-12 13:13:07 +01:00
// Used by the API endpoints or used in an odd number of places.
2022-04-02 10:26:41 +02:00
require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-utils.php';
require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-titles.php';
require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-posts.php';
2021-08-17 08:33:07 +02:00
require_once JETPACK__PLUGIN_DIR . 'modules/verification-tools/verification-tools-utils.php';
2025-12-12 13:13:07 +01:00
require_once JETPACK__PLUGIN_DIR . 'modules/shortcodes/shortcode-utils.php'; // Shortcodes are often referenced in other modules, so making it available early.
2019-11-15 23:26:29 +01:00
2021-04-27 08:32:47 +02:00
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-xmlrpc-methods.php';
Jetpack_XMLRPC_Methods::init();
require_once JETPACK__PLUGIN_DIR . 'class-jetpack-connection-status.php';
Jetpack_Connection_Status::init();
2022-12-15 17:41:53 +01:00
require_once JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-recommendations.php';
2020-06-23 13:49:54 +02:00
2019-11-15 23:26:29 +01:00
if ( is_admin() ) {
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php';
2022-12-15 17:41:53 +01:00
require_once JETPACK__PLUGIN_DIR . '_inc/lib/debugger.php';
2026-03-31 11:30:59 +02:00
// Initialize Newsletter Settings (always-loaded so the settings page URL works even when module is inactive).
\Automattic\Jetpack\Newsletter\Settings::init();
\Automattic\Jetpack\Plugin\Jetpack_Script_Data::configure();
2019-11-15 23:26:29 +01:00
}
// Play nice with https://wp-cli.org/.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php';
}
require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php';
2022-06-16 14:01:47 +02:00
require_once JETPACK__PLUGIN_DIR . '_inc/blogging-prompts.php';
2019-11-15 23:26:29 +01:00
add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 );
add_filter( 'is_jetpack_site', '__return_true' );
require_once JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php';
Jetpack::init();