diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index bcd9e1b2a..f81ecc82d 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -46,6 +46,8 @@ function plugins_api($action, $args = null) { if ( ! $res ) $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']); } + } elseif ( !is_wp_error($res) ) { + $res->external = true; } return apply_filters('plugins_api_result', $res, $action, $args); @@ -441,7 +443,7 @@ function install_plugin_information() { //Default to a "new" plugin $type = 'install'; //Check to see if this plugin is known to be installed, and has an update awaiting it. - $update_plugins = get_option('update_plugins'); + $update_plugins = get_transient('update_plugins'); if ( is_object( $update_plugins ) ) { foreach ( (array)$update_plugins->response as $file => $plugin ) { if ( $plugin->slug === $api->slug ) { @@ -462,7 +464,7 @@ function install_plugin_information() { $newer_version = $installed_plugin[ $key ]['Version']; } else { //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh - delete_option('update_plugins'); + delete_transient('update_plugins'); $update_file = $api->slug . '/' . $key; //This code branch only deals with a plugin which is in a folder the same name as its slug, Doesnt support plugins which have 'non-standard' names $type = 'update_available'; } @@ -509,12 +511,13 @@ function install_plugin_information() {