<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[32635] trunk/src/wp-includes/update.php: Add missing doc blocks to `update.php`:</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32635">32635</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32635","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-28 15:28:10 +0000 (Thu, 28 May 2015)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Add missing doc blocks to `update.php`:
* `wp_version_check()`, `wp_update_plugins()`, and `wp_update_themes()` do not return meaningful responses, and their responses are never handled by core. As such, they shouldn't alternately return `void` or `false`. "Returning" in those functions is just "bailing"
* In the same functions, `version.php` doesn't need to load if `WP_INSTALLING` is defined - the function will immediately bail, the values will never be read, and the globals won't be reset. I have unified the approach in all 3 functions.
* When returning filtered `$locale`, there is no need to set the variable twice.
* In `_maybe_update_core()`, `isset()` can take multiple values to bail before the call to `time()`, if necessary. This is a micro-optimization to prevent PHP from hitting the OS unnecessarily.

See <a href="https://core.trac.wordpress.org/ticket/32444">#32444</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesupdatephp">trunk/src/wp-includes/update.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesupdatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/update.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/update.php  2015-05-28 06:37:44 UTC (rev 32634)
+++ trunk/src/wp-includes/update.php    2015-05-28 15:28:10 UTC (rev 32635)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,18 +14,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * isn't installing.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 2.3.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @uses $wp_version Used to check against the newest WordPress version.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global string $wp_version Used to check against the newest WordPress version.
+ * @global wpdb   $wpdb
+ * @global string $wp_local_package
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @param array $extra_stats Extra statistics to report to the WordPress.org API.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $force_check Whether to bypass the transient cache and force a fresh update check. Defaults to false, true if $extra_stats is set.
- * @return null|false Returns null if update is unsupported. Returns false if check is too soon.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool  $force_check Whether to bypass the transient cache and force a fresh update check. Defaults to false, true if $extra_stats is set.
</ins><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_version_check( $extra_stats = array(), $force_check = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( defined('WP_INSTALLING') )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( defined( 'WP_INSTALLING' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 return;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        global $wpdb, $wp_local_package;
-       include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wp_version, $wpdb, $wp_local_package;
+       // include an unmodified $wp_version
+       include( ABSPATH . WPINC . '/version.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">         $php_version = phpversion();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $current = get_site_transient( 'update_core' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,10 +50,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        // Wait 60 seconds between multiple version check requests
</span><span class="cx" style="display: block; padding: 0 10px">        $timeout = 60;
</span><span class="cx" style="display: block; padding: 0 10px">        $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! $force_check && $time_not_changed )
-               return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $force_check && $time_not_changed ) {
+               return;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $locale = get_locale();
</del><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Filter the locale requested for WordPress core translations.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $locale Current locale.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $locale = apply_filters( 'core_version_check_locale', $locale );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locale = apply_filters( 'core_version_check_locale', get_locale() );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Update last_checked for current to prevent multiple blocking requests if request hangs
</span><span class="cx" style="display: block; padding: 0 10px">        $current->last_checked = time();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,14 +123,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $response = wp_remote_post( $http_url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
-               return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
+               return;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $body = trim( wp_remote_retrieve_body( $response ) );
</span><span class="cx" style="display: block; padding: 0 10px">        $body = json_decode( $body, true );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! is_array( $body ) || ! isset( $body['offers'] ) )
-               return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_array( $body ) || ! isset( $body['offers'] ) ) {
+               return;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $offers = $body['offers'];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,16 +182,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * api.wordpress.org. Will only check if WordPress isn't installing.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 2.3.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @uses $wp_version Used to notify the WordPress version.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global string $wp_version Used to notify the WordPress version.
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @param array $extra_stats Extra statistics to report to the WordPress.org API.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return false|null Returns null if update is unsupported. Returns false if check is too soon.
</del><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_update_plugins( $extra_stats = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( defined( 'WP_INSTALLING' ) ) {
+               return;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( defined('WP_INSTALLING') )
-               return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wp_version;
+       // include an unmodified $wp_version
+       include( ABSPATH . WPINC . '/version.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // If running blog-side, bail unless we've not checked in the last 12 hours
</span><span class="cx" style="display: block; padding: 0 10px">        if ( !function_exists( 'get_plugins' ) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,8 +251,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Bail if we've checked recently and if nothing has changed
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $plugin_changed )
-                       return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! $plugin_changed ) {
+                       return;
+               }
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Update last_checked for current to prevent multiple blocking requests if request hangs
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,7 +262,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $to_send = compact( 'plugins', 'active' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $locales = array( get_locale() );
</del><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Filter the locales requested for plugin translations.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,7 +269,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param array $locales Plugin locale. Default is current locale of the site.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $locales = apply_filters( 'plugins_update_check_locales', $locales );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locales = apply_filters( 'plugins_update_check_locales', array( get_locale() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $timeout = 30;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,8 +303,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $raw_response = wp_remote_post( $http_url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
-               return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
+               return;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
</span><span class="cx" style="display: block; padding: 0 10px">        foreach ( $response['plugins'] as &$plugin ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,14 +342,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @uses $wp_version Used to notify the WordPress version.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @param array $extra_stats Extra statistics to report to the WordPress.org API.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return false|null Returns null if update is unsupported. Returns false if check is too soon.
</del><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_update_themes( $extra_stats = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( defined( 'WP_INSTALLING' ) ) {
+               return;
+       }
+       global $wp_version;
+       // include an unmodified $wp_version
+       include( ABSPATH . WPINC . '/version.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( defined( 'WP_INSTALLING' ) )
-               return false;
-
</del><span class="cx" style="display: block; padding: 0 10px">         $installed_themes = wp_get_themes();
</span><span class="cx" style="display: block; padding: 0 10px">        $translations = wp_get_installed_translations( 'themes' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -407,8 +416,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Bail if we've checked recently and if nothing has changed
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $theme_changed )
-                       return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! $theme_changed ) {
+                       return;
+               }
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Update last_checked for current to prevent multiple blocking requests if request hangs
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -417,7 +427,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $request['themes'] = $themes;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $locales = array( get_locale() );
</del><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Filter the locales requested for theme translations.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,7 +434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param array $locales Theme locale. Default is current locale of the site.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $locales = apply_filters( 'themes_update_check_locales', $locales );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locales = apply_filters( 'themes_update_check_locales', array( get_locale() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $timeout = 30;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -458,8 +467,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $raw_response = wp_remote_post( $http_url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
-               return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
+               return;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $new_update = new stdClass;
</span><span class="cx" style="display: block; padding: 0 10px">        $new_update->last_checked = time();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -492,12 +502,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Retrieves a list of all language updates available.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 3.7.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return array
</ins><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_translation_updates() {
</span><span class="cx" style="display: block; padding: 0 10px">        $updates = array();
</span><span class="cx" style="display: block; padding: 0 10px">        $transients = array( 'update_core' => 'core', 'update_plugins' => 'plugin', 'update_themes' => 'theme' );
</span><span class="cx" style="display: block; padding: 0 10px">        foreach ( $transients as $transient => $type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">                 $transient = get_site_transient( $transient );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( empty( $transient->translations ) )
</span><span class="cx" style="display: block; padding: 0 10px">                        continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,7 +517,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $updates[] = (object) $translation;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">         return $updates;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -571,17 +581,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">        return apply_filters( 'wp_get_update_data', $update_data, $titles );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * @global string $wp_version
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function _maybe_update_core() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        global $wp_version;
</ins><span class="cx" style="display: block; padding: 0 10px">         include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $current = get_site_transient( 'update_core' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( isset( $current->last_checked ) &&
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $current->last_checked, $current->version_checked ) &&
</ins><span class="cx" style="display: block; padding: 0 10px">                 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) &&
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                isset( $current->version_checked ) &&
-               $current->version_checked == $wp_version )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $current->version_checked == $wp_version ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 return;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">         wp_version_check();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -614,7 +627,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $current = get_site_transient( 'update_themes' );
</span><span class="cx" style="display: block; padding: 0 10px">        if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
</span><span class="cx" style="display: block; padding: 0 10px">                return;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">         wp_update_themes();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre>
</div>
</div>

</body>
</html>