- update_option( 'update_plugins', $current );
-
- $to_send->plugins = $plugins;
- $to_send->active = $active;
- $send = serialize( $to_send );
- $body = 'plugins=' . urlencode( $send );
-
- $options = array('method' => 'POST', 'timeout' => 3, 'body' => $body);
- $options['headers'] = array(
- 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'),
- 'Content-Length' => strlen($body),
- 'User-Agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
+ set_site_transient( 'update_plugins', $current );
+
+ $to_send = (object) compact('plugins', 'active');
+
+ $options = array(
+ 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
+ 'body' => array( 'plugins' => serialize( $to_send ) ),
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )