WordPress.org

Make WordPress Core

Changeset 4887


Ignore:
Timestamp:
02/15/07 08:16:43 (7 years ago)
Author:
markjaquith
Message:

Fewer clicks and better user experience for upgrades. fixes #2447

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r4645 r4887  
    55    require_once('../wp-config.php'); 
    66 
    7 if ( get_option('db_version') != $wp_db_version ) 
    8     wp_die(sprintf(__("Your database is out-of-date.  Please <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php')); 
    9      
     7if ( get_option('db_version') != $wp_db_version ) { 
     8    wp_redirect(get_option('siteurl') . '/wp-admin/upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))); 
     9    exit; 
     10} 
     11 
    1012require_once(ABSPATH . 'wp-admin/admin-functions.php'); 
    1113require_once(ABSPATH . 'wp-admin/admin-db.php'); 
  • trunk/wp-admin/upgrade.php

    r4656 r4887  
    99 
    1010if (isset($_GET['step'])) 
    11     $step = $_GET['step']; 
     11    $step = (int) $_GET['step']; 
    1212else 
    1313    $step = 0; 
     
    2626<body> 
    2727<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1> 
    28 <?php 
    29 switch($step) { 
     28 
     29<?php if ( get_option('db_version') == $wp_db_version ) : ?> 
     30 
     31<h2><?php _e('No Upgrade Required'); ?></h2> 
     32<p><?php _e('Your WordPress database is already up-to-date!'); ?></p> 
     33<h2 class="step"><a href="<?php echo get_option('home'); ?>/"><?php _e('Continue &raquo;'); ?></a></h2> 
     34 
     35<?php else : 
     36switch($step) : 
    3037    case 0: 
    3138        $goback = attribute_escape(stripslashes(wp_get_referer())); 
    32 ?>  
    33 <p><?php _e('This file upgrades you from any previous version of WordPress to the latest. It may take a while though, so be patient.'); ?></p>  
     39?> 
     40<h2><?php _e('Database Upgrade Required'); ?></h2> 
     41<p><?php _e('Your WordPress database is out-of-date, and must be upgraded before you can continue.'); ?></p> 
     42<p><?php _e('The upgrade process may take a while, so please be patient.'); ?></p>  
    3443<h2 class="step"><a href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress &raquo;'); ?></a></h2> 
    3544<?php 
     
    3948 
    4049        if ( empty( $_GET['backto'] ) ) 
    41             $backto = __get_option('home'); 
     50            $backto = __get_option('home') . '/'; 
    4251        else 
    4352            $backto = attribute_escape(stripslashes($_GET['backto'])); 
    4453?>  
    45 <h2><?php _e('Step 1'); ?></h2>  
    46     <p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"),  $backto); ?></p> 
     54<h2><?php _e('Upgrade Complete'); ?></h2> 
     55    <p><?php _e('Your WordPress database has been successfully upgraded!'); ?></p> 
     56    <h2 class="step"><a href="<?php echo $backto; ?>"><?php _e('Continue &raquo;'); ?></a></h2> 
    4757 
    4858<!-- 
     
    5666<?php 
    5767        break; 
    58 } 
     68endswitch; 
     69endif; 
    5970?> 
    6071</body> 
Note: See TracChangeset for help on using the changeset viewer.