Skip to content

Commit

Permalink
Remove fonts data collection transient with uninstall (PR #7212)
Browse files Browse the repository at this point in the history
  • Loading branch information
wordpressfan authored Jan 3, 2025
1 parent 7ce737a commit 2b77a58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/Engine/Media/Fonts/Admin/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use RecursiveIteratorIterator;
use WP_Rocket\Admin\Options_Data;
use WP_Rocket\Engine\Common\Queue\AbstractASQueue;
use Exception;

class Data extends AbstractASQueue {
/**
Expand Down Expand Up @@ -72,7 +73,11 @@ public function collect_data() {
return;
}

$fonts = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $this->base_path . 'google-fonts/fonts/' ) );
try {
$fonts = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $this->base_path . 'google-fonts/fonts/' ) );
} catch ( Exception $exception ) {
return;
}

$allowed_extensions = [
'woff',
Expand Down
1 change: 1 addition & 0 deletions inc/Engine/WPRocketUninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class WPRocketUninstall {
'rocket_preload_check_duration',
'wpr_user_information_timeout_active',
'wpr_user_information_timeout',
'rocket_fonts_data_collection',
];

/**
Expand Down

0 comments on commit 2b77a58

Please sign in to comment.