[wp-trac] [WordPress Trac] #46937: Provide update-php link on WordPress update failure screen

WordPress Trac noreply at wordpress.org
Wed May 8 04:04:20 UTC 2019


#46937: Provide update-php link on WordPress update failure screen
------------------------------------+---------------------
 Reporter:  Hareesh Pillai          |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  5.2.1
Component:  Upgrade/Install         |     Version:  5.2
 Severity:  normal                  |  Resolution:
 Keywords:  servehappy needs-patch  |     Focuses:
------------------------------------+---------------------
Changes (by netweb):

 * keywords:  servehappy => servehappy needs-patch
 * milestone:  Awaiting Review => 5.2.1


Comment:

 The screenshot above is from one of my sites not yet running PHP > 5.6

 Here's the text for copy/paste purposes:

 {{{
 You cannot update because WordPress 5.2 requires PHP version 5.6.20 or
 higher. You are running version 5.5.9-1ubuntu4.27.

 This localised version contains both the translation and various other
 localisation fixes. You can skip upgrading if you want to keep your
 current translation.

 You cannot update because WordPress 5.2 requires PHP version 5.6.20 or
 higher. You are running version 5.5.9-1ubuntu4.27.

 While your site is being updated, it will be in maintenance mode. As soon
 as your updates are complete, your site will return to normal.
 }}}

 The notice is displayed twice I believe because I'm running an #en-au
 localized install.

 Lets include a link to https://wordpress.org/support/update-php/ in that
 notice so that users can access a resource to help guide them to upgrading
 PHP so that they can upgrade WP


 ----

 For a start a quick look reveals the helper `wp_get_update_php_url()`
 function, using that to create a patch to include the localised URL for
 each of the ''PHP upgrade'' messages in:

 {{{#!sh

 src/wp-admin/install.php
 248:    $compat = sprintf( __( 'You cannot install 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, $wp_version, $required_php_version,
 $required_mysql_version, $php_version, $mysql_version );
 251:    $compat = sprintf( __( 'You cannot install because <a
 href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You
 are running version %4$s.' ), $version_url, $wp_version,
 $required_php_version, $php_version );

 src/wp-admin/update-core.php
 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
 );
 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 );

 src/wp-admin/upgrade.php
 90:             $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, $wp_version, $required_php_version,
 $required_mysql_version, $php_version, $mysql_version );
 93:             $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, $wp_version,
 $required_php_version, $php_version );

 src/wp-admin/includes/update-core.php
 950:            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 ) );
 952:            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 ) );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46937#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list