WordPress.org

Make WordPress Core

Changeset 25816


Ignore:
Timestamp:
10/16/13 19:40:02 (3 years ago)
Author:
nacin
Message:

Update the banner for update-core.php that tells users they are set up for security updates to happen in the background.

"This site is set up to install security updates of WordPress automatically. Cool!"

Checkmark is a placeholder; we'll tinker with this further today.

see #22704.

File:
1 edited

Legend:

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

    r25806 r25816  
    139139 */ 
    140140function core_upgrade_preamble() { 
    141     global $wp_version; 
     141    global $wp_version, $required_php_version, $required_mysql_version; 
    142142 
    143143    $updates = get_core_updates(); 
     
    147147        _e('You have the latest version of WordPress.'); 
    148148        echo '</h3>'; 
     149 
     150        if ( wp_http_supports( 'ssl' ) ) { 
     151            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 
     152            $future_minor_update = (object) array( 
     153                'current'       => $wp_version . '.1-update-core.php', 
     154                'version'       => $wp_version . '.1-update-core.php', 
     155                'php_version'   => $required_php_version, 
     156                'mysql_version' => $required_mysql_version, 
     157            ); 
     158            $should_auto_update = WP_Automatic_Upgrader::should_auto_update( 'core', $future_minor_update, ABSPATH ); 
     159            if ( $should_auto_update ) 
     160                echo '<div class="updated inline"><p>&#10004; &nbsp; This site is set up to install security updates of WordPress automatically. Cool!</p></div>'; 
     161        } 
    149162    } else { 
    150163        echo '<div class="updated inline"><p>'; 
     
    157170    } 
    158171 
    159     // This is temporary, for the WordPress 3.7 beta period. 
    160172    if ( isset( $updates[0] ) && $updates[0]->response == 'development' ) { 
    161         require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 
    162         $ssl_support = wp_http_supports( 'ssl' ); 
    163         $should_auto_update = WP_Automatic_Upgrader::should_auto_update( 'core', $updates[0], ABSPATH ); 
    164         if ( $ssl_support && $should_auto_update ) { 
    165             echo '<div class="updated inline"><p><strong>BETA TESTERS: This install will receive daily auto updates to future beta versions.</strong>'; 
    166             if ( get_locale() !== 'en_US' ) 
    167                 echo ' Translations of importers and default themes will also be updated.'; 
    168             echo '</p><p>You will receive an email with debugging output after each update. If something goes wrong, please <a href="http://wordpress.org/support/forum/alphabeta">post in the support forums</a> or <a href="https://core.trac.wordpress.org/">open a bug report</a>.</div>'; 
    169         } elseif ( ! $ssl_support ) { 
    170             echo '<div class="error inline"><p><strong>BETA TESTERS:</strong> Your server does not support HTTP requests over SSL. This install will not receive auto updates.</p></div>'; 
    171         } elseif ( WP_Automatic_Upgrader::is_vcs_checkout( ABSPATH ) ) { 
    172             echo '<div class="error inline"><p><strong>BETA TESTERS:</strong> This install uses version control (SVN or Git) and thus will not receive auto updates. Try a separate install of WordPress with the <a href="http://wordpress.org/plugins/wordpress-beta-tester/">Beta Tester</a> plugin set to bleeding edge.</p></div>'; 
    173         } 
     173        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 
     174        if ( wp_http_supports( 'ssl' ) && WP_Automatic_Upgrader::should_auto_update( 'core', $updates[0], ABSPATH ) ) 
     175            echo '<div class="updated inline"><p><strong>BETA TESTERS:</strong> This site is set up to install updates of future beta versions automatically.</p></div>'; 
    174176    } 
    175177 
Note: See TracChangeset for help on using the changeset viewer.