Making WordPress.org


Ignore:
Timestamp:
03/22/2020 12:05:56 PM (5 years ago)
Author:
ocean90
Message:

Translate: Remove cron schedules for cache updates, update data on the fly.

Prevents missing data before the next schedule is run.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-index.php

    r3002 r9616  
    55use GP_Locales;
    66use GP_Route;
     7use WordPressdotorg\GlotPress\Routes\Plugin;
    78
    89/**
     
    1314class Index extends GP_Route {
    1415
    15     private $cache_group = 'wporg-translate';
    16 
    1716    /**
    1817     * Prints all exisiting locales as cards.
    19      *
    20      * Note: Cache gets refreshed via `WPorg_GP_CLI_Update_Caches`.
    2118     */
    2219    public function get_locales() {
    23         $existing_locales = wp_cache_get( 'existing-locales', $this->cache_group );
    24         if ( false === $existing_locales ) {
    25             $existing_locales = array();
    26         }
     20        $existing_locales = Plugin::get_existing_locales();
    2721
    2822        $locales = array();
     
    3327        unset( $existing_locales );
    3428
    35         $contributors_count = wp_cache_get( 'contributors-count', $this->cache_group );
    36         if ( false === $contributors_count ) {
    37             $contributors_count = array();
    38         }
    39 
    40         $translation_status = wp_cache_get( 'translation-status', $this->cache_group );
    41         if ( false === $translation_status ) {
    42             $translation_status = array();
    43         }
     29        $contributors_count = Plugin::get_contributors_count();
     30        $translation_status = Plugin::get_translation_status();
    4431
    4532        $this->tmpl( 'index-locales', get_defined_vars() );
Note: See TracChangeset for help on using the changeset viewer.