From 71f39100f85f8209275e5ee6c3fb400881a3c512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Thu, 19 Dec 2024 15:54:38 -0500 Subject: [PATCH] fix styling --- inc/Engine/Media/Fonts/Admin/Data.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/inc/Engine/Media/Fonts/Admin/Data.php b/inc/Engine/Media/Fonts/Admin/Data.php index 24254ae72c..3ba7c092fc 100644 --- a/inc/Engine/Media/Fonts/Admin/Data.php +++ b/inc/Engine/Media/Fonts/Admin/Data.php @@ -38,13 +38,13 @@ public function __construct( Options_Data $options ) { * * @return void */ - public function schedule_data_collection() { + public function schedule_data_collection() { if ( ! $this->is_enabled() ) { return; } - $this->schedule_recurring( time(), WEEK_IN_SECONDS, 'rocket_fonts_data_collection' ); - } + $this->schedule_recurring( time(), WEEK_IN_SECONDS, 'rocket_fonts_data_collection' ); + } /** * Collect data. @@ -71,11 +71,12 @@ public function collect_data() { 'ttf', 'otf', ]; + $total_font_count = 0; $total_font_size = 0; - foreach( $fonts as $file ) { - //check file is not a directory. + foreach ( $fonts as $file ) { + // check file is not a directory. if ( $file->isDir() ) { continue; } @@ -83,15 +84,19 @@ public function collect_data() { $extension = strtolower( pathinfo( $file->getFilename(), PATHINFO_EXTENSION ) ); if ( in_array( $extension, $allowed_extensions, true ) ) { - $total_font_count++; + ++$total_font_count; $total_font_size += $file->getSize(); } } - set_transient( 'rocket_fonts_data_collection', [ - 'fonts_total_number' => $total_font_count, - 'fonts_total_size' => size_format( $total_font_size ) - ], WEEK_IN_SECONDS ); + set_transient( + 'rocket_fonts_data_collection', + [ + 'fonts_total_number' => $total_font_count, + 'fonts_total_size' => size_format( $total_font_size ), + ], + WEEK_IN_SECONDS + ); } /**