Make WordPress Core

Ticket #2447: upgrade_rework.diff

File upgrade_rework.diff, 2.5 KB (added by markjaquith, 20 years ago)

Rework the upgrade copy and reduce 3 clicks to 2 clicks

  • wp-admin/admin.php

     
    44else
    55    require_once('../wp-config.php');
    66
    7 if ( get_option('db_version') != $wp_db_version )
    8         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(add_query_arg('_wp_http_referer', $_SERVER['REQUEST_URI'], get_option('siteurl') . '/wp-admin/upgrade.php'));
     9        die();
     10}
     11
    1012require_once(ABSPATH . 'wp-admin/admin-functions.php');
    1113require_once(ABSPATH . 'wp-admin/admin-db.php');
    1214require_once(ABSPATH . WPINC . '/registration.php');
  • wp-admin/upgrade.php

     
    6464<body>
    6565<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
    6666<?php
     67if ( get_option('db_version') != $wp_db_version ) : // upgrade needs to be run
     68
    6769switch($step) {
    6870
    6971        case 0:
    7072        $goback = wp_specialchars(wp_get_referer());
    71 ?>
    72 <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>
     73?>
     74<h2><?php _e('Database Upgrade'); ?></h2>
     75<p><?php _e('Your WordPress database is out-of-date, and must be upgraded before you can continue.'); ?></p>
     76<p><?php _e('Click the "Upgrade WordPress" link to upgrade your WordPress database.  This process may take a while, so please be patient.'); ?></p>
    7377        <h2 class="step"><a href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress &raquo;'); ?></a></h2>
    7478<?php
    7579        break;
     
    8286        else
    8387                $backto = wp_specialchars( $_GET['backto'] , 1 );
    8488?>
    85 <h2><?php _e('Step 1'); ?></h2>
    86         <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>
     89<h2><?php _e('Upgrade Complete'); ?></h2>
     90        <p><?php printf(__("Your WordPress database has been successfully upgraded. <a href='%s'>Have fun</a>!"),  $backto); ?></p>
    8791
    8892<!--
    8993<pre>
     
    96100<?php
    97101        break;
    98102}
    99 ?>
     103
     104else : // upgrade doesn't need to be run ?>
     105        <h2><?php _e('No Upgrade Necessary'); ?></h2>
     106        <p><?php _e('Your WordPress database is already up-to-date.'); ?></p>
     107<?php endif; ?>
    100108</body>
    101 </html>
     109</html>
     110 No newline at end of file