diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 8df6150356..b2f7c7d711 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1001,6 +1001,19 @@ function update_core( $from, $to ) { ); } + // Add a warning when the JSON Extension is missing. + if ( ! extension_loaded( 'json' ) ) { + return new WP_Error( + 'php_not_compatible', + sprintf( + /* translators: 1: WordPress version number, 2: The PHP Extension name needed. */ + __( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP Extension.' ), + $wp_version, + 'JSON' + ) + ); + } + /** This filter is documented in wp-admin/includes/update-core.php */ apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) );