revert: lokales Google-Fonts-Hosting entfernt + scan zeigt nur hinweis

- Feature "Schriften lokal hosten" komplett zurueckgebaut (class-fonts.php,
  tab, ajax-endpunkte, output-buffer, admin-js-handler, optionen).
- Scan: wird fonts.googleapis.com / fonts.gstatic.com erkannt, steht in der
  Aktion-spalte jetzt der nicht-klickbare hinweis "Schriftart fuer
  DSGVO-konformen Betrieb lokal hosten." statt eines buttons.
- i18n entsprechend bereinigt (123 strings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
s4luorth
2026-06-08 07:39:34 +02:00
parent 94043baf7c
commit b6df4c64af
8 changed files with 22 additions and 669 deletions

View File

@@ -222,9 +222,18 @@
}
$tr.append( $st );
// Action: take over as a new service (only useful for uncovered third parties)
// Action column.
const $act = $( '<td></td>' );
if ( f.third_party && ! f.covered ) {
const host = ( f.host || '' ).toLowerCase();
const isGoogleFont = host === 'fonts.googleapis.com' || host === 'fonts.gstatic.com';
if ( isGoogleFont ) {
// Google Fonts can't be consent-gated meaningfully — the right fix is
// hosting them locally. Show a non-clickable hint, no button.
$act.append( $( '<span></span>' )
.css( { color: '#8a6d3b', fontStyle: 'italic' } )
.text( i18n.fontHint || 'Host this font locally for GDPR-compliant operation.' ) );
} else if ( f.third_party && ! f.covered ) {
// Prefill from the matching preset (full data) if there is one,
// otherwise just seed host + pattern.
const data = preset
@@ -250,40 +259,6 @@
$out.append( $table );
}
/* ── Local Google Fonts: download & embed ── */
$( '#cb-fonts-fetch' ).on( 'click', function () {
const i18n = cbAdmin.i18n || {};
const $btn = $( this ).prop( 'disabled', true );
const $st = $( '#cb-fonts-status' ).text( i18n.fontsFetching || 'Downloading…' );
$.post( cbAdmin.ajaxUrl, { action: 'cb_fonts_fetch', nonce: cbAdmin.fontsNonce } )
.done( function ( resp ) {
if ( ! resp || ! resp.success ) {
const msg = resp && resp.data && resp.data.message ? resp.data.message : 'Error';
$st.text( ( i18n.fontsError || 'Error:' ) + ' ' + msg );
return;
}
$st.text( resp.data.message || 'OK' );
setTimeout( function () { window.location.reload(); }, 900 );
} )
.fail( function ( xhr ) {
$st.text( ( i18n.fontsError || 'Error:' ) + ' ' + xhr.status );
} )
.always( function () {
$btn.prop( 'disabled', false );
} );
} );
$( '#cb-fonts-clear' ).on( 'click', function () {
const i18n = cbAdmin.i18n || {};
if ( ! window.confirm( i18n.fontsClearConfirm || 'Delete local fonts?' ) ) {
return;
}
$( this ).prop( 'disabled', true );
$.post( cbAdmin.ajaxUrl, { action: 'cb_fonts_clear', nonce: cbAdmin.fontsNonce } )
.always( function () { window.location.reload(); } );
} );
/* ── Activate a tab by key ── */
function activateTab( tab ) {
$( '.cb-tab-content' ).hide();