From b11b6f2f2b289607227caf381618bbbb21a76721 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 23 Jun 2014 14:30:14 +0000 Subject: [PATCH] Simplify the code for calculating plugin API check timeout. props leewillis77. fixes #28600. git-svn-id: https://develop.svn.wordpress.org/trunk@28805 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/update.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index e9b1528afa..f79941f97e 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -266,11 +266,9 @@ function wp_update_plugins( $extra_stats = array() ) { if ( defined( 'DOING_CRON' ) && DOING_CRON ) { $timeout = 30; - } elseif ( count( $plugins ) > 10 ) { - // One extra second for every 10 plugins - $timeout = 3 + intval( count( $plugins ) / 10 ); } else { - $timeout = 3; + // Three seconds, plus one extra second for every 10 plugins + $timeout = 3 + intval( count( $plugins ) / 10 ); } $options = array( @@ -423,11 +421,9 @@ function wp_update_themes( $extra_stats = array() ) { if ( defined( 'DOING_CRON' ) && DOING_CRON ) { $timeout = 30; - } elseif ( count( $themes ) > 10 ) { - // One extra second for every 10 themes - $timeout = 3 + intval( count( $themes ) / 10 ); } else { - $timeout = 3; + // Three seconds, plus one extra second for every 10 themes + $timeout = 3 + intval( count( $themes ) / 10 ); } $options = array(