From be5560de12285188d6af2c602406ed4e5977f0dc Mon Sep 17 00:00:00 2001 From: Daniel Walmsley Date: Thu, 23 May 2019 02:38:56 -0700 Subject: [PATCH] Warn in log if user's WP version is too old for Jetpack (#12341) * Warn in log if user's WP version is too old for Jetpack * Wrap error logging into WP_DEBUG check This should avoid flooding folks' error logs; we'll only log it if Debugging mode is on. See https://github.com/Automattic/jetpack/pull/12341#discussion_r284271003 --- jetpack.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jetpack.php b/jetpack.php index 59bd488681f43..695b37db5211c 100644 --- a/jetpack.php +++ b/jetpack.php @@ -90,6 +90,16 @@ function jetpack_admin_unsupported_wp_notice() { ?> } if ( version_compare( $GLOBALS['wp_version'], JETPACK__MINIMUM_WP_VERSION, '<' ) ) { + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + error_log( + sprintf( + /* translators: Placeholders are numbers, versions of WordPress in use on the site, and required by WordPress. */ + 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' ), + $GLOBALS['wp_version'], + JETPACK__MINIMUM_WP_VERSION + ) + ); + } add_action( 'admin_notices', 'jetpack_admin_unsupported_wp_notice' ); return; }