Changes from trunk/wp-includes/update.php at r8317 to branches/2.6/wp-includes/update.php at r8521
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/wp-includes/update.php
r8317 r8521 91 91 return false; 92 92 93 $current = get_option( 'update_plugins' );94 95 $time_not_changed = isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked );96 97 93 // If running blog-side, bail unless we've not checked in the last 12 hours 98 if ( !function_exists( 'get_plugins' ) ) { 99 if ( $time_not_changed ) 100 return false; 94 if ( !function_exists( 'get_plugins' ) ) 101 95 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 102 }103 96 104 97 $plugins = get_plugins(); 105 98 $active = get_option( 'active_plugins' ); 99 $current = get_option( 'update_plugins' ); 106 100 107 101 $new_option = ''; 108 102 $new_option->last_checked = time(); 103 $time_not_changed = isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ); 109 104 110 105 $plugin_changed = false; … … 119 114 if ( strval($current->checked[ $file ]) !== strval($p['Version']) ) 120 115 $plugin_changed = true; 116 } 117 118 foreach ( (array) $current->response as $plugin_file => $update_details ) { 119 if ( ! isset($plugins[ $plugin_file ]) ) { 120 $plugin_changed = true; 121 } 121 122 } 122 123 … … 155 156 update_option( 'update_plugins', $new_option ); 156 157 } 157 if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) 158 add_action( 'admin_init', 'wp_update_plugins' ); 159 else 160 add_action( 'init', 'wp_update_plugins' ); 158 159 function _maybe_update_plugins() { 160 $current = get_option( 'update_plugins' ); 161 if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) ) 162 return; 163 wp_update_plugins(); 164 } 165 166 add_action( 'load-plugins.php', 'wp_update_plugins' ); 167 add_action( 'admin_init', '_maybe_update_plugins' ); 168 add_action( 'wp_update_plugins', 'wp_update_plugins' ); 169 170 if ( !wp_next_scheduled('wp_update_plugins') ) 171 wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); 161 172 162 173 ?>
Note: See TracChangeset
for help on using the changeset viewer.