PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 8.7.3
Jetpack – WP Security, Backup, Speed, & Growth v8.7.3
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
jetpack / jetpack.php
jetpack.php
150 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Jetpack by WordPress.com
4 * Plugin URI: https://jetpack.com
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 * Author: Automattic
7 * Version: 8.7.3
8 * Author URI: https://jetpack.com
9 * License: GPL2+
10 * Text Domain: jetpack
11 * Domain Path: /languages/
12 * Requires at least: 5.3
13 * Requires PHP: 5.6
14 *
15 * @package Jetpack
16 */
17
18 define( 'JETPACK__MINIMUM_WP_VERSION', '5.3' );
19 define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
20 define( 'JETPACK__VERSION', '8.7.3' );
21 define( 'JETPACK_MASTER_USER', true );
22 define( 'JETPACK__API_VERSION', 1 );
23 define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
24 define( 'JETPACK__PLUGIN_FILE', __FILE__ );
25
26 defined( 'JETPACK__RELEASE_POST_BLOG_SLUG' ) || define( 'JETPACK__RELEASE_POST_BLOG_SLUG', 'jetpackreleaseblog.wordpress.com' );
27 defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) || define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' );
28 defined( 'JETPACK_CLIENT__HTTPS' ) || define( 'JETPACK_CLIENT__HTTPS', 'AUTO' );
29 defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || define( 'JETPACK__GLOTPRESS_LOCALES_PATH', JETPACK__PLUGIN_DIR . 'locales.php' );
30 defined( 'JETPACK__API_BASE' ) || define( 'JETPACK__API_BASE', 'https://jetpack.wordpress.com/jetpack.' );
31 defined( 'JETPACK_PROTECT__API_HOST' ) || define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' );
32 defined( 'JETPACK__WPCOM_JSON_API_HOST' ) || define( 'JETPACK__WPCOM_JSON_API_HOST', 'public-api.wordpress.com' );
33 defined( 'JETPACK__SANDBOX_DOMAIN' ) || define( 'JETPACK__SANDBOX_DOMAIN', '' );
34 defined( 'JETPACK__DEBUGGER_PUBLIC_KEY' ) || define(
35 'JETPACK__DEBUGGER_PUBLIC_KEY',
36 "\r\n" . '-----BEGIN PUBLIC KEY-----' . "\r\n"
37 . 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm+uLLVoxGCY71LS6KFc6' . "\r\n"
38 . '1UnF6QGBAsi5XF8ty9kR3/voqfOkpW+gRerM2Kyjy6DPCOmzhZj7BFGtxSV2ZoMX' . "\r\n"
39 . '9ZwWxzXhl/Q/6k8jg8BoY1QL6L2K76icXJu80b+RDIqvOfJruaAeBg1Q9NyeYqLY' . "\r\n"
40 . 'lEVzN2vIwcFYl+MrP/g6Bc2co7Jcbli+tpNIxg4Z+Hnhbs7OJ3STQLmEryLpAxQO' . "\r\n"
41 . 'q8cbhQkMx+FyQhxzSwtXYI/ClCUmTnzcKk7SgGvEjoKGAmngILiVuEJ4bm7Q1yok' . "\r\n"
42 . 'xl9+wcfW6JAituNhml9dlHCWnn9D3+j8pxStHihKy2gVMwiFRjLEeD8K/7JVGkb/' . "\r\n"
43 . 'EwIDAQAB' . "\r\n"
44 . '-----END PUBLIC KEY-----' . "\r\n"
45 );
46
47 /*
48 * These constants can be set in wp-config.php to ensure sites behind proxies will still work.
49 * Setting these constants, though, is *not* the preferred method. It's better to configure
50 * the proxy to send the X-Forwarded-Port header.
51 */
52 defined( 'JETPACK_SIGNATURE__HTTP_PORT' ) || define( 'JETPACK_SIGNATURE__HTTP_PORT', 80 );
53 defined( 'JETPACK_SIGNATURE__HTTPS_PORT' ) || define( 'JETPACK_SIGNATURE__HTTPS_PORT', 443 );
54
55 /**
56 * Check if the version of WordPress in use on the site is supported by Jetpack.
57 */
58 if ( version_compare( $GLOBALS['wp_version'], JETPACK__MINIMUM_WP_VERSION, '<' ) ) {
59 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
60 error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
61 sprintf(
62 /* translators: Placeholders are numbers, versions of WordPress in use on the site, and required by WordPress. */
63 esc_html__( 'Your version of WordPress (%1$s) is lower than the version required by Jetpack (%2$s). Please update WordPress to continue enjoying Jetpack.', 'jetpack' ),
64 $GLOBALS['wp_version'],
65 JETPACK__MINIMUM_WP_VERSION
66 )
67 );
68 }
69
70 /**
71 * Outputs for an admin notice about running Jetpack on outdated WordPress.
72 *
73 * @since 7.2.0
74 */
75 function jetpack_admin_unsupported_wp_notice() { ?>
76 <div class="notice notice-error is-dismissible">
77 <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>
78 </div>
79 <?php
80 }
81
82 add_action( 'admin_notices', 'jetpack_admin_unsupported_wp_notice' );
83 return;
84 }
85
86 /**
87 * This is where the loading of Jetpack begins.
88 *
89 * First, we try to load our composer autoloader.
90 *
91 * - If it fails, we "pause" Jetpack by ending the loading process
92 * and displaying an admin_notice to inform the site owner.
93 * (We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.)
94 * - If it succeeds, we require load-jetpack.php, where all legacy files are required,
95 * and where we add on to various hooks that we expect to always run.
96 */
97 $jetpack_autoloader = JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
98 if ( is_readable( $jetpack_autoloader ) ) {
99 require $jetpack_autoloader;
100 } else {
101 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
102 error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
103 sprintf(
104 /* translators: Placeholder is a link to a support document. */
105 __( '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' ),
106 'https://github.com/Automattic/jetpack/blob/master/docs/development-environment.md'
107 )
108 );
109 }
110
111 /**
112 * Outputs an admin notice for folks running Jetpack without having run composer install.
113 *
114 * @since 7.4.0
115 */
116 function jetpack_admin_missing_autoloader() {
117 ?>
118 <div class="notice notice-error is-dismissible">
119 <p>
120 <?php
121 printf(
122 wp_kses(
123 /* translators: Placeholder is a link to a support document. */
124 __( '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' ),
125 array(
126 'a' => array(
127 'href' => array(),
128 'target' => array(),
129 'rel' => array(),
130 ),
131 )
132 ),
133 'https://github.com/Automattic/jetpack/blob/master/docs/development-environment.md'
134 );
135 ?>
136 </p>
137 </div>
138 <?php
139 }
140
141 add_action( 'admin_notices', 'jetpack_admin_missing_autoloader' );
142 return;
143 }
144
145 register_activation_hook( __FILE__, array( 'Jetpack', 'plugin_activation' ) );
146 register_deactivation_hook( __FILE__, array( 'Jetpack', 'plugin_deactivation' ) );
147
148 // Require everything else, that is not loaded via the autoloader.
149 require_once JETPACK__PLUGIN_DIR . 'load-jetpack.php';
150