diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index b0b86166ad..02461acf8c 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -946,10 +946,18 @@ function update_core( $from, $to ) { $wp_filesystem->delete( $from, true ); } + /* translators: %s: Update PHP page URL */ + $php_update_message = '

' . sprintf( __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); + + $annotation = wp_get_update_php_annotation(); + if ( $annotation ) { + $php_update_message .= '

' . $annotation . ''; + } + if ( ! $mysql_compat && ! $php_compat ) { - return new WP_Error( 'php_mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) ); + return new WP_Error( 'php_mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message ); } elseif ( ! $php_compat ) { - return new WP_Error( 'php_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ) ); + return new WP_Error( 'php_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ) . $php_update_message ); } elseif ( ! $mysql_compat ) { return new WP_Error( 'mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ) ); } diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index 4a38eab1cd..8db4817ceb 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -243,12 +243,20 @@ $version_url = sprintf( sanitize_title( $wp_version ) ); +/* translators: %s: Update PHP page URL */ +$php_update_message = '

' . sprintf( __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); + +$annotation = wp_get_update_php_annotation(); +if ( $annotation ) { + $php_update_message .= '

' . $annotation . ''; +} + if ( ! $mysql_compat && ! $php_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */ - $compat = sprintf( __( 'You cannot install because WordPress %2$s requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); + $compat = sprintf( __( 'You cannot install because WordPress %2$s requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */ - $compat = sprintf( __( 'You cannot install because WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ); + $compat = sprintf( __( 'You cannot install because WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */ $compat = sprintf( __( 'You cannot install because WordPress %2$s requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version ); diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index 570703e5d8..cf20226499 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -76,12 +76,20 @@ function list_core_update( $update ) { sanitize_title( $update->current ) ); + /* translators: %s: Update PHP page URL */ + $php_update_message = '

' . sprintf( __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); + + $annotation = wp_get_update_php_annotation(); + if ( $annotation ) { + $php_update_message .= '

' . $annotation . ''; + } + if ( ! $mysql_compat && ! $php_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */ - $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ); + $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */ - $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version ); + $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */ $message = sprintf( __( 'You cannot update because WordPress %2$s requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->mysql_version, $mysql_version ); diff --git a/src/wp-admin/upgrade.php b/src/wp-admin/upgrade.php index 330ef0fd9d..2047c16881 100644 --- a/src/wp-admin/upgrade.php +++ b/src/wp-admin/upgrade.php @@ -85,16 +85,26 @@ elseif ( ! $php_compat || ! $mysql_compat ) : sanitize_title( $wp_version ) ); + /* translators: %s: Update PHP page URL */ + $php_update_message = '

' . sprintf( __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); + + $annotation = wp_get_update_php_annotation(); + if ( $annotation ) { + $php_update_message .= '

' . $annotation . ''; + } + if ( ! $mysql_compat && ! $php_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */ - $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); + $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */ - $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ); + $message = sprintf( __( 'You cannot update because WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */ $message = sprintf( __( 'You cannot update because WordPress %2$s requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version ); } + + echo '

' . $message . '

'; ?>