From 830ecf4108b5ba81bb6ac7dc718ef151c9831098 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 16 Aug 2009 04:59:38 +0000 Subject: [PATCH] Increase timeout on cron-based requests when checking for upgrades, props dd32, fixes #10349 git-svn-id: https://develop.svn.wordpress.org/trunk@11826 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-cron.php | 2 +- wp-includes/update.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-cron.php b/wp-cron.php index b7fd6f53dc..4f3335b4a9 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -35,7 +35,7 @@ $local_time = time(); if ( isset($keys[0]) && $keys[0] > $local_time ) die(); -foreach ($crons as $timestamp => $cronhooks) { +foreach ($crons as $timestamp => $cronhooks) { if ( $timestamp > $local_time ) break; diff --git a/wp-includes/update.php b/wp-includes/update.php index 933075364b..65bfc91d5f 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -47,7 +47,7 @@ function wp_version_check() { $url = "http://api.wordpress.org/core/version-check/1.3/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; $options = array( - 'timeout' => 3, + 'timeout' => defined('DOING_CRON') && DOING_CRON ? 30 : 3, 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); @@ -146,7 +146,7 @@ function wp_update_plugins() { $to_send = (object)compact('plugins', 'active'); $options = array( - 'timeout' => 3, + 'timeout' => defined('DOING_CRON') && DOING_CRON ? 30 : 3, 'body' => array( 'plugins' => serialize( $to_send ) ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); @@ -240,7 +240,7 @@ function wp_update_themes( ) { $current_theme->template = get_option( 'template' ); $options = array( - 'timeout' => 3, + 'timeout' => defined('DOING_CRON') && DOING_CRON ? 30 : 3, 'body' => array( 'themes' => serialize( $themes ) ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); @@ -306,7 +306,7 @@ function _maybe_update_themes( ) { if( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) ) return; - wp_update_themes( ); + wp_update_themes(); } add_action( 'admin_init', '_maybe_update_core' );