Make WordPress Core

Ticket #41191: 41191.11.2.diff

File 41191.11.2.diff, 4.8 KB (added by johnjamesjacoby, 6 years ago)

Simplified

  • src/wp-admin/css/dashboard.css

     
    11171117}
    11181118
    11191119/* PHP Nag */
    1120 #dashboard_php_nag h2.hndle {
    1121         border-left: 4px solid #dc3232;
    1122 }
    11231120
    1124 #dashboard_php_nag h3 {
    1125         font-weight: 600;
     1121#dashboard_php_nag .dashicons-external {
     1122        margin: -2px -3px 0 0;
    11261123}
    11271124
    1128 #dashboard_php_nag .button.button-hero {
    1129         display: block;
    1130         text-align: center;
    1131 }
    1132 
    11331125/* =Media Queries
    11341126-------------------------------------------------------------- */
    11351127
  • src/wp-admin/includes/dashboard.php

     
    16181617                return;
    16191618        }
    16201619
    1621         $information_url = _x( 'https://wordpress.org/support/upgrade-php/', 'localized PHP upgrade information page' );
    1622 
    1623         if ( ! $response['is_secure'] ) {
    1624                 $msg = __( 'WordPress has detected that your site is running on an insecure version of PHP, which is why we’re showing you this notice.' );
     1620        if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
     1621                $msg = __( 'Your site is running an insecure version of PHP. Please update immediately.' );
    16251622        } else {
    1626                 $msg = __( 'WordPress has detected that your site is running on an outdated version of PHP, which is why we’re showing you this notice.' );
     1623                $msg = __( 'Your site is running a version of PHP that is no longer supported.' );
    16271624        }
    16281625
    16291626        ?>
    16301627        <p><?php echo $msg; ?></p>
     1628        <p><?php printf( __( 'You are running %s, but %s is recommended.' ), '<strong>' . phpversion() . '</strong>', '<strong>' . $response['recommended_version'] . '</strong>' ); ?></p>
    16311629
    1632         <h3><?php _e( 'What is PHP and why should I care?' ); ?></h3>
    1633         <p><?php _e( 'PHP is the programming language that WordPress is built on. Newer versions of PHP are both faster and more secure, so upgrading is better for your site, and better for the people who are building WordPress.' ); ?></p>
    1634         <p><?php _e( 'If you want to know exactly how PHP works and why it is important, continue reading.' ); ?></p>
     1630        <hr />
     1631        <p><?php _e( 'Current versions of PHP are faster and more secure.' ); ?></p>
     1632        <p><?php _e( 'Updating will make your WordPress experience safer and more enjoyable, and it can usually be done in just a few minutes.' ); ?></p>
    16351633
    1636         <h3><?php _e( 'How can I upgrade my PHP version?' ); ?></h3>
    1637         <p><?php _e( 'The button below will take you to a page with more details on what PHP is, how to upgrade your PHP version, and what to do if it turns out you can&#8217;t.' ); ?></p>
    1638         <p>
    1639                 <a class="button button-primary button-hero" href="<?php echo esc_url( $information_url ); ?>"><?php _e( 'Show me how to upgrade my PHP' ); ?></a>
     1634        <p class="button-container">
     1635                <?php
     1636                        printf(
     1637                                '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
     1638                                esc_url( _x( 'https://wordpress.org/support/upgrade-php/', 'localized PHP upgrade information page' ) ),
     1639                                __( 'Learn more' ),
     1640                                /* translators: accessibility text */
     1641                                __( '(opens in a new tab)' )
     1642                        );
     1643                ?>
    16401644        </p>
    1641 
    1642         <p><?php _e( 'Upgrading usually takes only a few minutes and should be safe if you follow the provided instructions.' ); ?></p>
    16431645        <?php
    16441646}
    16451647
     
    16481650 *
    16491651 * @since 5.0.0
    16501652 *
    1651  * @return array Array of PHP version data.
     1653 * @return array|false $response Array of PHP version data. False on failure.
    16521654 */
    16531655function wp_check_php_version() {
    16541656        $version = phpversion();
    1655         $key     = md5( $version );
    16561657
     1658        if ( false === $version ) {
     1659                return false;
     1660        }
     1661
     1662        $key = md5( $version );
     1663
    16571664        $response = get_site_transient( 'php_check_' . $key );
    16581665        if ( false === $response ) {
    16591666                $url = 'http://api.wordpress.org/core/serve-happy/1.0/';
     
    16651672
    16661673                $response = wp_remote_get( $url );
    16671674
    1668                 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
     1675                if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
    16691676                        return false;
    16701677                }
    16711678
    16721679                /**
    16731680                 * Response should be an array with:
    1674                  *  'recommended_version' - string - The PHP version recommended by WordPress
    1675                  *  'is_supported' - boolean - Whether the PHP version is actively supported
    1676                  *  'is_secure' - boolean - Whether the PHP version receives security updates
    1677                  *  'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress
     1681                 *  'recommended_version' - string - The PHP version recommended by WordPress.
     1682                 *  'is_supported' - boolean - Whether the PHP version is actively supported.
     1683                 *  'is_secure' - boolean - Whether the PHP version receives security updates.
     1684                 *  'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress.
    16781685                 */
    16791686                $response = json_decode( wp_remote_retrieve_body( $response ), true );
    16801687