=== GDPR Localizer – Smart Google Fonts Local Hosting & DSGVO Compliance ===
Contributors: vpuida
Tags: gdpr, google fonts, local fonts, font optimization, dsgvo
Requires at least: 5.8
Tested up to: 6.9
Stable tag: 1.1.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically localizes Google Fonts to comply with GDPR/DSGVO requirements by hosting them on your own server. Set it and forget it.

== Description ==

Most GDPR font plugins do one thing: download fonts once. **GDPR Localizer** goes further. It automatically detects when you update or switch your theme and alerts you instantly — so you always know when to refresh your font cache. It also localizes Gravatars, eliminating the last hidden IP leak most plugins ignore. Set it once, stay in control.

= Why choose GDPR Localizer? =
Unlike basic solutions, this plugin is designed to be truly "set and forget." It doesn't just download fonts; it monitors your site's environment. If you update your theme version or switch to a new one, the plugin detects the change and prompts you to refresh the font cache to ensure your design stays perfect, fast, and compliant.

= Key Features =
* **Automatic Interception:** Seamlessly handles fonts enqueued by themes and plugins.
* **Smart Theme Tracking:** Detects theme updates and notifies you to manually refresh the font cache to prevent conflicts with caching plugins.
* **Privacy First:** Stops user IP addresses from being shared with Google CDN.
* **Performance Boost:** Serving fonts locally eliminates external DNS lookups and SSL handshakes.
* **Transparent Audit:** An intuitive admin dashboard shows you exactly which fonts were captured and their source (e.g., `astra-google-fonts`).
* **Clean UI:** Interactive font logs with "Expand/Collapse" functionality to keep your settings page tidy.
* **Local Gravatars:** Automatically downloads and serves user avatars from your server to prevent IP tracking by Gravatar.
* **Smart Onboarding & Preview:** Professional dashboard with real-time detection logs and visual previews of localized fonts.
* **Deep Interception:** Advanced support for Elementor and themes with complex CSS loading.
* **Privacy Hardening:** Automatically strips redundant preconnect and dns-prefetch tags pointing to Google or Gravatar.

== Deutsche Beschreibung (DSGVO) ==
Die meisten GDPR-Font-Plugins laden Schriftarten nur einmal herunter. **GDPR Localizer** geht weiter: Es erkennt automatisch, wenn Sie Ihr Theme aktualisieren oder wechseln, und benachrichtigt Sie sofort – so wissen Sie immer, wann Sie den Schrift-Cache erneuern müssen. Zudem lokalisiert es Gravatar-Avatare und schließt damit das letzte versteckte IP-Leck. Einmal einrichten, volle Kontrolle behalten.

**Hauptmerkmale:**
* **Automatische Erkennung:** Verarbeitet nahtlos Schriften, die von Themes und Plugins in die Warteschlange gestellt werden.
* **Smart Theme Tracking:** Erkennt Theme-Updates und weist Sie darauf hin, den Schrift-Cache manuell zu aktualisieren, um Konflikte mit Caching-Plugins zu vermeiden.
* **DSGVO-Konformität:** Verhindert die Weitergabe von Nutzer-IP-Adressen an Google CDN.
* **Performance-Schub:** Lokales Laden von Schriften verbessert die Ladezeit durch Wegfall externer DNS-Abfragen.
* **Transparentes Audit:** Ein intuitives Dashboard zeigt genau an, welche Schriftarten erfasst wurden.
* **Lokale Gravatare:** Lädt Benutzer-Avatare automatisch herunter und stellt sie von Ihrem Server bereit, um IP-Tracking durch Gravatar zu verhindern.
* **Intelligentes Onboarding & Vorschau:** Professionelles Dashboard mit Echtzeit-Protokollen und visueller Vorschau lokalisierter Schriftarten.
* **Tiefe Interzeption:** Erweiterte Unterstützung für Elementor und Themes mit komplexem CSS-Laden.
* **Privacy Hardening:** Entfernt automatisch überflüssige Preconnect- und DNS-Prefetch-Tags zu Google- oder Gravatar-Servern.

Gefällt Ihnen GDPR Localizer? Bitte unterstützen Sie uns mit einer 5-Sterne-Bewertung!

== External services ==

This plugin connects to Google Fonts services to localized your website's typography and ensure GDPR compliance.

1. **Google Fonts API (fonts.googleapis.com):** Used to fetch the CSS rules for the fonts enqueued by your theme or plugins.
2. **Google Fonts Static (fonts.gstatic.com):** Used to download the actual font files (.woff2, .ttf, etc.) to your local server.

This process happens only when a new font is detected or when the font cache is refreshed (e.g., after a theme update). Once the fonts are stored locally, no further requests are made to Google.

* **Google Fonts Privacy FAQ:** https://developers.google.com/fonts/faq/privacy
* **Google Privacy Policy:** https://policies.google.com/privacy
* **Google Terms of Service:** https://policies.google.com/terms

== Installation ==

1. Upload the `gdpr-localizer` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Visit **Settings > GDPR Localizer** to view the status of your localized fonts.

== Frequently Asked Questions ==

= Does this work with block themes (FSE)? =
Yes! It is fully compatible with modern block themes (like Twenty Twenty-Five) and handles fonts registered via the WordPress Font Face API.

= Will it slow down my site? =
No. Serving fonts locally usually improves your PageSpeed score by reducing the number of external requests.

= Where are the fonts stored? =
All files are securely stored in `/wp-content/uploads/gdpr-local-fonts/`.

= Does it work with Gravatar? =
Yes! Starting from version 1.1.0, the plugin can automatically download and serve user avatars from your own server, eliminating external requests to secure.gravatar.com.

= Why are preconnect tags being removed? =
Even if fonts are loaded locally, some themes keep "preconnect" links to Google. This still creates a technical connection to Google's servers. GDPR Localizer 1.1.0 strips these tags to ensure 100% privacy compliance.

= Why doesn't the plugin automatically clear the cache after a theme update? =
We tested fully automatic cache clearing, but it caused conflicts with popular caching plugins like LiteSpeed Cache. Instead, GDPR Localizer detects the theme change instantly and notifies you with a clear message in the dashboard. This way you decide when to refresh — no unexpected behavior, no broken layouts.

= Funktioniert das mit Block-Themes (FSE)? =
Ja! [cite_start]Es ist voll kompatibel mit modernen Block-Themes (wie Twenty Twenty-Five) und unterstützt Schriftarten, die über die WordPress Font Face API registriert wurden. [cite: 31, 32]

= Wird es meine Website verlangsamen? =
Nein. [cite_start]Das lokale Laden von Schriftarten verbessert in der Regel Ihren PageSpeed-Score, da externe Anfragen reduziert werden. [cite: 33]

= Wo werden die Schriftarten gespeichert? =
[cite_start]Alle Dateien werden sicher im Verzeichnis `/wp-content/uploads/gdpr-local-fonts/` gespeichert. [cite: 34]

= Gefällt Ihnen GDPR Localizer? =
Bitte unterstützen Sie uns mit einer 5-Sterne-Bewertung! Ihr Feedback hilft uns, dieses Tool für alle WordPress-Nutzer zu verbessern.

= Funktioniert das Plugin mit Gravatar? =
Ja! Ab Version 1.1.0 kann das Plugin Benutzer-Avatare automatisch herunterladen und von Ihrem eigenen Server bereitstellen. Dadurch werden externe Anfragen an secure.gravatar.com eliminiert.

= Warum werden Preconnect-Tags entfernt? =
Selbst wenn Schriftarten lokal geladen werden, behalten einige Themes "Preconnect"-Links zu Google bei. Dies baut dennoch eine technische Verbindung zu Google-Servern auf. GDPR Localizer 1.1.0 entfernt diese Tags, um 100%ige Datenschutzkonformität zu gewährleisten.

= Warum leert das Plugin den Cache nach einem Theme-Update nicht automatisch? =
Wir haben die vollautomatische Cache-Leerung getestet, aber sie verursachte Konflikte mit beliebten Caching-Plugins wie LiteSpeed Cache. Stattdessen erkennt GDPR Localizer die Theme-Änderung sofort und benachrichtigt Sie mit einer klaren Meldung im Dashboard. So entscheiden Sie selbst, wann der Cache geleert wird — kein unerwartetes Verhalten, keine kaputten Layouts.

== Screenshots ==

1. The enhanced dashboard showing real-time font detection and proactive onboarding guide.
2. Visual font previews: see exactly which fonts were captured and stored locally.
3. Gravatar settings: host user avatars locally for 100% DSGVO compliance in comment sections.

== Changelog ==

= 1.1.3 =
* Improved: Enhanced compatibility with block-based themes (FSE), including WordPress 2025.
* Improved: Added theme slug tracking alongside versioning to ensure more reliable cache management during theme switches.
* Enhanced: Added a "Clean" status indicator in the admin dashboard to confirm successful scans on sites already free of external Google Fonts.
* Security: Implemented nonce verification for frontend scan requests to meet the latest WordPress security standards.
* Fixed: Resolved a potential PHP Fatal error related to security function loading order.

