 === OMGF | GDPR/DSGVO Compliant, Faster Google Fonts. Easy. ===
Contributors: DaanvandenBergh
Tags: google, fonts, gdpr, dsgvo, cache
Requires at least: 5.9
Tested up to: 7.0
Stable tag: 6.3.8
Requires PHP: 7.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

The original Google Fonts self-hosting plugin. Automagically caches your fonts locally — no configuration (or brains) required!

== Description ==

OMGF can be downloaded for free without any paid subscription from [the official WordPress repository](https://wordpress.org/plugins/host-webfonts-local/).

**Trusted by 300,000+ WordPress sites. The original Google Fonts self-hosting plugin.**

OMGF removes the connection between your site and Google's font servers, eliminating the DNS lookups and render-blocking requests that slow down LCP and TTFB — while making your site GDPR/DSGVO-compliant in the process. German courts have ruled that loading Google Fonts directly violates GDPR, since visitor IPs get logged by Google. OMGF closes that gap entirely: nothing leaves your server.

Install it and it works immediately. No setup required, though there's plenty to fine-tune if you want to.

## Detection, Out of the Box

OMGF scans your site for Google Fonts, Bunny Fonts (`fonts.bunny.net`), and Jetpack CDN (`fonts-api.wp.com`) and downloads them to your own server automatically. It even automatically detects and optimizes Google Fonts loaded by Elementor.

## Free Features

**Resource hints cleanup** — Strips leftover `preconnect`, `dns-prefetch`, and `preload` hints pointing at `fonts.googleapis.com` and `fonts.gstatic.com` — dead weight once your fonts are self-hosted.

**font-display control** — Force `font-display: swap` (or `block`, `fallback`, `optional`, `auto`) on your Google Fonts, fixing "Ensure text remains visible during webfont load" in Lighthouse and PageSpeed Insights.

**Performance Checker** — Keeps an eye on your setup and flags what's costing you points: unused subsets, unused weights, missing preloads above the fold, and layout shift from fonts loading late.

**Google Fonts checker** — Pings you when a theme or plugin update introduces new Google Fonts that haven't been processed yet.

**Manual control** — Globally unload font families or weights you don't need. Preload the ones that matter above the fold.

**Integrates with your stack** — OMGF works alongside the optimization plugins and page builders you're already running, including Autoptimize, FlyingPress, Kinsta, LiteSpeed Cache, SiteGround Speed Optimizer, W3 Total Cache, WP Fastest Cache, WP-Optimize, WP Rocket, WP Super Cache, Elementor, Divi, Beaver Builder, Bricks, Oxygen, and Visual Composer.

## OMGF Pro

Where the free version covers the fundamentals, Pro removes the manual work entirely.

**Smart Optimize** — Measures, on real visitor pageviews, exactly which fonts, subsets, and weights get used above the fold. Preloads what matters, strips what doesn't. No configuration, no guessing — just measured results.

**Magic Fallbacks** — Generates system font fallbacks mathematically tuned to match each Google Font's real metrics (`size-adjust`, `ascent-override`), so text doesn't jump around while fonts load. Zero CLS, calculated automatically per font.

**Deeper detection** — Pro reaches fonts the free version and competitors don't touch:
- Inline `<style>` blocks with `@font-face` or `@import`
- Local and externally hosted stylesheets using `@import`
- Web Font Loader (`webfont.js`)
- Async, JS-injected Google Fonts loaded at runtime
- WordPress's Font Manager (or Font Library, since WP 7.0)
- Variable Fonts (`fonts.googleapis.com/css2`)
- Material Icons

**Global font-display** — Extends `font-display` control to every font on your site, not just Google Fonts.

**Everything else:**
- Automatic Multisite and WPML support
- Serve fonts and stylesheets from your own CDN or custom path
- Replace font families with system fonts entirely
- Whitelabel stylesheets — strip OMGF branding and comments for smaller file sizes
- Developer Mode for safely migrating between dev, staging, and production

[**Get OMGF Pro →**](https://daan.dev/wordpress/omgf-pro/) | [Documentation](https://daan.dev/docs/omgf-pro/) | [Tested Plugins & Themes](https://daan.dev/docs/omgf-pro/tested-themes-plugins/)

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/host-webfonts-local` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Use the Settings -> Optimize Google Fonts screen to configure the plugin

For a more comprehensive guide on configuring OMGF, check out the [user manual](https://daan.dev/docs/omgf-pro/)

== Frequently Asked Questions ==

For the FAQ, [click here](https://daan.dev/docs/omgf-pro-faq/).

== Screenshots ==

1. OMGF's Local Fonts screen. These settings affect the downloaded files and generated stylesheet(s).
2. The dashboard offers a quick overview of possible configurational issues (and solutions), the status of cached fonts/stylesheets along with quick links to simple management tasks e.g., Empty Cache and Configure/Remove.
3. After you've completed configuring OMGF, the Optimize Local Fonts section will allow you to tweak all of your Google Fonts stylesheets by e.g., unloading unused fonts and/or preloading fonts above the fold.
4. Advanced Settings. Change these to make OMGF work with your configuration (if needed). The default settings will suffice for most configurations.

== Changelog ==

= 6.3.8 | June 25th, 2026 =
* XSS: Hardened security by adding capability and nonce checks to Save & Optimize action.

= 6.3.7 | June 16th, 2026 =
* Added: omgf_frontend_process_preloads action, which is used by OMGF Pro for coming up Smart Optimize improvements.

= 6.3.6 | June 4th, 2026 =
* Tested with WP 7.0.

= 6.3.5 | May 13th, 2026 =
* Fixed: Google Fonts and Performance Checker didn't run when Disable Admin Bar Menu was enabled.

= 6.3.4 | April 13th, 2026 =
* Code improvements to facilitate UX in OMGF Pro.

= 6.3.3 | April 10th, 2026 =
* Improved: Performance Checker now also checks Cumulate Layout Shifting (CLS) caused by fonts.
* Some minor UI fixes.

= 6.3.2 | March 31st, 2026 =
* Fixed: Uncaught Error: Call to undefined function is_plugin_active(), which was introduced in 6.3.1.

= 6.3.1 =
* Fixed: flushing the cache after running Save & Optimize didn't work.
* Added: compatibility with the official Cloudflare plugin.

= 6.3.0 | March 30th, 2026 =
* Improved: clarified the dialog shown in the Performance Checker.
* Improved: OMGF now flushes the CSS cache of the most popular caching plugins after running Save & Optimize:
  - Autoptimize
  - FlyingPress
  - Kinsta Cache
  - LiteSpeed Cache
  - SiteGround Optimizer
  - W3 Total Cache
  - WP Fastest Cache
  - WP-Optimize
  - WP Rocket
  - WP Super Cache
* Improved: OMGF now flushes its own (third party) cache when editing options and/or pages/posts in the following themes/page builders:
  - Avada
  - Beaver Builder
  - Bricks Builder
  - Divi
  - Elementor
  - Oxygen
* Improved: When you switch themes, update permalinks or update a plugin, OMGF will now also flush third party stylesheets it's cached.

= 6.2.0 | March 23rd, 2026 =
* Extended the Google Fonts checker with a Performance Checker, which checks how fonts are performing on your site in 3 areas:
  - Unused Subsets,
  - Unused Font styles/weights,
  - Missing Preloads.
  If it finds any issues, it'll suggest solutions.

= 6.1.4 =
* Improved: options are now retrieved much more efficiently.
* Improved: minor security fixes.
* Deprecated: omgf_frontend_preloaded_fonts and omgf_frontend_optimized_fonts are deprecated and will be removed in a future release.
			  They are replaced by omgf_filter_preloaded_fonts and omgf_filter_optimized_fonts.

= 6.1.3 =
* Coincidentally found a bug that has been haunting me for years, that's why I'm releasing this quick patch release.
* Fixed: in some scenarios, unloaded_stylesheets would be stored as an array with one empty element in the database.

= 6.1.2 | February 20th, 2026 =
* Fixed: if the expected MIME type of the downloaded file didn't match, a class OMGF\OMGF exception would be thrown.
* Dev: Updated CI tools.

= 6.1.1 | January 26th, 2026 =
* Fixed: font-weights would sometimes break when Smart Slider 3 or Groovy Menu was enabled.

= 6.1.0 | January 21st, 2026 =
* Improved: OMGF now runs on wp-login.php.

= 6.0.11 | December 1st, 2025 =
* Tested with WP 6.9
* Improved: Renamed Divi/Elementor compatibility to just Divi compatibility, since Elementor compatibility is now always on.
* Added: Colibri WP theme to list of themes that require additional configuration.
* Fixed: an Uncaught TypeError would appear in the admin screen on some instances.

= 6.0.10 | October 10th, 2025 =
* Improved: subset and font-family detection to avoid false positives.
* Fixed: If no subset could be found, font filenames would be erroneously prepended with a dash.

= 6.0.9 | October 9th, 2025 =
* Improved: Google Fonts Checker now shows 5 results (pages) per found fonts request.
* Improved: clarified error message shown by Google Fonts Checker.
* Improved: Improved code related to Downloading and Optimization process to be more restrictive.

= 6.0.8 | October 1st, 2025 =
* Fixed: compatibility fix for Smart Slider 3, didn't run on Smart Slider 3 Pro.
* Fixed: syntax error in "Update available" message, would break JS execution on Plugins page.
* Improved: use new $params variable in filter, to prevent double POST cleanup.

= 6.0.7 | August 26th, 2025 =
* Fixed: removed trailing commas on some function calls to prevent errors in PHP 7.2 and lower.
* Minimum required PHP version is now 7.3, because it'll make my life easier and PHP 7.2 has been EOL for ages.

= 6.0.6 | July 30th, 2025 =
* Improved: PHP 8.3 compatibility.
* Fixed: Unloads (Don't Load) now work properly on Elementor stylesheets.
* Improved: logic to process unloaded font styles in stylesheets is more streamlined now.
* Fixed: a fatal error which occurred if nothing was selected in the Advanced Settings > Used Subsets option.

= 6.0.5 | July 7th, 2025 =
* Fixed: class WPTT not found error. Oops!

= 6.0.4 | July 4th, 2025 =
* Added: compatibility for themes/plugins using the WPTT webfont loader.
* Improved: Optimize Local Fonts section is now full width, like the Dashboard.
* Improved: Moved Test Mode into the Dashboard section.

= 6.0.3 | June 24th, 2025 =
* Added: Smart Preload (Pro) promotional option.
* Added: Compatibility for the upcoming Elementor v3.30 release.
* Improved: Compatibility fixes are now moved into one place, and are only loaded on the condition of the respective plugin actually being activated.
* Improved: All settings related to fonts optimization are now grouped in the Optimize Local Fonts section under the Local Fonts tab.
* Several code improvements.

= 6.0.2 | June 12th, 2025 =
* Improved: the Google Fonts checker now runs through its own API endpoint, instead of WP's AJAX actions.
* Improved: the Disable Admin Bar Menu option now also disables the Google Fonts checker.
* Added: Real Cookie Banner, Borlabs Cookie Banner, and Trustmary to the list of plugins which require additional configuration.
* Minor refactors for cleaner code and to fix minor security flaws.

= 6.0.1 | May 27th, 2025 =
* Fixed: Frontend Assets would still load, even when Disable Top Admin Bar Menu option was enabled.
* Fixed: some themes (like Enfold) are incompatible with wp-util. Refactored wp-util dependencies to vanilla JS in Google Fonts checker to no longer rely on it.
* Improved: really long URLs in the Dashboard are now wrapped.
* Fixed: when OMGF Pro isn't installed, Fallback Font Stack shouldn't be enabled.

= 6.0.0 - **2000 IQ edition** | May 26th, 2025 =
* Added: Google Fonts checker, which will notify you when a plugin or theme has added Google Fonts OMGF can't process (and provide a solution!)
* Improved: the menu in the Top Admin Bar now has a stoplight, which notifies you if there are any Google Fonts and/or configurational issues. It'll show green if all is well.
* Improved: the Task Manager is superseded by a brand-new Dashboard, which will give you a quick overview of:
  - If OMGF was able to process all Google Fonts on your site, and if not; show you where they were found with possible solutions.
  - If there were any configurational issues (e.g., known conflicts with other plugins, etc.).
  - Cache status,
  - Simple cache management tasks: Empty and Refresh.
* Improved: The settings screen got a fresh new coat of paint, fully aligned with [Daan.dev's new look](https://daan.dev/blog/rants/daan-dev-2-0/).
* Improved: Settings were moved around to move logical places:
  - The Detection Settings tab has been removed,
  - The Local Fonts tab is now fully dedicated to informing you about your Local Google Fonts configuration.
  - All options, that're not directly related to Locally Hosting Google Fonts but are directed more at optimization, are now moved to the Advanced Settings tab.
* Improved: Optimize for (D)TAP is now renamed to the more appropriate Developer Mode.
* Improved: Mailerlite users are now made aware of the fact that it loads iframes loading Google Fonts.
* Improved: if Disable Admin Bar Menu (prev. Disable Quick Access Menu) is enabled, the Admin Bar Menu will still show if there are issues to notify the administrators.
* Removed a bunch of old upgrade/update notifications.
* Tons of bug fixes and code and security improvements.

= 5.9.3 | May 16th, 2025 - THE LAST PATCH RELEASE BEFORE **OMGF V6!** =
* Tested with WP 6.8
* Added: compatibility with OptimizePress 3 theme
* Fixed: Variable font weights weren't processed properly during optimization.
* Fixed: Update notices weren't displayed properly.
* Various small bugfixes.

[ Changelog shortened ... ]

= 5.0.0 - **The Better, Bigger, Faster, Stronger, Cooler, Awesome-er Edition** | March 4th, 2022 =
* Added: Parse entire HTML document for Google Fonts stylesheets (instead of just wp_head())
* Added: Merged both Optimization Modes option into one automatically running option:
         - A first scan is done upon Save & Optimize,
         - A quick check is done on pageload, to see if other Google Fonts are found than the ones already found, and if so, they're downloaded and replaced on-the-fly.
* Enhanced: The Download API is replaced for an easier, leaner, and faster alternative and no longer uses the WordPress API.
         - If the first request fails, a mirror is used to retry the request, before throwing an error.
         - Fixes rest_no_route errors in some configurations.
* Enhanced: The Task Manager now offers a quick overview of downloaded stylesheets and their status, along with simple management tasks, e.g. cache flush, configure stylesheet, and/or remove.
         - When cache is marked as stale, it's now possible to refresh the cache and maintain your stylesheet configuration.
* Added: Resource hints enqueued in wp_resource_hints() are now properly removed.
* Fixed: Smart Slider 3 compatibility.
* Several bugfixes, UX improvements, and code optimizations.

[ Changelog shortened ... ]

= 4.0.0 | September 30th, 2020 =
* OMGF now runs fully automatic to replace/remove Google Fonts from your pages using OMGF's new Download API. No initial configuration required!
  * This means that if you use different fonts on different pages, all of them will be cached and served locally.
* HUGE performance increase in OMGF's automatic replacing/removing methods.
* Major overhaul of Settings Page:
  * Removed Extensions Tab
  * Some settings were moved to a new tab: Basic Settings.
  * Improved Welcome and Documentation tab.
  * Clarified option descriptions.
* Removed 'Generate Stylesheet' tab, which'll be released in a separate add-on plugin soon.
* Removed 'Use Web Font Loader?' option, because it causes Cumulative Layout Shift and will not work with OMGF's new Auto Replace feature.
* Removed 'Remove Version Parameter' option, because it has become obsolete. The new detection method uses the initial script's version, if set.
* Font Preloading is temporarily removed and will be re-introduced (in a different form, along with new features) in a later release.

[ Changelog shortened ... ]

= 3.0.0 =
*OMGF - CORONA EDITION*
* Moved Welcome-panel to the side.
* wp_remote_get() is now used instead of cURL.
* Complete code overhaul to increase performance and UX.
* Notices and errors are now more explanatory and dismissable.
* Fixed several bugs.
* OMGF now uses wp_options table, instead of own tables.
* Old tables are removed and data is migrated.
* Auto detect now works better than ever.
* Search now works bug free.
* WordPress' default admin fonts no longer show up as results.

[ Changelog shortened ... ]

= 2.0.0 =
Added Typekit's Web Font Loader to allow loading fonts asynchronously.

[ Changelog shortened... ]

= 1.0 =
First release! No changes so far!
