1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* Plugin Name: Jetpack by WordPress.com |
5
|
|
|
* Plugin URI: https://jetpack.com |
6
|
|
|
* Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users. |
7
|
|
|
* Author: Automattic |
8
|
|
|
* Version: 7.2-alpha |
9
|
|
|
* Author URI: https://jetpack.com |
10
|
|
|
* License: GPL2+ |
11
|
|
|
* Text Domain: jetpack |
12
|
|
|
* Domain Path: /languages/ |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
define( 'JETPACK__VERSION', '7.2-alpha' ); |
16
|
|
|
define( 'JETPACK_MASTER_USER', true ); |
17
|
|
|
define( 'JETPACK__API_VERSION', 1 ); |
18
|
|
|
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
19
|
|
|
define( 'JETPACK__PLUGIN_FILE', __FILE__ ); |
20
|
|
|
defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) or define( 'JETPACK__GLOTPRESS_LOCALES_PATH', JETPACK__PLUGIN_DIR . 'locales.php' ); |
21
|
|
|
defined( 'JETPACK__SANDBOX_DOMAIN' ) or define( 'JETPACK__SANDBOX_DOMAIN', '' ); |
22
|
|
|
|
23
|
|
|
// always load this |
24
|
|
|
$loader = require JETPACK__PLUGIN_DIR . '/vendor/autoload.php'; |
25
|
|
|
|
26
|
|
|
// by making this check first, we never load the Bootstrap class more than once |
27
|
|
|
if ( ! defined( 'Jetpack_V7_Core_Loaded' ) ) { |
28
|
|
|
// this should autoload the bootstrap file |
29
|
|
|
$plugin = new \Jetpack\V7\Core\Bootstrap(); |
30
|
|
|
$plugin->load(); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
// classes to load: |
34
|
|
|
// Client |
35
|
|
|
// Debugger |
36
|
|
|
// Compat |
37
|
|
|
|
38
|
|
|
// eventually we won't have to force these to load, but right now they define constants that are used elsewhere in Jetpack |
39
|
|
|
$loader->loadClass( 'Jetpack\V7\Core\Client' ); |
40
|
|
|
$loader->loadClass( 'Jetpack\V7\Core\Debugger' ); |
41
|
|
|
$loader->loadClass( 'Jetpack\V7\Core\Compat' ); |
42
|
|
|
$loader->loadClass( 'Jetpack\V7\Core\Api' ); |
43
|
|
|
$loader->loadClass( 'Jetpack\V7\Core\Lib' ); |
44
|
|
|
|
45
|
|
|
// Initialize the plugin if not already loaded. |
46
|
|
|
add_action( 'init', function(){ |
47
|
|
|
|
48
|
|
|
|
49
|
|
|
}); |
50
|
|
|
|
51
|
|
|
// Optional, remove later |
52
|
|
|
// Protect |
53
|
|
|
|
54
|
|
|
|
55
|
|
|
|
56
|
|
|
|
57
|
|
|
|
58
|
|
|
|
59
|
|
|
|
60
|
|
|
|
61
|
|
|
|
62
|
|
|
// legacy classes |
63
|
|
|
$loader->loadClass( 'Jetpack' ); |
64
|
|
|
|
65
|
|
|
|
66
|
|
|
|
67
|
|
|
// @todo: Abstract out the admin functions, and only include them if is_admin() |
68
|
|
|
// require_once( JETPACK__PLUGIN_DIR . 'class.jetpack.php' ); |
69
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-network.php' ); |
70
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client.php' ); |
71
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-data.php' ); |
72
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php' ); |
73
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-actions.php' ); |
74
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-options.php' ); |
75
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php' ); |
76
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php' ); |
77
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-error.php' ); |
78
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php' ); |
79
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.photon.php' ); |
80
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'functions.photon.php' ); |
81
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'functions.global.php' ); |
82
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'functions.compat.php' ); |
83
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'functions.gallery.php' ); |
84
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'require-lib.php' ); |
85
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php' ); |
86
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-tracks.php' ); |
87
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php' ); |
88
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'modules/module-headings.php'); |
89
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-constants.php'); |
90
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-idc.php' ); |
91
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php' ); |
92
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php' ); |
93
|
|
|
|
94
|
|
|
if ( is_admin() ) { |
95
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php' ); |
96
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-jitm.php' ); |
97
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-affiliate.php' ); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
// Play nice with http://wp-cli.org/ |
101
|
|
|
if ( defined( 'WP_CLI' ) && WP_CLI ) { |
102
|
|
|
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php' ); |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
require_once( JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php' ); |
106
|
|
|
|
107
|
|
|
register_activation_hook( __FILE__, array( 'Jetpack', 'plugin_activation' ) ); |
108
|
|
|
register_deactivation_hook( __FILE__, array( 'Jetpack', 'plugin_deactivation' ) ); |
109
|
|
|
add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 ); |
110
|
|
|
add_action( 'init', array( 'Jetpack', 'init' ) ); |
111
|
|
|
add_action( 'plugins_loaded', array( 'Jetpack', 'plugin_textdomain' ), 99 ); |
112
|
|
|
add_action( 'plugins_loaded', array( 'Jetpack', 'load_modules' ), 100 ); |
113
|
|
|
add_filter( 'jetpack_static_url', array( 'Jetpack', 'staticize_subdomain' ) ); |
114
|
|
|
add_filter( 'is_jetpack_site', '__return_true' ); |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Add an easy way to photon-ize a URL that is safe to call even if Jetpack isn't active. |
118
|
|
|
* |
119
|
|
|
* See: http://jetpack.com/2013/07/11/photon-and-themes/ |
120
|
|
|
*/ |
121
|
|
|
if ( Jetpack::is_module_active( 'photon' ) ) { |
122
|
|
|
add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 ); |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
if ( JETPACK__SANDBOX_DOMAIN ) { |
126
|
|
|
require_once( JETPACK__PLUGIN_DIR . '_inc/jetpack-server-sandbox.php' ); |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
require_once( JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php' ); |
130
|
|
|
|
131
|
|
|
Jetpack::init(); |
132
|
|
|
|