]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/update.php
WordPress 3.7.2
[autoinstalls/wordpress.git] / wp-includes / update.php
1 <?php
2 /**
3  * A simple set of functions to check our version 1.0 update service.
4  *
5  * @package WordPress
6  * @since 2.3.0
7  */
8
9 /**
10  * Check WordPress version against the newest version.
11  *
12  * The WordPress version, PHP version, and Locale is sent. Checks against the
13  * WordPress server at api.wordpress.org server. Will only check if WordPress
14  * isn't installing.
15  *
16  * @package WordPress
17  * @since 2.3.0
18  * @uses $wp_version Used to check against the newest WordPress version.
19  *
20  * @param array $extra_stats Extra statistics to report to the WordPress.org API.
21  * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
22  */
23 function wp_version_check( $extra_stats = array() ) {
24         if ( defined('WP_INSTALLING') )
25                 return;
26
27         global $wpdb, $wp_local_package;
28         include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
29         $php_version = phpversion();
30
31         $current = get_site_transient( 'update_core' );
32         $translations = wp_get_installed_translations( 'core' );
33
34         if ( ! is_object($current) ) {
35                 $current = new stdClass;
36                 $current->updates = array();
37                 $current->version_checked = $wp_version;
38         }
39
40         // Wait 60 seconds between multiple version check requests
41         $timeout = 60;
42         $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
43         if ( $time_not_changed && empty( $extra_stats ) )
44                 return false;
45
46         $locale = get_locale();
47         /**
48          * Filter the locale requested for WordPress core translations.
49          *
50          * @since 2.8.0
51          *
52          * @param string $locale Current locale.
53          */
54         $locale = apply_filters( 'core_version_check_locale', $locale );
55
56         // Update last_checked for current to prevent multiple blocking requests if request hangs
57         $current->last_checked = time();
58         set_site_transient( 'update_core', $current );
59
60         if ( method_exists( $wpdb, 'db_version' ) )
61                 $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version());
62         else
63                 $mysql_version = 'N/A';
64
65         if ( is_multisite() ) {
66                 $user_count = get_user_count();
67                 $num_blogs = get_blog_count();
68                 $wp_install = network_site_url();
69                 $multisite_enabled = 1;
70         } else {
71                 $user_count = count_users();
72                 $user_count = $user_count['total_users'];
73                 $multisite_enabled = 0;
74                 $num_blogs = 1;
75                 $wp_install = home_url( '/' );
76         }
77
78         $query = array(
79                 'version'           => $wp_version,
80                 'php'               => $php_version,
81                 'locale'            => $locale,
82                 'mysql'             => $mysql_version,
83                 'local_package'     => isset( $wp_local_package ) ? $wp_local_package : '',
84                 'blogs'             => $num_blogs,
85                 'users'             => $user_count,
86                 'multisite_enabled' => $multisite_enabled,
87         );
88
89         $post_body = array(
90                 'translations' => json_encode( $translations ),
91         );
92
93         if ( $extra_stats )
94                 $post_body = array_merge( $post_body, $extra_stats );
95
96         $url = $http_url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
97         if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
98                 $url = set_url_scheme( $url, 'https' );
99
100         $options = array(
101                 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ),
102                 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
103                 'headers' => array(
104                         'wp_install' => $wp_install,
105                         'wp_blog' => home_url( '/' )
106                 ),
107                 'body' => $post_body,
108         );
109
110         $response = wp_remote_post( $url, $options );
111         if ( $ssl && is_wp_error( $response ) ) {
112                 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
113                 $response = wp_remote_post( $http_url, $options );
114         }
115
116         if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
117                 return false;
118
119         $body = trim( wp_remote_retrieve_body( $response ) );
120         $body = json_decode( $body, true );
121
122         if ( ! is_array( $body ) || ! isset( $body['offers'] ) )
123                 return false;
124
125         $offers = $body['offers'];
126
127         foreach ( $offers as &$offer ) {
128                 foreach ( $offer as $offer_key => $value ) {
129                         if ( 'packages' == $offer_key )
130                                 $offer['packages'] = (object) array_intersect_key( array_map( 'esc_url', $offer['packages'] ),
131                                         array_fill_keys( array( 'full', 'no_content', 'new_bundled', 'partial', 'rollback' ), '' ) );
132                         elseif ( 'download' == $offer_key )
133                                 $offer['download'] = esc_url( $value );
134                         else
135                                 $offer[ $offer_key ] = esc_html( $value );
136                 }
137                 $offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 'locale',
138                         'packages', 'current', 'version', 'php_version', 'mysql_version', 'new_bundled', 'partial_version', 'notify_email' ), '' ) );
139         }
140
141         $updates = new stdClass();
142         $updates->updates = $offers;
143         $updates->last_checked = time();
144         $updates->version_checked = $wp_version;
145
146         if ( isset( $body['translations'] ) )
147                 $updates->translations = $body['translations'];
148
149         set_site_transient( 'update_core',  $updates);
150 }
151
152 /**
153  * Check plugin versions against the latest versions hosted on WordPress.org.
154  *
155  * The WordPress version, PHP version, and Locale is sent along with a list of
156  * all plugins installed. Checks against the WordPress server at
157  * api.wordpress.org. Will only check if WordPress isn't installing.
158  *
159  * @package WordPress
160  * @since 2.3.0
161  * @uses $wp_version Used to notify the WordPress version.
162  *
163  * @param array $extra_stats Extra statistics to report to the WordPress.org API.
164  * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
165  */
166 function wp_update_plugins( $extra_stats = array() ) {
167         include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
168
169         if ( defined('WP_INSTALLING') )
170                 return false;
171
172         // If running blog-side, bail unless we've not checked in the last 12 hours
173         if ( !function_exists( 'get_plugins' ) )
174                 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
175
176         $plugins = get_plugins();
177         $translations = wp_get_installed_translations( 'plugins' );
178
179         $active  = get_option( 'active_plugins', array() );
180         $current = get_site_transient( 'update_plugins' );
181         if ( ! is_object($current) )
182                 $current = new stdClass;
183
184         $new_option = new stdClass;
185         $new_option->last_checked = time();
186
187         // Check for update on a different schedule, depending on the page.
188         switch ( current_filter() ) {
189                 case 'upgrader_process_complete' :
190                         $timeout = 0;
191                         break;
192                 case 'load-update-core.php' :
193                         $timeout = MINUTE_IN_SECONDS;
194                         break;
195                 case 'load-plugins.php' :
196                 case 'load-update.php' :
197                         $timeout = HOUR_IN_SECONDS;
198                         break;
199                 default :
200                         $timeout = 12 * HOUR_IN_SECONDS;
201         }
202
203         $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
204
205         if ( $time_not_changed && ! $extra_stats ) {
206                 $plugin_changed = false;
207                 foreach ( $plugins as $file => $p ) {
208                         $new_option->checked[ $file ] = $p['Version'];
209
210                         if ( !isset( $current->checked[ $file ] ) || strval($current->checked[ $file ]) !== strval($p['Version']) )
211                                 $plugin_changed = true;
212                 }
213
214                 if ( isset ( $current->response ) && is_array( $current->response ) ) {
215                         foreach ( $current->response as $plugin_file => $update_details ) {
216                                 if ( ! isset($plugins[ $plugin_file ]) ) {
217                                         $plugin_changed = true;
218                                         break;
219                                 }
220                         }
221                 }
222
223                 // Bail if we've checked recently and if nothing has changed
224                 if ( ! $plugin_changed )
225                         return false;
226         }
227
228         // Update last_checked for current to prevent multiple blocking requests if request hangs
229         $current->last_checked = time();
230         set_site_transient( 'update_plugins', $current );
231
232         $to_send = compact( 'plugins', 'active' );
233
234         $locales = array( get_locale() );
235         /**
236          * Filter the locales requested for plugin translations.
237          *
238          * @since 3.7.0
239          *
240          * @param array $locales Plugin locale. Default is current locale of the site.
241          */
242         $locales = apply_filters( 'plugins_update_check_locales', $locales );
243
244         $options = array(
245                 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
246                 'body' => array(
247                         'plugins'      => json_encode( $to_send ),
248                         'translations' => json_encode( $translations ),
249                         'locale'       => json_encode( $locales ),
250                 ),
251                 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
252         );
253
254         if ( $extra_stats ) {
255                 $options['body']['update_stats'] = json_encode( $extra_stats );
256         }
257
258         $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/';
259         if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
260                 $url = set_url_scheme( $url, 'https' );
261
262         $raw_response = wp_remote_post( $url, $options );
263         if ( $ssl && is_wp_error( $raw_response ) ) {
264                 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
265                 $raw_response = wp_remote_post( $http_url, $options );
266         }
267
268         if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
269                 return false;
270
271         $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
272         foreach ( $response['plugins'] as &$plugin ) {
273                 $plugin = (object) $plugin;
274         }
275         unset( $plugin );
276
277         if ( is_array( $response ) ) {
278                 $new_option->response = $response['plugins'];
279                 $new_option->translations = $response['translations'];
280         } else {
281                 $new_option->response = array();
282                 $new_option->translations = array();
283         }
284
285         set_site_transient( 'update_plugins', $new_option );
286 }
287
288 /**
289  * Check theme versions against the latest versions hosted on WordPress.org.
290  *
291  * A list of all themes installed in sent to WP. Checks against the
292  * WordPress server at api.wordpress.org. Will only check if WordPress isn't
293  * installing.
294  *
295  * @package WordPress
296  * @since 2.7.0
297  * @uses $wp_version Used to notify the WordPress version.
298  *
299  * @param array $extra_stats Extra statistics to report to the WordPress.org API.
300  * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
301  */
302 function wp_update_themes( $extra_stats = array() ) {
303         include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
304
305         if ( defined( 'WP_INSTALLING' ) )
306                 return false;
307
308         $installed_themes = wp_get_themes();
309         $translations = wp_get_installed_translations( 'themes' );
310
311         $last_update = get_site_transient( 'update_themes' );
312         if ( ! is_object($last_update) )
313                 $last_update = new stdClass;
314
315         $themes = $checked = $request = array();
316
317         // Put slug of current theme into request.
318         $request['active'] = get_option( 'stylesheet' );
319
320         foreach ( $installed_themes as $theme ) {
321                 $checked[ $theme->get_stylesheet() ] = $theme->get('Version');
322
323                 $themes[ $theme->get_stylesheet() ] = array(
324                         'Name'       => $theme->get('Name'),
325                         'Title'      => $theme->get('Name'),
326                         'Version'    => $theme->get('Version'),
327                         'Author'     => $theme->get('Author'),
328                         'Author URI' => $theme->get('AuthorURI'),
329                         'Template'   => $theme->get_template(),
330                         'Stylesheet' => $theme->get_stylesheet(),
331                 );
332         }
333
334         // Check for update on a different schedule, depending on the page.
335         switch ( current_filter() ) {
336                 case 'upgrader_process_complete' :
337                         $timeout = 0;
338                         break;
339                 case 'load-update-core.php' :
340                         $timeout = MINUTE_IN_SECONDS;
341                         break;
342                 case 'load-themes.php' :
343                 case 'load-update.php' :
344                         $timeout = HOUR_IN_SECONDS;
345                         break;
346                 default :
347                         $timeout = 12 * HOUR_IN_SECONDS;
348         }
349
350         $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked );
351
352         if ( $time_not_changed && ! $extra_stats ) {
353                 $theme_changed = false;
354                 foreach ( $checked as $slug => $v ) {
355                         if ( !isset( $last_update->checked[ $slug ] ) || strval($last_update->checked[ $slug ]) !== strval($v) )
356                                 $theme_changed = true;
357                 }
358
359                 if ( isset ( $last_update->response ) && is_array( $last_update->response ) ) {
360                         foreach ( $last_update->response as $slug => $update_details ) {
361                                 if ( ! isset($checked[ $slug ]) ) {
362                                         $theme_changed = true;
363                                         break;
364                                 }
365                         }
366                 }
367
368                 // Bail if we've checked recently and if nothing has changed
369                 if ( ! $theme_changed )
370                         return false;
371         }
372
373         // Update last_checked for current to prevent multiple blocking requests if request hangs
374         $last_update->last_checked = time();
375         set_site_transient( 'update_themes', $last_update );
376
377         $request['themes'] = $themes;
378
379         $locales = array( get_locale() );
380         /**
381          * Filter the locales requested for theme translations.
382          *
383          * @since 3.7.0
384          *
385          * @param array $locales Theme locale. Default is current locale of the site.
386          */
387         $locales = apply_filters( 'themes_update_check_locales', $locales );
388
389         $options = array(
390                 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
391                 'body' => array(
392                         'themes'       => json_encode( $request ),
393                         'translations' => json_encode( $translations ),
394                         'locale'       => json_encode( $locales ),
395                 ),
396                 'user-agent'    => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
397         );
398
399         if ( $extra_stats ) {
400                 $options['body']['update_stats'] = json_encode( $extra_stats );
401         }
402
403         $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/';
404         if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
405                 $url = set_url_scheme( $url, 'https' );
406
407         $raw_response = wp_remote_post( $url, $options );
408         if ( $ssl && is_wp_error( $raw_response ) ) {
409                 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
410                 $raw_response = wp_remote_post( $http_url, $options );
411         }
412
413         if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
414                 return false;
415
416         $new_update = new stdClass;
417         $new_update->last_checked = time();
418         $new_update->checked = $checked;
419
420         $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
421
422         if ( is_array( $response ) ) {
423                 $new_update->response     = $response['themes'];
424                 $new_update->translations = $response['translations'];
425         }
426
427         set_site_transient( 'update_themes', $new_update );
428 }
429
430 /**
431  * Performs WordPress automatic background updates.
432  *
433  * @since 3.7.0
434  */
435 function wp_maybe_auto_update() {
436         include_once ABSPATH . '/wp-admin/includes/admin.php';
437         include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
438
439         $upgrader = new WP_Automatic_Updater;
440         $upgrader->run();
441 }
442
443 /**
444  * Retrieves a list of all language updates available.
445  *
446  * @since 3.7.0
447  */
448 function wp_get_translation_updates() {
449         $updates = array();
450         $transients = array( 'update_core' => 'core', 'update_plugins' => 'plugin', 'update_themes' => 'theme' );
451         foreach ( $transients as $transient => $type ) {
452
453                 $transient = get_site_transient( $transient );
454                 if ( empty( $transient->translations ) )
455                         continue;
456
457                 foreach ( $transient->translations as $translation ) {
458                         $updates[] = (object) $translation;
459                 }
460         }
461
462         return $updates;
463 }
464
465 /*
466  * Collect counts and UI strings for available updates
467  *
468  * @since 3.3.0
469  *
470  * @return array
471  */
472 function wp_get_update_data() {
473         $counts = array( 'plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0 );
474
475         if ( $plugins = current_user_can( 'update_plugins' ) ) {
476                 $update_plugins = get_site_transient( 'update_plugins' );
477                 if ( ! empty( $update_plugins->response ) )
478                         $counts['plugins'] = count( $update_plugins->response );
479         }
480
481         if ( $themes = current_user_can( 'update_themes' ) ) {
482                 $update_themes = get_site_transient( 'update_themes' );
483                 if ( ! empty( $update_themes->response ) )
484                         $counts['themes'] = count( $update_themes->response );
485         }
486
487         if ( ( $core = current_user_can( 'update_core' ) ) && function_exists( 'get_core_updates' ) ) {
488                 $update_wordpress = get_core_updates( array('dismissed' => false) );
489                 if ( ! empty( $update_wordpress ) && ! in_array( $update_wordpress[0]->response, array('development', 'latest') ) && current_user_can('update_core') )
490                         $counts['wordpress'] = 1;
491         }
492
493         if ( ( $core || $plugins || $themes ) && wp_get_translation_updates() )
494                 $counts['translations'] = 1;
495
496         $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
497         $titles = array();
498         if ( $counts['wordpress'] )
499                 $titles['wordpress'] = sprintf( __( '%d WordPress Update'), $counts['wordpress'] );
500         if ( $counts['plugins'] )
501                 $titles['plugins'] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $counts['plugins'] ), $counts['plugins'] );
502         if ( $counts['themes'] )
503                 $titles['themes'] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $counts['themes'] ), $counts['themes'] );
504         if ( $counts['translations'] )
505                 $titles['translations'] = __( 'Translation Updates' );
506
507         $update_title = $titles ? esc_attr( implode( ', ', $titles ) ) : '';
508
509         $update_data = array( 'counts' => $counts, 'title' => $update_title );
510         /**
511          * Filter the returned array of update data for plugins, themes, and WordPress core.
512          *
513          * @since 3.5.0
514          *
515          * @param array $update_data {
516          *     Fetched update data.
517          *
518          *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
519          *     @type string  $update_title Titles of available updates.
520          * }
521          * @param array $titles An array of update counts and UI strings for available updates.
522          */
523         return apply_filters( 'wp_get_update_data', $update_data, $titles );
524 }
525
526 function _maybe_update_core() {
527         include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
528
529         $current = get_site_transient( 'update_core' );
530
531         if ( isset( $current->last_checked ) &&
532                 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) &&
533                 isset( $current->version_checked ) &&
534                 $current->version_checked == $wp_version )
535                 return;
536
537         wp_version_check();
538 }
539 /**
540  * Check the last time plugins were run before checking plugin versions.
541  *
542  * This might have been backported to WordPress 2.6.1 for performance reasons.
543  * This is used for the wp-admin to check only so often instead of every page
544  * load.
545  *
546  * @since 2.7.0
547  * @access private
548  */
549 function _maybe_update_plugins() {
550         $current = get_site_transient( 'update_plugins' );
551         if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
552                 return;
553         wp_update_plugins();
554 }
555
556 /**
557  * Check themes versions only after a duration of time.
558  *
559  * This is for performance reasons to make sure that on the theme version
560  * checker is not run on every page load.
561  *
562  * @since 2.7.0
563  * @access private
564  */
565 function _maybe_update_themes() {
566         $current = get_site_transient( 'update_themes' );
567         if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
568                 return;
569
570         wp_update_themes();
571 }
572
573 /**
574  * Schedule core, theme, and plugin update checks.
575  *
576  * @since 3.1.0
577  */
578 function wp_schedule_update_checks() {
579         if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') )
580                 wp_schedule_event(time(), 'twicedaily', 'wp_version_check');
581
582         if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') )
583                 wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins');
584
585         if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
586                 wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
587
588         if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! defined( 'WP_INSTALLING' ) ) {
589                 // Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site.
590                 $next = strtotime( 'today 7am' );
591                 $now = time();
592                 // Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now.
593                 while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) {
594                         $next += 12 * HOUR_IN_SECONDS;
595                 }
596                 $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
597                 // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour
598                 $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS;
599                 wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' );
600         }
601 }
602
603 if ( ( ! is_main_site() && ! is_network_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )
604         return;
605
606 add_action( 'admin_init', '_maybe_update_core' );
607 add_action( 'wp_version_check', 'wp_version_check' );
608 add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
609
610 add_action( 'load-plugins.php', 'wp_update_plugins' );
611 add_action( 'load-update.php', 'wp_update_plugins' );
612 add_action( 'load-update-core.php', 'wp_update_plugins' );
613 add_action( 'admin_init', '_maybe_update_plugins' );
614 add_action( 'wp_update_plugins', 'wp_update_plugins' );
615 add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
616
617 add_action( 'load-themes.php', 'wp_update_themes' );
618 add_action( 'load-update.php', 'wp_update_themes' );
619 add_action( 'load-update-core.php', 'wp_update_themes' );
620 add_action( 'admin_init', '_maybe_update_themes' );
621 add_action( 'wp_update_themes', 'wp_update_themes' );
622 add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
623
624 add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
625
626 add_action('init', 'wp_schedule_update_checks');