git-svn-id: http://svn.automattic.com/wordpress/trunk@19312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cd33a2118d
commit
8085f7d529
|
@ -143,14 +143,10 @@ function wp_update_plugins() {
|
|||
|
||||
$new_option = new stdClass;
|
||||
$new_option->last_checked = time();
|
||||
|
||||
// Check for updated every 12 hours, 60 minutes, or immediately, depending on the page.
|
||||
$filter = current_filter();
|
||||
if ( 'load-update-core.php' != $filter ) {
|
||||
$timeout = 'load-plugins.php' == $filter || 'load-update.php' == $filter ? 3600 : 43200;
|
||||
// Check for updated every 60 minutes if hitting update pages; else, check every 12 hours.
|
||||
$timeout = in_array( current_filter(), array( 'load-plugins.php', 'load-update.php', 'load-update-core.php' ) ) ? 3600 : 43200;
|
||||
$time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
|
||||
|
||||
if ( $time_not_changed ) {
|
||||
$plugin_changed = false;
|
||||
foreach ( $plugins as $file => $p ) {
|
||||
$new_option->checked[ $file ] = $p['Version'];
|
||||
|
@ -168,11 +164,9 @@ function wp_update_plugins() {
|
|||
}
|
||||
}
|
||||
|
||||
// Bail if we've checked recently and if nothing has changed
|
||||
if ( ! $plugin_changed )
|
||||
// Bail if we've checked in the last 12 hours and if nothing has changed
|
||||
if ( $time_not_changed && !$plugin_changed )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
||||
$current->last_checked = time();
|
||||
|
@ -228,6 +222,10 @@ function wp_update_themes() {
|
|||
if ( ! is_object($last_update) )
|
||||
$last_update = new stdClass;
|
||||
|
||||
// Check for updated every 60 minutes if hitting update pages; else, check every 12 hours.
|
||||
$timeout = in_array( current_filter(), array( 'load-themes.php', 'load-update.php', 'load-update-core.php' ) ) ? 3600 : 43200;
|
||||
$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time( ) - $last_update->last_checked );
|
||||
|
||||
$themes = array();
|
||||
$checked = array();
|
||||
$exclude_fields = array('Template Files', 'Stylesheet Files', 'Status', 'Theme Root', 'Theme Root URI', 'Template Dir', 'Stylesheet Dir', 'Description', 'Tags', 'Screenshot');
|
||||
|
@ -248,13 +246,6 @@ function wp_update_themes() {
|
|||
}
|
||||
}
|
||||
|
||||
// Check for updated every 12 hours, 60 minutes, or immediately, depending on the page.
|
||||
$filter = current_filter();
|
||||
if ( 'load-update-core.php' != $filter ) {
|
||||
$timeout = 'load-themes.php' == $filter || 'load-update.php' == $filter ? 3600 : 43200;
|
||||
$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time( ) - $last_update->last_checked );
|
||||
|
||||
if ( $time_not_changed ) {
|
||||
$theme_changed = false;
|
||||
foreach ( $checked as $slug => $v ) {
|
||||
$update_request->checked[ $slug ] = $v;
|
||||
|
@ -272,11 +263,8 @@ function wp_update_themes() {
|
|||
}
|
||||
}
|
||||
|
||||
// Bail if we've checked recently and if nothing has changed
|
||||
if ( ! $theme_changed )
|
||||
if ( $time_not_changed && !$theme_changed )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
||||
$last_update->last_checked = time();
|
||||
|
|
Loading…
Reference in New Issue