Make WordPress Core

Changeset 11586


Ignore:
Timestamp:
06/16/2009 07:37:11 PM (15 years ago)
Author:
ryan
Message:

Plugin install fixes. Props Denis-de-Bernardy. see #10192 for 2.8.1

Location:
branches/2.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/wp-admin/includes/plugin-install.php

    r11541 r11586  
    4747                $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
    4848        }
     49    } elseif ( !is_wp_error($res) ) {
     50        $res->external = true;
    4951    }
    5052
     
    442444            $type = 'install';
    443445            //Check to see if this plugin is known to be installed, and has an update awaiting it.
    444             $update_plugins = get_option('update_plugins');
     446            $update_plugins = get_transient('update_plugins');
    445447            if ( is_object( $update_plugins ) ) {
    446448                foreach ( (array)$update_plugins->response as $file => $plugin ) {
     
    463465                    } else {
    464466                        //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh
    465                         delete_option('update_plugins');
     467                        delete_transient('update_plugins');
    466468                        $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
    467469                        $type = 'update_available';
     
    510512<?php endif; if ( ! empty($api->downloaded) ) : ?>
    511513            <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
    512 <?php endif; if ( ! empty($api->slug) ) : ?>
     514<?php endif; if ( ! empty($api->slug) && empty($api->external) ) : ?>
    513515            <li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page &#187;') ?></a></li>
    514516<?php endif; if ( ! empty($api->homepage) ) : ?>
     
    516518<?php endif; ?>
    517519        </ul>
     520        <?php if ( ! empty($api->rating) ) : ?>
    518521        <h2><?php _e('Average Rating') ?></h2>
    519522        <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
     
    526529        </div>
    527530        <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
     531        <?php endif; ?>
    528532    </div>
    529533    <div id="section-holder" class="wrap">
  • branches/2.8/wp-includes/update.php

    r11424 r11586  
    116116    $new_option = new stdClass;
    117117    $new_option->last_checked = time();
    118     $timeout = 'load-plugins.php' == current_filter() ? 360 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
     118    $timeout = 'load-plugins.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
    119119    $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
    120120
     
    199199    $new_option = new stdClass;
    200200    $new_option->last_checked = time( );
    201     $timeout = 'load-themes.php' == current_filter() ? 360 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
     201    $timeout = 'load-themes.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
    202202    $time_not_changed = isset( $current_theme->last_checked ) && $timeout > ( time( ) - $current_theme->last_checked );
    203203
Note: See TracChangeset for help on using the changeset viewer.