X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/99a64b9fd0d5ebb21c33c3a0b5865e9c412b430c..5aa86a9053fb0fa15846bb60aac2fb8fdfff524a:/wp-admin/update-core.php diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 85c70a41..c071dc23 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -9,6 +9,10 @@ /** WordPress Administration Bootstrap */ require_once('./admin.php'); +wp_enqueue_style( 'plugin-install' ); +wp_enqueue_script( 'plugin-install' ); +add_thickbox(); + if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'update-core.php' ) ); exit(); @@ -41,7 +45,11 @@ function list_core_update( $update ) { $form_action = 'update-core.php?action=do-core-reinstall'; } else { $php_compat = version_compare( $php_version, $update->php_version, '>=' ); - $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); + if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) + $mysql_compat = true; + else + $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' ); + if ( !$mysql_compat && !$php_compat ) $message = sprintf( __('You cannot update because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ); elseif ( !$php_compat ) @@ -66,7 +74,7 @@ function list_core_update( $update ) { echo ''; if ( $show_buttons ) { if ( $first_pass ) { - submit_button( $submit, 'button button-primary', 'upgrade', false ); + submit_button( $submit, $current ? 'button' : 'primary', 'upgrade', false ); $first_pass = false; } else { submit_button( $submit, 'button', 'upgrade', false ); @@ -123,7 +131,7 @@ function dismissed_updates() { * @return null */ function core_upgrade_preamble() { - global $upgrade_error; + global $upgrade_error, $wp_version; $updates = get_core_updates(); ?> @@ -168,7 +176,12 @@ function core_upgrade_preamble() { echo ''; } echo ''; - echo '

' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '

'; + if ( $updates ) { + echo '

' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '

'; + } else { + list( $normalized_version ) = explode( '-', $wp_version ); + echo '

' . sprintf( __( 'Learn more about WordPress %s.' ), esc_url( admin_url( 'about.php' ) ), $normalized_version ) . '

'; + } dismissed_updates(); if ( current_user_can( 'update_plugins' ) ) @@ -246,10 +259,15 @@ function list_plugin_updates() { } else { $upgrade_notice = ''; } + + $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&TB_iframe=true&width=640&height=662'); + $details_text = sprintf(__('View version %1$s details'), $plugin_data->update->new_version); + $details = sprintf('%3$s.', esc_url($details_url), esc_attr($plugin_data->Name), $details_text); + echo " - {$plugin_data->Name}
" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . " +

{$plugin_data->Name}
" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . ' ' . $details . $compat . $upgrade_notice . "

"; } ?> @@ -299,7 +317,7 @@ function list_theme_updates() { echo " - {$theme_data->Name}" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $theme_data->Version, $theme_data->update['new_version']) . " + {$theme_data->Name}" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $theme_data->Version, $theme_data->update['new_version']) . " "; } ?> @@ -360,11 +378,19 @@ function do_core_upgrade( $reinstall = false ) { show_message($result); if ('up_to_date' != $result->get_error_code() ) show_message( __('Installation Failed') ); - } else { - show_message( __('WordPress updated successfully') ); - show_message( '' . __('Go to Dashboard') . '' ); + echo ''; + return; } - echo ''; + + show_message( __('WordPress updated successfully') ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click here.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. Learn more.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + ?> + + + ' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification. It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '

' . +get_current_screen()->add_help_tab( array( +'id' => 'overview', +'title' => __('Overview'), +'content' => + '

' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification.') . '

' . + '

' . __('It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '

' +) ); + +get_current_screen()->add_help_tab( array( +'id' => 'how-to-update', +'title' => __('How to Update'), +'content' => '

' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '

' . - '

' . __('To update themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '

' . + '

' . __('To update themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '

' +) ); + + +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Updating WordPress') . '

' . '

' . __('Support Forums') . '

'