From ee8330e98bf28d851d81f1a52241be50ccdb67cc Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Thu, 16 May 2019 17:47:57 +0200 Subject: [PATCH 1/3] General: require PHP 5.3+ to be able to run Jetpack. If a site runs WP 5.1 (where the PHP requirements are still PHP 5.2) and updates Jetpack: 1. We pause Jetpack (stop loading it). 2. We display an admin notice inviting folks to update PHP. 3. If WP_DEBUG is on, we log an error. --- jetpack.php | 39 +++++++++++++++++++++++++++++++++++++++ readme.txt | 1 + 2 files changed, 40 insertions(+) diff --git a/jetpack.php b/jetpack.php index 70ce85479d1ab..edb4264302dcf 100644 --- a/jetpack.php +++ b/jetpack.php @@ -13,6 +13,7 @@ */ define( 'JETPACK__MINIMUM_WP_VERSION', '5.1' ); +define( 'JETPACK__MINIMUM_PHP_VERSION', '5.3' ); define( 'JETPACK__VERSION', '7.4-alpha' ); define( 'JETPACK_MASTER_USER', true ); @@ -93,6 +94,44 @@ function jetpack_admin_unsupported_wp_notice() { ?> return; } +/** + * Outputs an admin notice for folks running an outdated version of PHP. + * + * @since 7.4.0 + */ +function jetpack_admin_unsupported_php_notice() { ?> +
+

+

+ %2$s %3$s', + esc_url( wp_get_update_php_url() ), + __( 'Learn more about updating PHP' ), + /* translators: accessibility text */ + __( '(opens in a new tab)' ) + ); + ?> +

+
+ Date: Thu, 16 May 2019 18:08:52 +0200 Subject: [PATCH 2/3] Add comment to remind us to remove code once WP 5.2 is the min v. --- jetpack.php | 1 + 1 file changed, 1 insertion(+) diff --git a/jetpack.php b/jetpack.php index edb4264302dcf..f2db9c1adfcf4 100644 --- a/jetpack.php +++ b/jetpack.php @@ -96,6 +96,7 @@ function jetpack_admin_unsupported_wp_notice() { ?> /** * Outputs an admin notice for folks running an outdated version of PHP. + * @todo: Remove once WP 5.2 is the minimum version. * * @since 7.4.0 */ From 29e5f5136adfe6f8497d6c0e458302aca3ce6eb8 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Thu, 16 May 2019 18:23:57 +0200 Subject: [PATCH 3/3] Removing PHP 5.2 testing since Jetpack does not support it anymore --- .travis.yml | 6 ------ tests/setup-travis.sh | 6 ------ 2 files changed, 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2661dea0e7f5..f2b855bcaae6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,12 +29,6 @@ env: # so it doesn't need to be re-defined below. matrix: include: - # The versions listed below run within Precise distro with PHP 5.2 due to Travis limitation - # Hard-coding the versions since WP 5.2 has a PHP 5.6 minimum support. - # When removing this, remove corresponding setup functions in setup-travis.sh. - - php: "5.2" - env: WP_MODE=single WP_BRANCH=5.1 - dist: precise - if: branch !~ /(^branch-.*-built)/ language: node_js env: WP_TRAVISCI="yarn lint" diff --git a/tests/setup-travis.sh b/tests/setup-travis.sh index 4abcbb6d878f5..d2cfde93145c1 100755 --- a/tests/setup-travis.sh +++ b/tests/setup-travis.sh @@ -30,12 +30,6 @@ latest) previous) git clone --depth=1 --branch $(php ./tests/get-wp-version.php --previous) git://develop.git.wordpress.org/ /tmp/wordpress-previous ;; -5.0) - git clone --depth=1 --branch 5.0 git://develop.git.wordpress.org/ /tmp/wordpress-5.0 - ;; -5.1) - git clone --depth=1 --branch 5.1 git://develop.git.wordpress.org/ /tmp/wordpress-5.1 - ;; esac clone_exit_code=$?