jetpack
Last commit date
3rd-party
5 years ago
_inc
5 years ago
css
5 years ago
extensions
5 years ago
images
5 years ago
json-endpoints
5 years ago
modules
5 years ago
sal
5 years ago
src
5 years ago
vendor
5 years ago
views
5 years ago
SECURITY.md
5 years ago
changelog.txt
5 years ago
class-jetpack-recommendations-banner.php
5 years ago
class-jetpack-wizard-banner.php
5 years ago
class.frame-nonce-preview.php
6 years ago
class.jetpack-admin.php
5 years ago
class.jetpack-affiliate.php
6 years ago
class.jetpack-autoupdate.php
5 years ago
class.jetpack-bbpress-json-api.compat.php
5 years ago
class.jetpack-cli.php
5 years ago
class.jetpack-client-server.php
5 years ago
class.jetpack-connection-banner.php
5 years ago
class.jetpack-data.php
5 years ago
class.jetpack-gutenberg.php
5 years ago
class.jetpack-heartbeat.php
5 years ago
class.jetpack-idc.php
6 years ago
class.jetpack-ixr-client.php
5 years ago
class.jetpack-modules-list-table.php
5 years ago
class.jetpack-network-sites-list-table.php
6 years ago
class.jetpack-network.php
5 years ago
class.jetpack-plan.php
5 years ago
class.jetpack-post-images.php
5 years ago
class.jetpack-twitter-cards.php
5 years ago
class.jetpack-user-agent.php
5 years ago
class.jetpack.php
5 years ago
class.json-api-endpoints.php
5 years ago
class.json-api.php
5 years ago
class.photon.php
5 years ago
composer.json
5 years ago
functions.compat.php
5 years ago
functions.cookies.php
5 years ago
functions.gallery.php
6 years ago
functions.global.php
5 years ago
functions.opengraph.php
5 years ago
functions.photon.php
5 years ago
jest.config.js
5 years ago
jetpack.php
5 years ago
json-api-config.php
5 years ago
json-endpoints.php
7 years ago
load-jetpack.php
5 years ago
locales.php
7 years ago
readme.txt
5 years ago
require-lib.php
5 years ago
uninstall.php
5 years ago
wpml-config.xml
10 years ago
load-jetpack.php
87 lines
| 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 | * |
| 14 | * @return string Location of Jetpack library directory. |
| 15 | * |
| 16 | * @filter require_lib_dir |
| 17 | */ |
| 18 | function jetpack_require_lib_dir() { |
| 19 | return JETPACK__PLUGIN_DIR . '_inc/lib'; |
| 20 | } |
| 21 | add_filter( 'jetpack_require_lib_dir', 'jetpack_require_lib_dir' ); |
| 22 | |
| 23 | /** |
| 24 | * Checks if the code debug mode turned on, and returns false if it is. When Jetpack is in |
| 25 | * code debug mode, it shouldn't use minified assets. Note that this filter is not being used |
| 26 | * in every place where assets are enqueued. The filter is added at priority 9 to be overridden |
| 27 | * by any default priority filter that runs after it. |
| 28 | * |
| 29 | * @since 6.2.0 |
| 30 | * |
| 31 | * @return boolean |
| 32 | * |
| 33 | * @filter jetpack_should_use_minified_assets |
| 34 | */ |
| 35 | function jetpack_should_use_minified_assets() { |
| 36 | return ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG; |
| 37 | } |
| 38 | add_filter( 'jetpack_should_use_minified_assets', 'jetpack_should_use_minified_assets', 9 ); |
| 39 | |
| 40 | // @todo: Abstract out the admin functions, and only include them if is_admin() |
| 41 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack.php'; |
| 42 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-network.php'; |
| 43 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php'; |
| 44 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php'; |
| 45 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php'; |
| 46 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php'; |
| 47 | require_once JETPACK__PLUGIN_DIR . 'class.photon.php'; |
| 48 | require_once JETPACK__PLUGIN_DIR . 'functions.photon.php'; |
| 49 | require_once JETPACK__PLUGIN_DIR . 'functions.global.php'; |
| 50 | require_once JETPACK__PLUGIN_DIR . 'functions.compat.php'; |
| 51 | require_once JETPACK__PLUGIN_DIR . 'functions.gallery.php'; |
| 52 | require_once JETPACK__PLUGIN_DIR . 'functions.cookies.php'; |
| 53 | require_once JETPACK__PLUGIN_DIR . 'require-lib.php'; |
| 54 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php'; |
| 55 | require_once JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php'; |
| 56 | require_once JETPACK__PLUGIN_DIR . 'modules/module-headings.php'; |
| 57 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-idc.php'; |
| 58 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php'; |
| 59 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php'; |
| 60 | |
| 61 | jetpack_require_lib( 'class-jetpack-recommendations' ); |
| 62 | require_once JETPACK__PLUGIN_DIR . 'class-jetpack-recommendations-banner.php'; |
| 63 | |
| 64 | if ( is_admin() ) { |
| 65 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'; |
| 66 | jetpack_require_lib( 'debugger' ); |
| 67 | } |
| 68 | |
| 69 | // Play nice with https://wp-cli.org/. |
| 70 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| 71 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php'; |
| 72 | } |
| 73 | |
| 74 | require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php'; |
| 75 | |
| 76 | add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 ); |
| 77 | add_action( 'init', array( 'Jetpack', 'init' ) ); |
| 78 | add_filter( 'is_jetpack_site', '__return_true' ); |
| 79 | |
| 80 | if ( JETPACK__SANDBOX_DOMAIN ) { |
| 81 | require_once JETPACK__PLUGIN_DIR . '_inc/jetpack-server-sandbox.php'; |
| 82 | } |
| 83 | |
| 84 | require_once JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php'; |
| 85 | |
| 86 | Jetpack::init(); |
| 87 |