Make WordPress Core

Ticket #51742: 51742.15.diff

File 51742.15.diff, 4.6 KB (added by helen, 4 years ago)
  • src/wp-admin/update-core.php

     
    6262        $show_buttons  = true;
    6363
    6464        if ( 'development' === $update->response ) {
    65                 $message = __( 'You are using a development version of WordPress. You can update to the latest nightly build manually:' );
     65                $message = __( 'You can update to the latest nightly build manually:' );
    6666        } else {
    6767                if ( $current ) {
    6868                        /* translators: %s: WordPress version. */
     
    232232        $wp_version = get_bloginfo( 'version' );
    233233        $updates    = get_core_updates();
    234234
    235         if ( ! isset( $updates[0]->response ) || 'latest' === $updates[0]->response ) {
    236                 echo '<h2>';
    237                 _e( 'You have the latest version of WordPress.' );
    238 
    239                 if ( wp_http_supports( array( 'ssl' ) ) ) {
    240                         require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    241                         $upgrader            = new WP_Automatic_Updater;
    242                         $future_minor_update = (object) array(
    243                                 'current'       => $wp_version . '.1.next.minor',
    244                                 'version'       => $wp_version . '.1.next.minor',
    245                                 'php_version'   => $required_php_version,
    246                                 'mysql_version' => $required_mysql_version,
    247                         );
    248                         $should_auto_update  = $upgrader->should_update( 'core', $future_minor_update, ABSPATH );
    249                         if ( $should_auto_update ) {
    250                                 echo ' ' . __( 'Future security updates will be applied automatically.' );
    251                         }
    252                 }
    253                 echo '</h2>';
    254         }
    255 
    256         if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {
     235        if ( isset( $updates[0] ) && isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {
    257236                echo '<h2 class="response">';
    258237                _e( 'An updated version of WordPress is available.' );
    259238                echo '</h2>';
     
    266245                        __( 'https://wordpress.org/support/article/updating-wordpress/' )
    267246                );
    268247                echo '</p></div>';
     248        } elseif ( isset( $updates[0] ) && 'development' === $updates[0]->response ) {
     249                echo '<h2 class="response">' . __( 'You are using a development version of WordPress.' ) . '</h2>';
     250        } else {
     251                echo '<h2 class="response">' . __( 'You have the latest version of WordPress.' ) . '</h2>';
    269252        }
    270253
    271         if ( isset( $updates[0] ) && 'development' === $updates[0]->response ) {
    272                 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    273                 $upgrader = new WP_Automatic_Updater;
    274                 if ( wp_http_supports( 'ssl' ) && $upgrader->should_update( 'core', $updates[0], ABSPATH ) ) {
    275                         echo '<div class="updated inline"><p>';
    276                         echo '<strong>' . __( 'BETA TESTERS:' ) . '</strong> ' . __( 'This site is set up to install updates of future beta versions automatically.' );
    277                         echo '</p></div>';
    278                 }
    279         }
    280 
    281254        echo '<ul class="core-updates">';
    282255        foreach ( (array) $updates as $update ) {
    283256                echo '<li>';
     
    395368
    396369        <p class="auto-update-status">
    397370                <?php
    398                 if ( $upgrade_major ) {
     371                require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     372                $updater = new WP_Automatic_Updater();
     373                if ( $updater->is_vcs_checkout( ABSPATH ) ) {
     374                        _e( 'This site appears to be under version control. Automatic updates are disabled.' );
     375                } elseif ( $upgrade_major ) {
    399376                        _e( 'This site is automatically kept up to date with each new version of WordPress.' );
    400377
    401378                        if ( $can_set_update_option ) {
    402379                                echo '<br>';
    403380                                printf(
    404                                         '<a href="%s">%s</a>',
     381                                        '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-disable">%s</a>',
    405382                                        wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ),
    406383                                        __( 'Switch to automatic updates for maintenance and security releases only.' )
    407384                                );
    408385                        }
    409386                } elseif ( $upgrade_minor ) {
    410                         _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress.' );
     387                        _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress only.' );
    411388
    412389                        if ( $can_set_update_option ) {
    413390                                echo '<br>';
    414391                                printf(
    415                                         '<a href="%s">%s</a>',
     392                                        '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-enable">%s</a>',
    416393                                        wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ),
    417394                                        __( 'Enable automatic updates for all new versions of WordPress.' )
    418395                                );
  • src/wp-includes/functions.php

     
    11861186                'activated',
    11871187                'admin_email_remind_later',
    11881188                'approved',
     1189                'core-major-auto-updates-saved',
    11891190                'deactivate',
    11901191                'delete_count',
    11911192                'deleted',