X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9c40b4d36daed9e28e48a5fe9205c32557195a4b..4f4e083f6f77639c41e2b1ddb200de8e34301cee:/wp-admin/includes/plugin-install.php?ds=inline diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index bcd9e1b2..f81ecc82 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() {
  • tested ?>
  • downloaded) ) : ?>
  • downloaded), number_format_i18n($api->downloaded)) ?>
  • -slug) ) : ?> +slug) && empty($api->external) ) : ?>
  • homepage) ) : ?>
  • + rating) ) : ?>

    @@ -525,6 +528,7 @@ function install_plugin_information() {
    <?php _e('1 star') ?>
    num_ratings), number_format_i18n($api->num_ratings)); ?> +