|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Load all Jetpack files that do not get loaded via the autoloader. |
|
4
|
|
|
* |
|
5
|
|
|
* @package Jetpack |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
use Automattic\Jetpack\Bootstrap; |
|
9
|
|
|
|
|
10
|
|
|
Bootstrap::init(); |
|
11
|
|
|
|
|
12
|
|
|
// @todo: Abstract out the admin functions, and only include them if is_admin() |
|
13
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack.php'; |
|
14
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-network.php'; |
|
15
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-data.php'; |
|
16
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php'; |
|
17
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php'; |
|
18
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php'; |
|
19
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-error.php'; |
|
20
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php'; |
|
21
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.photon.php'; |
|
22
|
|
|
require_once JETPACK__PLUGIN_DIR . 'functions.photon.php'; |
|
23
|
|
|
require_once JETPACK__PLUGIN_DIR . 'functions.global.php'; |
|
24
|
|
|
require_once JETPACK__PLUGIN_DIR . 'functions.compat.php'; |
|
25
|
|
|
require_once JETPACK__PLUGIN_DIR . 'functions.gallery.php'; |
|
26
|
|
|
require_once JETPACK__PLUGIN_DIR . 'require-lib.php'; |
|
27
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php'; |
|
28
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php'; |
|
29
|
|
|
require_once JETPACK__PLUGIN_DIR . 'modules/module-headings.php'; |
|
30
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-idc.php'; |
|
31
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php'; |
|
32
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php'; |
|
33
|
|
|
|
|
34
|
|
|
\Automattic\Jetpack\Sync\Main::init(); |
|
35
|
|
|
|
|
36
|
|
|
if ( is_admin() ) { |
|
37
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'; |
|
38
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-affiliate.php'; |
|
39
|
|
|
$jitm = new Automattic\Jetpack\JITM(); |
|
40
|
|
|
$jitm->register(); |
|
41
|
|
|
jetpack_require_lib( 'debugger' ); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
// Play nice with https://wp-cli.org/. |
|
45
|
|
|
if ( defined( 'WP_CLI' ) && WP_CLI ) { |
|
46
|
|
|
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php'; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php'; |
|
50
|
|
|
|
|
51
|
|
|
add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 ); |
|
52
|
|
|
add_action( 'init', array( 'Jetpack', 'init' ) ); |
|
53
|
|
|
add_action( 'plugins_loaded', array( 'Jetpack', 'plugin_textdomain' ), 99 ); |
|
54
|
|
|
add_action( 'plugins_loaded', array( 'Jetpack', 'load_modules' ), 100 ); |
|
55
|
|
|
add_filter( 'jetpack_static_url', array( 'Jetpack', 'staticize_subdomain' ) ); |
|
56
|
|
|
add_filter( 'is_jetpack_site', '__return_true' ); |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Add an easy way to photon-ize a URL that is safe to call even if Jetpack isn't active. |
|
60
|
|
|
* |
|
61
|
|
|
* See: https://jetpack.com/2013/07/11/photon-and-themes/ |
|
62
|
|
|
*/ |
|
63
|
|
|
if ( Jetpack::is_module_active( 'photon' ) ) { |
|
64
|
|
|
add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 ); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
if ( JETPACK__SANDBOX_DOMAIN ) { |
|
68
|
|
|
require_once JETPACK__PLUGIN_DIR . '_inc/jetpack-server-sandbox.php'; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
require_once JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php'; |
|
72
|
|
|
|
|
73
|
|
|
Jetpack::init(); |
|
74
|
|
|
|