Skip to content

Commit 50b080c

Browse files
jehervekraftbj
authored andcommitted
General: updated minimum required WP version to run Jetpack (#13620)
* General: update minimum supported WP version to WP -1 * Remove PHP version check. We don't need it anymore since Jetpack's requirements match WordPress'.
1 parent e7b3d49 commit 50b080c

File tree

3 files changed

+9
-57
lines changed

3 files changed

+9
-57
lines changed

.phpcs.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<ruleset name="Jetpack">
3-
<config name="minimum_supported_wp_version" value="5.1" />
3+
<config name="minimum_supported_wp_version" value="5.2" />
44
<config name="testVersion" value="5.6-"/>
55

66
<rule ref="PHPCompatibilityWP"/>

jetpack.php

+7-55
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package Jetpack
1414
*/
1515

16-
define( 'JETPACK__MINIMUM_WP_VERSION', '5.1' );
16+
define( 'JETPACK__MINIMUM_WP_VERSION', '5.2' );
1717
define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
1818
define( 'JETPACK__VERSION', '8.0-alpha' );
1919
define( 'JETPACK_MASTER_USER', true );
@@ -83,61 +83,13 @@ function jetpack_admin_unsupported_wp_notice() { ?>
8383
/**
8484
* This is where the loading of Jetpack begins.
8585
*
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.
86+
* First, we try to load our composer autoloader.
8887
*
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.
93-
*/
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-
);
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.
88+
* - If it fails, we "pause" Jetpack by ending the loading process
89+
* and displaying an admin_notice to inform the site owner.
90+
* (We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.)
91+
* - If it succeeds, we require load-jetpack.php, where all legacy files are required,
92+
* and where we add on to various hooks that we expect to always run.
14193
*/
14294
$jetpack_autoloader = JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
14395
if ( is_readable( $jetpack_autoloader ) ) {

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: automattic, adamkheckler, aduth, akirk, allendav, alternatekev, andy, annezazu, apeatling, azaozz, batmoo, barry, beaulebens, blobaugh, cainm, cena, cfinke, chaselivingston, chellycat, clickysteve, csonnek, danielbachhuber, davoraltman, daniloercoli, designsimply, dllh, drawmyface, dsmart, dzver, ebinnion, egregor, eliorivero, enej, eoigal, erania-pinnera, ethitter, gcorne, georgestephanis, gibrown, goldsounds, hew, hugobaeta, hypertextranch, iammattthomas, iandunn, jblz, jasmussen, jeffgolenski, jeherve, jenhooks, jenia, jessefriedman, jgs, jkudish, jmdodd, joanrho, johnjamesjacoby, jshreve, kbrownkd, keoshi, koke, kraftbj, lancewillett, lschuyler, macmanx, martinremy, matt, matveb, mattwiebe, maverick3x6, mcsf, mdawaffe, MichaelArestad, migueluy, mikeyarce, mkaz, nancythanki, nickmomrik, obenland, oskosk, pento, professor44, rachelsquirrel, rdcoll, ryancowles, richardmuscat, richardmtl, roccotripaldi, samhotchkiss, scarstocea, sdquirk, stephdau, tmoorewp, tyxla, Viper007Bond, westi, yoavf, zinigor
33
Tags: Jetpack, WordPress.com, backup, security, related posts, CDN, speed, anti-spam, social sharing, SEO, video, stats
44
Stable tag: 7.8
5-
Requires at least: 5.1
5+
Requires at least: 5.2
66
Requires PHP: 5.6
77
Tested up to: 5.3
88

0 commit comments

Comments
 (0)