diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 7cb975da1f..e4e47f9d9e 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -199,17 +199,11 @@ function update_core($from, $to) { return $result; } - // Might have to do upgrade in a separate step. + // Upgrade DB with separate request apply_filters('update_feedback', __('Upgrading database')); $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db'); wp_remote_post($db_upgrade_url, array('timeout' => 60)); - // Remove working directory - $wp_filesystem->delete($from, true); - - // Remove maintenance file, we're done. - $wp_filesystem->delete($maintenance_file); - // Remove old files foreach ( $_old_files as $old_file ) { $old_file = $to . $old_file; @@ -218,8 +212,14 @@ function update_core($from, $to) { $wp_filesystem->delete($old_file, true); } + // Remove working directory + $wp_filesystem->delete($from, true); + // Force refresh of update information delete_option('update_core'); + + // Remove maintenance file, we're done. + $wp_filesystem->delete($maintenance_file); } ?> \ No newline at end of file diff --git a/wp-settings.php b/wp-settings.php index 4ce8437e13..e703202fb4 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -107,7 +107,7 @@ if ( version_compare( '4.3', phpversion(), '>' ) ) { if ( !defined('WP_CONTENT_DIR') ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down -if ( file_exists(ABSPATH . '.maintenance') ) { +if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) { if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { require_once( WP_CONTENT_DIR . '/maintenance.php' ); die(); @@ -445,7 +445,7 @@ if (get_option('hack_file')) { require(ABSPATH . 'my-hacks.php'); } -if ( get_option('active_plugins') ) { +if ( get_option('active_plugins') && !defined('WP_INSTALLING') ) { $current_plugins = get_option('active_plugins'); if ( is_array($current_plugins) ) { foreach ($current_plugins as $plugin) {