Use transient for update_core, update_plugins, update_themes. see #9048

git-svn-id: https://develop.svn.wordpress.org/trunk@10515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-02-06 18:06:20 +00:00
parent ac427bbdcc
commit 4e52545293
4 changed files with 18 additions and 18 deletions

View File

@@ -254,7 +254,7 @@ function update_core($from, $to) {
$wp_filesystem->delete($from, true);
// Force refresh of update information
delete_option('update_core');
delete_transient('update_core');
// Remove maintenance file, we're done.
$wp_filesystem->delete($maintenance_file);

View File

@@ -33,7 +33,7 @@ function get_core_updates( $options = array() ) {
$options = array_merge( array('available' => true, 'dismissed' => false ), $options );
$dismissed = get_option( 'dismissed_update_core' );
if ( !is_array( $dismissed ) ) $dismissed = array();
$from_api = get_option( 'update_core' );
$from_api = get_transient( 'update_core' );
if ( empty($from_api) )
return false;
if ( !is_array( $from_api->updates ) ) return false;
@@ -71,7 +71,7 @@ function undismiss_core_update( $version, $locale ) {
}
function find_core_update( $version, $locale ) {
$from_api = get_option( 'update_core' );
$from_api = get_transient( 'update_core' );
if ( !is_array( $from_api->updates ) ) return false;
$updates = $from_api->updates;
foreach($updates as $update) {
@@ -146,7 +146,7 @@ function update_right_now_message() {
}
function wp_plugin_update_row( $file, $plugin_data ) {
$current = get_option( 'update_plugins' );
$current = get_transient( 'update_plugins' );
if ( !isset( $current->response[ $file ] ) )
return false;
@@ -173,7 +173,7 @@ function wp_update_plugin($plugin, $feedback = '') {
add_filter('update_feedback', $feedback);
// Is an update available?
$current = get_option( 'update_plugins' );
$current = get_transient( 'update_plugins' );
if ( !isset( $current->response[ $plugin ] ) )
return new WP_Error('up_to_date', __('The plugin is at the latest version.'));
@@ -268,7 +268,7 @@ function wp_update_plugin($plugin, $feedback = '') {
$wp_filesystem->delete($working_dir, true);
// Force refresh of plugin update information
delete_option('update_plugins');
delete_transient('update_plugins');
if( empty($filelist) )
return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.

View File

@@ -58,7 +58,7 @@ $menu[40] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-to
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
$submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php');
$update_plugins = get_option( 'update_plugins' );
$update_plugins = get_transient( 'update_plugins' );
$update_count = 0;
if ( !empty($update_plugins->response) )
$update_count = count( $update_plugins->response );