PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 7.9
Jetpack – WP Security, Backup, Speed, & Growth v7.9
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
← All changes | jetpack.php +85 -92 13.2.47.9 View file →
@@ -1,81 +1,35 @@
1 1 <?php
2 2 /**
3 - * Plugin Name: Jetpack
3 + * Plugin Name: Jetpack by WordPress.com
4 4 * Plugin URI: https://jetpack.com
5 - * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things.
5 + * 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.
6 6 * Author: Automattic
7 - * Version: 13.2.4
7 + * Version: 7.9
8 8 * Author URI: https://jetpack.com
9 9 * License: GPL2+
10 10 * Text Domain: jetpack
11 - * Requires at least: 6.3
12 - * Requires PHP: 7.0
11 + * Domain Path: /languages/
13 12 *
14 - * @package automattic/jetpack
13 + * @package Jetpack
15 14 */
16 15
17 -use Automattic\Jetpack\Image_CDN\Image_CDN_Core;
16 +define( 'JETPACK__MINIMUM_WP_VERSION', '5.1' );
17 +define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
18 +define( 'JETPACK__VERSION', '7.9' );
19 +define( 'JETPACK_MASTER_USER', true );
20 +define( 'JETPACK__API_VERSION', 1 );
21 +define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
22 +define( 'JETPACK__PLUGIN_FILE', __FILE__ );
18 23
19 -/*
20 -This program is free software; you can redistribute it and/or
21 -modify it under the terms of the GNU General Public License
22 -as published by the Free Software Foundation; either version 2
23 -of the License, or (at your option) any later version.
24 -
25 -This program is distributed in the hope that it will be useful,
26 -but WITHOUT ANY WARRANTY; without even the implied warranty of
27 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 -GNU General Public License for more details.
29 -
30 -You should have received a copy of the GNU General Public License
31 -along with this program; if not, write to the Free Software
32 -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33 -*/
34 -
35 -define( 'JETPACK__MINIMUM_WP_VERSION', '6.3' );
36 -define( 'JETPACK__MINIMUM_PHP_VERSION', '7.0' );
37 -define( 'JETPACK__VERSION', '13.2.4' );
38 -
39 -/**
40 - * Constant used to fetch the connection owner token
41 - *
42 - * @deprecated 9.0.0
43 - * @var boolean
44 - */
45 -define( 'JETPACK_MASTER_USER', true );
46 -
47 -define( 'JETPACK__API_VERSION', 1 );
48 -define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
49 -define( 'JETPACK__PLUGIN_FILE', __FILE__ );
50 -
51 -defined( 'JETPACK__RELEASE_POST_BLOG_SLUG' ) || define( 'JETPACK__RELEASE_POST_BLOG_SLUG', 'jetpackreleaseblog.wordpress.com' );
52 -defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) || define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' );
53 -
54 -/**
55 - * WP.com API no longer supports `http://` protocol.
56 - * This means Jetpack can't function properly on servers that can't send outbound HTTPS requests.
57 - * The constant is no longer used.
58 - *
59 - * @deprecated 9.1.0
60 - */
61 -defined( 'JETPACK_CLIENT__HTTPS' ) || define( 'JETPACK_CLIENT__HTTPS', 'AUTO' );
62 -
63 -defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || define( 'JETPACK__GLOTPRESS_LOCALES_PATH', JETPACK__PLUGIN_DIR . 'jetpack_vendor/automattic/jetpack-compat/lib/locales.php' );
64 -defined( 'JETPACK__API_BASE' ) || define( 'JETPACK__API_BASE', 'https://jetpack.wordpress.com/jetpack.' );
65 -defined( 'JETPACK_PROTECT__API_HOST' ) || define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' );
66 -defined( 'JETPACK__WPCOM_JSON_API_BASE' ) || define( 'JETPACK__WPCOM_JSON_API_BASE', 'https://public-api.wordpress.com' );
67 -
68 -/**
69 - * WP.com API no longer supports `http://` protocol.
70 - * Use `JETPACK__WPCOM_JSON_API_BASE` instead, which has the protocol hardcoded.
71 - *
72 - * @deprecated 9.1.0
73 - */
74 -defined( 'JETPACK__WPCOM_JSON_API_HOST' ) || define( 'JETPACK__WPCOM_JSON_API_HOST', 'public-api.wordpress.com' );
75 -
76 -defined( 'JETPACK__SANDBOX_DOMAIN' ) || define( 'JETPACK__SANDBOX_DOMAIN', '' );
77 -defined( 'JETPACK__DEBUGGER_PUBLIC_KEY' ) || define(
24 +defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) || define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' );
25 +defined( 'JETPACK_CLIENT__HTTPS' ) || define( 'JETPACK_CLIENT__HTTPS', 'AUTO' );
26 +defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || define( 'JETPACK__GLOTPRESS_LOCALES_PATH', JETPACK__PLUGIN_DIR . 'locales.php' );
27 +defined( 'JETPACK__API_BASE' ) || define( 'JETPACK__API_BASE', 'https://jetpack.wordpress.com/jetpack.' );
28 +defined( 'JETPACK_PROTECT__API_HOST' ) || define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' );
29 +defined( 'JETPACK__WPCOM_JSON_API_HOST' ) || define( 'JETPACK__WPCOM_JSON_API_HOST', 'public-api.wordpress.com' );
30 +defined( 'JETPACK__SANDBOX_DOMAIN' ) || define( 'JETPACK__SANDBOX_DOMAIN', '' );
31 +defined( 'JETPACK__DEBUGGER_PUBLIC_KEY' ) || define(
78 32 'JETPACK__DEBUGGER_PUBLIC_KEY',
79 33 "\r\n" . '-----BEGIN PUBLIC KEY-----' . "\r\n"
80 34 . 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm+uLLVoxGCY71LS6KFc6' . "\r\n"
81 35 . '1UnF6QGBAsi5XF8ty9kR3/voqfOkpW+gRerM2Kyjy6DPCOmzhZj7BFGtxSV2ZoMX' . "\r\n"
@@ -91,9 +45,9 @@
91 45 * These constants can be set in wp-config.php to ensure sites behind proxies will still work.
92 46 * Setting these constants, though, is *not* the preferred method. It's better to configure
93 47 * the proxy to send the X-Forwarded-Port header.
94 48 */
95 -defined( 'JETPACK_SIGNATURE__HTTP_PORT' ) || define( 'JETPACK_SIGNATURE__HTTP_PORT', 80 );
49 +defined( 'JETPACK_SIGNATURE__HTTP_PORT' ) || define( 'JETPACK_SIGNATURE__HTTP_PORT', 80 );
96 50 defined( 'JETPACK_SIGNATURE__HTTPS_PORT' ) || define( 'JETPACK_SIGNATURE__HTTPS_PORT', 443 );
97 51
98 52 /**
99 53 * Check if the version of WordPress in use on the site is supported by Jetpack.
@@ -114,10 +68,9 @@
114 68 * Outputs for an admin notice about running Jetpack on outdated WordPress.
115 69 *
116 70 * @since 7.2.0
117 71 */
118 - function jetpack_admin_unsupported_wp_notice() {
119 - ?>
72 + function jetpack_admin_unsupported_wp_notice() { ?>
120 73 <div class="notice notice-error is-dismissible">
121 74 <p><?php esc_html_e( 'Jetpack requires a more recent version of WordPress and has been paused. Please update WordPress to continue enjoying Jetpack.', 'jetpack' ); ?></p>
122 75 </div>
123 76 <?php
@@ -129,23 +82,67 @@
129 82
130 83 /**
131 84 * This is where the loading of Jetpack begins.
132 85 *
133 - * First, we try to load our composer autoloader.
86 + * First, we check for our supported version of PHP and load our composer autoloader. If either of these fail,
87 + * we "pause" Jetpack by ending the loading process and displaying an admin_notice to inform the site owner.
134 88 *
135 - * - If it fails, we "pause" Jetpack by ending the loading process
136 - * and displaying an admin_notice to inform the site owner.
137 - * (We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.)
138 - * - If it succeeds, we require load-jetpack.php, where all legacy files are required,
139 - * and where we add on to various hooks that we expect to always run.
89 + * After both those things happen successfully, we require load-jetpack.php,
90 + * where all legacy files are required,
91 + * and where we add on to various hooks that we expect to always run.
92 + * Lastly, we fire Jetpack::init() to fire up the engines.
140 93 */
141 -$jetpack_autoloader = JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
142 -$jetpack_module_headings_file = JETPACK__PLUGIN_DIR . 'modules/module-headings.php'; // This file is loaded later in load-jetpack.php, but let's check here to pause before half-loading Jetpack.
143 -if ( is_readable( $jetpack_autoloader ) && is_readable( $jetpack_module_headings_file ) ) {
144 - require_once $jetpack_autoloader;
145 - if ( method_exists( '\Automattic\Jetpack\Assets', 'alias_textdomains_from_file' ) ) {
146 - \Automattic\Jetpack\Assets::alias_textdomains_from_file( JETPACK__PLUGIN_DIR . 'jetpack_vendor/i18n-map.php' );
94 +if ( version_compare( phpversion(), JETPACK__MINIMUM_PHP_VERSION, '<' ) ) {
95 + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
96 + error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
97 + sprintf(
98 + /* translators: Placeholders are numbers, versions of PHP in use on the site, and required by Jetpack. */
99 + esc_html__( 'Your version of PHP (%1$s) is lower than the version required by Jetpack (%2$s). Please update PHP to continue enjoying Jetpack.', 'jetpack' ),
100 + esc_html( phpversion() ),
101 + JETPACK__MINIMUM_PHP_VERSION
102 + )
103 + );
147 104 }
105 +
106 + /**
107 + * Outputs an admin notice for folks running an outdated version of PHP.
108 + *
109 + * @todo: Remove once WP 5.2 is the minimum version.
110 + *
111 + * @since 7.4.0
112 + */
113 + function jetpack_admin_unsupported_php_notice() {
114 + ?>
115 + <div class="notice notice-error is-dismissible">
116 + <p><?php esc_html_e( 'Jetpack requires a more recent version of PHP and has been paused. Please update PHP to continue enjoying Jetpack.', 'jetpack' ); ?></p>
117 + <p class="button-container">
118 + <?php
119 + printf(
120 + '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
121 + esc_url( wp_get_update_php_url() ),
122 + esc_html__( 'Learn more about updating PHP' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
123 + /* translators: accessibility text */
124 + esc_html__( '(opens in a new tab)' ) // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
125 + );
126 + ?>
127 + </p>
128 + </div>
129 + <?php
130 + }
131 +
132 + add_action( 'admin_notices', 'jetpack_admin_unsupported_php_notice' );
133 + return;
134 +}
135 +
136 +/**
137 + * Load all the packages.
138 + *
139 + * We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.
140 + * If the autoloader is not present, let's log the failure, pause Jetpack, and display a nice admin notice.
141 + */
142 +$jetpack_autoloader = JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
143 +if ( is_readable( $jetpack_autoloader ) ) {
144 + require $jetpack_autoloader;
148 145 } else {
149 146 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
150 147 error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
151 148 sprintf(
@@ -150,9 +147,9 @@
150 147 error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
151 148 sprintf(
152 149 /* translators: Placeholder is a link to a support document. */
153 150 __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to this document to set up your development environment: %1$s', 'jetpack' ),
154 - 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md'
151 + 'https://github.com/Automattic/jetpack/blob/master/docs/development-environment.md'
155 152 )
156 153 );
157 154 }
158 155
@@ -160,9 +157,9 @@
160 157 * Outputs an admin notice for folks running Jetpack without having run composer install.
161 158 *
162 159 * @since 7.4.0
163 160 */
164 - function jetpack_admin_missing_files() {
161 + function jetpack_admin_missing_autoloader() {
165 162 ?>
166 163 <div class="notice notice-error is-dismissible">
167 164 <p>
168 165 <?php
@@ -168,19 +165,18 @@
168 165 <?php
169 166 printf(
170 167 wp_kses(
171 168 /* translators: Placeholder is a link to a support document. */
172 - __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to <a href="%1$s" target="_blank" rel="noopener noreferrer">this document</a> to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: <code>jetpack build plugins/jetpack --with-deps</code>', 'jetpack' ),
169 + __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to <a href="%1$s" target="_blank" rel="noopener noreferrer">this document</a> to set up your development environment.', 'jetpack' ),
173 170 array(
174 - 'a' => array(
171 + 'a' => array(
175 172 'href' => array(),
173 + 'target' => array(),
176 174 'rel' => array(),
177 - 'target' => array(),
178 175 ),
179 - 'code' => array(),
180 176 )
181 177 ),
182 - 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
178 + 'https://github.com/Automattic/jetpack/blob/master/docs/development-environment.md'
183 179 );
184 180 ?>
185 181 </p>
186 182 </div>
@@ -186,16 +182,13 @@
186 182 </div>
187 183 <?php
188 184 }
189 185
190 - add_action( 'admin_notices', 'jetpack_admin_missing_files' );
186 + add_action( 'admin_notices', 'jetpack_admin_missing_autoloader' );
191 187 return;
192 188 }
193 189
194 190 register_activation_hook( __FILE__, array( 'Jetpack', 'plugin_activation' ) );
195 191 register_deactivation_hook( __FILE__, array( 'Jetpack', 'plugin_deactivation' ) );
196 -
197 -// Load image cdn core. This should load regardless of whether the photon module is active.
198 -Image_CDN_Core::setup();
199 192
200 193 // Require everything else, that is not loaded via the autoloader.
201 194 require_once JETPACK__PLUGIN_DIR . 'load-jetpack.php';