Unnecessary font download when Elementor uses Google Fonts locally
-
Dear Mr. van den Bergh,
First of all, thank you for this fantastic plugin—it helps us a lot to stay compliant with GDPR.
However, I encountered a small issue when using the plugin alongside Elementor. As you may know, Elementor offers the option to load Google Fonts locally. Currently, OMGF does not detect that these fonts are already included locally. As a result, the condition in
src/Download.phparound line 70 evaluates as true, and the plugin unnecessarily downloads the font. This leads to unnecessary duplicates on the webspace and subsequently triggers the condition on line 76.I would recommend adding a check after the condition on line 70, for example:
if ( str_starts_with( $this_url, WP_SITEURL ) ) {
return ”;
}This would prevent fonts that are already included locally from being downloaded unnecessarily. You may also want to add a similar check for the
http://variant.Thank you for considering this, and for your continued work on OMGF.
With collegial regards,
Alexander Behling
Tech Lead at Mumbo Jumbo Media
The topic ‘Unnecessary font download when Elementor uses Google Fonts locally’ is closed to new replies.