Make WordPress Core


Ignore:
Timestamp:
05/17/2019 06:10:55 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Improve error messages displayed when WordPress update fails due to an incompatible PHP version by linking to the Update PHP support page.

Additionally, fix a regression in [44451] where the error message in wp-admin/upgrade.php was prepared, but never displayed.

Props afragen, netweb, hareesh-pillai, SergeyBiryukov.
Fixes #46937.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r45192 r45357  
    7777            );
    7878
     79            /* translators: %s: Update PHP page URL */
     80            $php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
     81
     82            $annotation = wp_get_update_php_annotation();
     83            if ( $annotation ) {
     84                $php_update_message .= '</p><p><em>' . $annotation . '</em>';
     85            }
     86
    7987            if ( ! $mysql_compat && ! $php_compat ) {
    8088                /* 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 */
    81                 $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> 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 );
     89                $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> 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;
    8290            } elseif ( ! $php_compat ) {
    8391                /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
    84                 $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version );
     92                $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> 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;
    8593            } elseif ( ! $mysql_compat ) {
    8694                /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
Note: See TracChangeset for help on using the changeset viewer.