diff --git a/src/Admin/SiteHealth.php b/src/Admin/SiteHealth.php index c6af0a52d27..f3aced4ff93 100644 --- a/src/Admin/SiteHealth.php +++ b/src/Admin/SiteHealth.php @@ -354,6 +354,11 @@ public function add_debug_information( $debugging_information ) { 'value' => MonitorCssTransientCaching::query_css_transient_count(), 'private' => false, ], + 'amp_css_transient_caching_time_series' => [ + 'label' => esc_html__( 'Calculated time series for monitoring the stylesheet caching', 'amp' ), + 'value' => MonitorCssTransientCaching::get_time_series(), + 'private' => false, + ], ], ], ] diff --git a/src/BackgroundTask/MonitorCssTransientCaching.php b/src/BackgroundTask/MonitorCssTransientCaching.php index bb2e46ffea4..65473ce71a0 100644 --- a/src/BackgroundTask/MonitorCssTransientCaching.php +++ b/src/BackgroundTask/MonitorCssTransientCaching.php @@ -109,7 +109,7 @@ public function process( DateTimeInterface $date = null, $transient_count = null } $date_string = $date->format( 'Ymd' ); - $time_series = $this->get_time_series(); + $time_series = self::get_time_series(); $time_series[ $date_string ] = $transient_count; ksort( $time_series ); @@ -172,7 +172,7 @@ public function handle_plugin_update( $old_version ) { * * @return int[] Time series with the count of transients per day. */ - private function get_time_series() { + public static function get_time_series() { return (array) get_option( self::TIME_SERIES_OPTION_KEY, [] ); }