<!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>[9616] sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc: Translate: Remove cron schedules for cache updates, update data on the fly.</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 { white-space: pre-line; 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="http://meta.trac.wordpress.org/changeset/9616">9616</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/9616","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-03-22 12:05:56 +0000 (Sun, 22 Mar 2020)</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'>Translate: Remove cron schedules for cache updates, update data on the fly.

Prevents missing data before the next schedule is run.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggproutesincclasspluginphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggproutesincroutesclassindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggproutesincroutesclasslocalephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggproutesincclasspluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php     2020-03-22 11:21:55 UTC (rev 9615)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php       2020-03-22 12:05:56 UTC (rev 9616)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,6 +8,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> class Plugin {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        public const CACHE_GROUP = 'wporg-translate';
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * @var Plugin The singleton instance.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,12 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'template_redirect', [ $this, 'register_routes' ], 5 );
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'gp_locale_glossary_path_prefix', [ $this, 'set_locale_glossary_path_prefix' ] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_filter( 'cron_schedules', [ $this, 'register_cron_schedules' ] );
-               add_action( 'init', [ $this, 'register_cron_events' ] );
</del><span class="cx" style="display: block; padding: 0 10px">                 add_action( 'init', [ $this, 'respect_robots_txt' ], 9 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_action( 'wporg_translate_update_existing_locales_cache', [ $this, 'update_existing_locales_cache' ] );
-               add_action( 'wporg_translate_update_translation_status_cache', [ $this, 'update_translation_status_cache' ] );
-               add_action( 'wporg_translate_update_contributors_count_cache', [ $this, 'update_contributors_count_cache' ] );
</del><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">        /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,41 +176,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">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Filters the non-default cron schedules.
-        *
-        * @param array $schedules An array of non-default cron schedules.
-        * @return array  An array of non-default cron schedules.
-        */
-       public function register_cron_schedules( $schedules ) {
-               $schedules['15_minutes'] = array(
-                       'interval' => 15 * MINUTE_IN_SECONDS,
-                       'display'  => 'Every 15 minutes',
-               );
-
-               return $schedules;
-       }
-
-       /**
-        * Registers CLI commands if WP-CLI is loaded.
-        */
-       public function register_cron_events() {
-               if ( ! wp_next_scheduled( 'wporg_translate_update_existing_locales_cache' ) ) {
-                       wp_schedule_event( time(), '15_minutes', 'wporg_translate_update_existing_locales_cache' );
-               }
-
-               if ( ! wp_next_scheduled( 'wporg_translate_update_translation_status_cache' ) ) {
-                       wp_schedule_event( time() + 3 * MINUTE_IN_SECONDS, '15_minutes', 'wporg_translate_update_translation_status_cache' );
-               }
-
-               if ( ! wp_next_scheduled( 'wporg_translate_update_contributors_count_cache' ) ) {
-                       wp_schedule_event( time() + 6 * MINUTE_IN_SECONDS, '15_minutes', 'wporg_translate_update_contributors_count_cache' );
-               }
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Calculates the translation status of the WordPress project per 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">-        public function update_translation_status_cache() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function get_translation_status() {
</ins><span class="cx" style="display: block; padding: 0 10px">                 global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! isset( $wpdb->project_translation_status ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,6 +185,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return;
</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">+                $cached = wp_cache_get( 'translation-status', self::CACHE_GROUP );
+               if ( false !== $cached ) {
+                       return $cached;
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $translation_status = $wpdb->get_results( $wpdb->prepare(
</span><span class="cx" style="display: block; padding: 0 10px">                        "SELECT `locale`, `all` AS `all_count`, `waiting` AS `waiting_count`, `current` AS `current_count`, `fuzzy` AS `fuzzy_count`
</span><span class="cx" style="display: block; padding: 0 10px">                        FROM {$wpdb->project_translation_status}
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,33 +198,32 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'default'
</span><span class="cx" style="display: block; padding: 0 10px">                ), OBJECT_K );
</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 ( ! $translation_status ) {
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         wp_cache_set( 'translation-status', $translation_status, 'wporg-translate', 15 * MINUTE_IN_SECONDS );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                wp_cache_set( 'translation-status', $translation_status, 'wporg-translate' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $translation_status;
</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">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Updates contributors count per 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">-        public function update_contributors_count_cache() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function get_contributors_count() {
</ins><span class="cx" style="display: block; padding: 0 10px">                 global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $cached = wp_cache_get( 'contributors-count', self::CACHE_GROUP );
+               if ( false !== $cached ) {
+                       return $cached;
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( ! isset( $wpdb->user_translations_count ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 return [];
</ins><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">-                $locales   = $this->get_existing_locales();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $locales   = self::get_existing_locales();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $db_counts = $wpdb->get_results(
</span><span class="cx" style="display: block; padding: 0 10px">                        "SELECT `locale`, COUNT( DISTINCT user_id ) as `count` FROM {$wpdb->user_translations_count} WHERE `accepted` > 0 GROUP BY `locale`",
</span><span class="cx" style="display: block; padding: 0 10px">                        OBJECT_K
</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 ( ! $db_counts || ! $locales ) {
-                       return;
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $counts = array();
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $locales as $locale ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( isset( $db_counts[ $locale ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +233,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"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                wp_cache_set( 'contributors-count', $counts, 'wporg-translate' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         wp_cache_set( 'contributors-count', $counts, self::CACHE_GROUP, 15 * MINUTE_IN_SECONDS );
+
+               return $counts;
</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">        /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,10 +246,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @return array List of GlotPress locales.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private function get_existing_locales() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function get_existing_locales() {
</ins><span class="cx" style="display: block; padding: 0 10px">                 global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $wpdb->get_col(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $cached = wp_cache_get( 'existing-locales', self::CACHE_GROUP );
+               if ( false !== $cached ) {
+                       return $cached;
+               }
+
+               $existing_locales = $wpdb->get_col(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $wpdb->prepare(
</span><span class="cx" style="display: block; padding: 0 10px">                                "SELECT locale FROM {$wpdb->gp_translation_sets} WHERE `project_id` = %d and slug = %s",
</span><span class="cx" style="display: block; padding: 0 10px">                                2, // 2 = wp/dev
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,17 +261,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'default'
</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"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        /**
-        * Updates cache for existing locales.
-        */
-       public function update_existing_locales_cache() {
-               $existing_locales = $this->get_existing_locales();
-               if ( ! $existing_locales ) {
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         wp_cache_set( 'existing-locales', $existing_locales, self::CACHE_GROUP, HOUR_IN_SECONDS );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                wp_cache_set( 'existing-locales', $existing_locales, 'wporg-translate' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $existing_locales;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggproutesincroutesclassindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-index.php       2020-03-22 11:21:55 UTC (rev 9615)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-index.php 2020-03-22 12:05:56 UTC (rev 9616)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,6 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Locales;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Route;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use WordPressdotorg\GlotPress\Routes\Plugin;
</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">  * Index Route Class.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,18 +13,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> class Index extends GP_Route {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private $cache_group = 'wporg-translate';
-
</del><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Prints all exisiting locales as cards.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         *
-        * Note: Cache gets refreshed via `WPorg_GP_CLI_Update_Caches`.
</del><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        public function get_locales() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $existing_locales = wp_cache_get( 'existing-locales', $this->cache_group );
-               if ( false === $existing_locales ) {
-                       $existing_locales = array();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $existing_locales = Plugin::get_existing_locales();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $locales = array();
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $existing_locales as $locale ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,16 +26,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                usort( $locales, array( $this, '_sort_english_name_callback' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                unset( $existing_locales );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $contributors_count = wp_cache_get( 'contributors-count', $this->cache_group );
-               if ( false === $contributors_count ) {
-                       $contributors_count = array();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $contributors_count = Plugin::get_contributors_count();
+               $translation_status = Plugin::get_translation_status();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $translation_status = wp_cache_get( 'translation-status', $this->cache_group );
-               if ( false === $translation_status ) {
-                       $translation_status = array();
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $this->tmpl( 'index-locales', get_defined_vars() );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggproutesincroutesclasslocalephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php      2020-03-22 11:21:55 UTC (rev 9615)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php        2020-03-22 12:05:56 UTC (rev 9616)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,6 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Route;
</span><span class="cx" style="display: block; padding: 0 10px"> use stdClass;
</span><span class="cx" style="display: block; padding: 0 10px"> use WordPressdotorg\GlotPress\Rosetta_Roles\Plugin as Rosetta_Roles;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use WordPressdotorg\GlotPress\Routes\Plugin;
</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">  * Locale Route Class.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,10 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $wpdb->get_col( "SELECT id FROM {$wpdb->gp_projects} WHERE parent_project_id IN( " . implode( ', ', $project_ids ) . ')' )
</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">-                $contributors_count = wp_cache_get( 'contributors-count', 'wporg-translate' );
-               if ( false === $contributors_count ) {
-                       $contributors_count = array();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $contributors_count = Plugin::get_contributors_count();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $variants = $this->get_locale_variants( $locale_slug );
</span><span class="cx" style="display: block; padding: 0 10px">                // If there were no results for the current variant in the current project branch, it should still show it.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,10 +180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $project_icon = $this->get_project_icon( $project, $sub_project, 64 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $contributors_count = wp_cache_get( 'contributors-count', 'wporg-translate' );
-               if ( false === $contributors_count ) {
-                       $contributors_count = array();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $contributors_count = Plugin::get_contributors_count();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $sub_project_statuses = array();
</span><span class="cx" style="display: block; padding: 0 10px">                $sub_projects         = $this->get_active_sub_projects( $sub_project, true );
</span></span></pre>
</div>
</div>

</body>
</html>