Skip to content

Commit

Permalink
Warn in log if user's WP version is too old for Jetpack (#12341)
Browse files Browse the repository at this point in the history
* 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 #12341 (comment)
  • Loading branch information
gravityrail authored and jeherve committed May 23, 2019
1 parent 8457915 commit be5560d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit be5560d

Please sign in to comment.