// Deactivate incompatible plugins.
_upgrade_core_deactivate_incompatible_plugins();
// Upgrade DB with separate request.
/** This filter is documented in wp-admin/includes/update-core.php */
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
) );
// Clear the cache to prevent an update_option() from saving a stale db_version to the cache.
wp_cache_flush();
// Not all cache back ends listen to 'flush'.
wp_cache_delete( 'alloptions', 'options'
);
// Remove working directory.
$wp_filesystem->
delete( $from, true
);
// Force refresh of update information.
if ( function_exists( 'delete_site_transient'
) ) { delete_site_transient( 'update_core'
);
} else { delete_option( 'update_core'
);
}