= 1.1.2 =
* **Improvement:** Updated documentation and translation strings to reflect manual cache management logic

= 1.1.1 =
* Fix: Improved compatibility with LiteSpeed Cache and other caching plugins.
* Fix: Added automatic server-side cache purging upon plugin activation and manual reset.
* Fix: Resolved an issue where only a partial number of fonts were deleted during a manual reset.
* Improvement: Updated onboarding flow to bypass aggressive caching during the initial font scan.
* Improvement: Optimized file system operations for more reliable font directory management.

= 1.1.0 =
* **Feature:** Added Gravatar localization support for user profiles and comments.
* **Improvement:** Redesigned the admin interface with a proactive onboarding wizard.
* **Improvement:** Added visual font previews and "Expand/Collapse" functionality for better UX.
* **Improvement:** Implemented output buffering to remove redundant preconnect/dns-prefetch hints for Google/Gravatar.
* **Fix:** Enhanced detection logic for Elementor and themes using encoded URLs (html_entity_decode).
* **Fix:** Fixed a TypeError in resource hints filtering when handling array-based hints.
* **Security:** Full code audit for data escaping and sanitization (WP.org compliant).

= 1.0.0 =
* Initial release.
* Added smart theme version tracking for automatic cache management.
* Implemented source-based font grouping for better transparency.
* Added interactive "Expand/Collapse" UI for font logs.
* Full compatibility with WordPress 6.7 and Astra theme.

= 1.1.3 =
* Verbessert: Optimierte Kompatibilität mit Block-basierten Themes (FSE), einschließlich WordPress 2025.
* Verbessert: Slug-Tracking für Themes zusätzlich zur Versionierung hinzugefügt, um eine zuverlässigere Cache-Verwaltung beim Theme-Wechsel zu gewährleisten.
* Erweitert: Statusanzeige "Bereinigt" im Admin-Dashboard hinzugefügt, um erfolgreiche Scans auf Websites zu bestätigen, die bereits frei von externen Google Fonts sind.
* Sicherheit: Nonce-Verifizierung für Frontend-Scan-Anfragen implementiert, um den neuesten WordPress-Sicherheitsstandards zu entsprechen.
* Behandelt: Ein potenzieller PHP-Fatal-Error im Zusammenhang mit der Ladereihenfolge von Sicherheitsfunktionen wurde behoben.

= 1.1.2 =
* **Verbesserung:** Dokumentation und Übersetzungen aktualisiert, um die Logik der manuellen Cache-Verwaltung widerzuspiegeln.

= 1.1.1 =
* Fix: Kompatibilität mit LiteSpeed Cache und anderen Caching-Plugins verbessert.
* Fix: Automatisches Leeren des serverseitigen Caches bei Aktivierung des Plugins und manuellem Reset hinzugefügt.
* Fix: Problem behoben, bei dem beim manuellen Zurücksetzen nur ein Teil der Schriftarten gelöscht wurde.
* Optimierung: Onboarding-Prozess aktualisiert, um aggressives Caching während des ersten Schriftart-Scans zu umgehen.
* Optimierung: Dateisystem-Operationen für eine zuverlässigere Verwaltung des Schriftart-Verzeichnisses verbessert.

= 1.1.0 =
* **Feature:** Gravatar-Lokalisierung für Benutzerprofile und Kommentare hinzugefügt.
* **Verbesserung:** Überarbeitete Admin-Oberfläche mit proaktivem Onboarding-Assistenten.
* **Verbesserung:** Visuelle Schriftart-Vorschau und "Ausklappen"-Funktion für eine bessere UX hinzugefügt.
* **Verbesserung:** Implementierung von Output-Buffering zum Entfernen überflüssiger Preconnect/DNS-Prefetch-Tags.
* **Fix:** Verbesserte Erkennungslogik für Elementor und Themes mit kodierten URLs.
* **Fix:** TypeError bei der Filterung von Ressourcen-Hinweisen behoben.
* **Sicherheit:** Vollständiges Code-Audit für Daten-Escaping und Sanitization (WP.org-konform).

= 1.0.0 =
* Erstveröffentlichung (Initial Release).
* Intelligente Verfolgung der Theme-Versionen für automatisches Cache-Management hinzugefügt.
* Implementierung einer quellenbasierten Gruppierung von Schriftarten für mehr Transparenz.
* Interaktive Benutzeroberfläche zum Aus- und Einklappen der Schriftarten-Logs hinzugefügt.
* Volle Kompatibilität mit WordPress 6.7 und dem Astra-Theme.