Untitled diff
6 removals
37 lines
16 additions
46 lines
$this->update_count = count($plugins);
$this->update_count = count($plugins);
$this->update_current = 0;
$this->update_current = 0;
foreach ( $plugins as $plugin ) {
foreach ( $plugins as $plugin ) {
$this->update_current++;
$this->update_current++;
$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
//get plugin infos from Wordpress.org API
$plugin_split = explode('/',$plugin);
$plugin_slug = $plugin_split[0];
$args = (object) array( 'slug' => $plugin_slug );
$request = array( 'action' => 'plugin_information', 'timeout' => 15, 'request' => serialize( $args) );
$url = 'http://api.wordpress.org/plugins/info/1.0/';
$response = wp_remote_post( $url, array( 'body' => $request ) );
$plugin_info = unserialize( $response['body'] );
$download_link = $plugin_info->download_link;
if ( !isset( $current->response[ $plugin ] ) ) {
if ( !isset( $download_link ) ) {
$this->skin->set_result(true);
$this->skin->set_result(true);
$this->skin->before();
$this->skin->before();
$this->skin->feedback('up_to_date');
$this->skin->feedback('no_package');
$this->skin->after();
$this->skin->after();
$results[$plugin] = true;
$results[$plugin] = true;
continue;
continue;
}
}
// Get the URL to the zip file
$r = $current->response[ $plugin ];
$this->skin->plugin_active = is_plugin_active($plugin);
$this->skin->plugin_active = is_plugin_active($plugin);
$result = $this->run( array(
$result = $this->run( array(
'package' => $r->package,
'package' => $download_link,
'destination' => WP_PLUGIN_DIR,
'destination' => WP_PLUGIN_DIR,
'clear_destination' => true,
'clear_destination' => true,
'clear_working' => true,
'clear_working' => true,
'is_multi' => true,
'is_multi' => true,
'hook_extra' => array(
'hook_extra' => array(
'plugin' => $plugin
'plugin' => $plugin
)
)
) );
) );
$results[$plugin] = $this->result;
$results[$plugin] = $this->result;
// Prevent credentials auth screen from displaying multiple times
// Prevent credentials auth screen from displaying multiple times
if ( false === $result )
if ( false === $result )
break;
break;
} //end foreach $plugins
} //end foreach $plugins