mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Simplify the code for calculating plugin API check timeout.
props leewillis77. fixes #28600. Built from https://develop.svn.wordpress.org/trunk@28805 git-svn-id: http://core.svn.wordpress.org/trunk@28614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ab06b01eb8
commit
2b8460af62
@ -266,11 +266,9 @@ function wp_update_plugins( $extra_stats = array() ) {
|
|||||||
|
|
||||||
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
||||||
$timeout = 30;
|
$timeout = 30;
|
||||||
} elseif ( count( $plugins ) > 10 ) {
|
|
||||||
// One extra second for every 10 plugins
|
|
||||||
$timeout = 3 + intval( count( $plugins ) / 10 );
|
|
||||||
} else {
|
} else {
|
||||||
$timeout = 3;
|
// Three seconds, plus one extra second for every 10 plugins
|
||||||
|
$timeout = 3 + intval( count( $plugins ) / 10 );
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
@ -423,11 +421,9 @@ function wp_update_themes( $extra_stats = array() ) {
|
|||||||
|
|
||||||
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
||||||
$timeout = 30;
|
$timeout = 30;
|
||||||
} elseif ( count( $themes ) > 10 ) {
|
|
||||||
// One extra second for every 10 themes
|
|
||||||
$timeout = 3 + intval( count( $themes ) / 10 );
|
|
||||||
} else {
|
} else {
|
||||||
$timeout = 3;
|
// Three seconds, plus one extra second for every 10 themes
|
||||||
|
$timeout = 3 + intval( count( $themes ) / 10 );
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user