/* Define THEME */
if (!defined('lemon_URI_PATH')) define('lemon_URI_PATH', get_template_directory_uri());
if (!defined('lemon_ABS_PATH')) define('lemon_ABS_PATH', get_template_directory());
if (!defined('lemon_URI_PATH_FR')) define('lemon_URI_PATH_FR', lemon_URI_PATH.'/framework');
if (!defined('lemon_ABS_PATH_FR')) define('lemon_ABS_PATH_FR', lemon_ABS_PATH.'/framework');
if (!defined('lemon_URI_PATH_ADMIN')) define('lemon_URI_PATH_ADMIN', lemon_URI_PATH_FR.'/admin');
if (!defined('lemon_ABS_PATH_ADMIN')) define('lemon_ABS_PATH_ADMIN', lemon_ABS_PATH_FR.'/admin');
// GF Placeholder
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
// ==== CRE-13706 (LCP mobile 9,2 s -> norma <= 2,5 s) — blok zmian motywu dziecka ====
// Plik: wp-content/themes/lemon_child/functions.php
// Kopia przed zmiana: functions.php.bak-cre13706 (obok pliku)
// Cofniecie: cp functions.php.bak-cre13706 functions.php
// Karta: CRE-13706. Zakres: motyw/wtyczki. Bez zmian w tresci, GA4/CMP i JSON-LD.
// 1) Usuwamy WebFontLoader (ajax.googleapis.com + fonts.gstatic.com).
// Skrypt generuje aktywna wtyczka bears_core_old-deactivated2 (stary rdzen
// motywu Bearsthemes — katalog oznaczony jako "deactivated", ale wtyczka jest
// aktywna w bazie) w admin/redux-framework/framework.php:1649-1657.
// Wczytuje rodziny Arimo/Roboto/Montserrat/Lato/Poppis z Google, a te same
// rodziny sa juz serwowane lokalnie (lustro fontow Perfmatters w
// wp-content/cache/perfmatters/saunaolimpia.pl/fonts/). Efekt: podwojne
// pobrania Arimo (~124 KiB z gstatic) + podlaczenie do trzeciej domeny.
// Usuwamy tylko skrypt WebFontLoader — arkusze CSS fontow zostaja (patrz 2).
add_action( 'wp_enqueue_scripts', function () { ob_start(); }, 149 );
add_action( 'wp_enqueue_scripts', function () {
if ( ! ob_get_level() ) { return; }
$html = ob_get_clean();
if ( is_string( $html ) && $html !== '' ) {
$html = preg_replace( '##s', '', $html );
// preload fontow Perfmatters wskazuje na pliki lustra, ktorych juz nie uzywamy
$html = preg_replace( '#]+as=["\']font["\'][^>]*>#i', '', $html );
// preload krytycznego fontu naglowkow (Roboto 700 latin) z lokalnej kopii
$html .= '';
echo $html;
}
}, 151 );
add_action( 'wp_enqueue_scripts', function () {
wp_dequeue_script( 'webfontloader' );
wp_deregister_script( 'webfontloader' );
}, 200 );
// 2) Przyciety arkusz fontow: latin + latin-ext, tylko rodziny uzywane w tresci.
// Zastepuje 5 arkuszy Google Fonts (76 KB CSS, w tym 63 KB samego Roboto
// z 108 regulami @font-face) oraz eliminuje podzbiory cyrylica/grecka/
// wietnamska i zdublowana deklaracje Montserrat 400 (bearstheme-fonts +
// vc_google_fonts). Pliki .woff2 leza obok w themes/lemon_child/fonts/.
// Podzial na latin / latin-ext zostaje — polskie diakrytyki sa w latin-ext.
add_action( 'wp_print_styles', function () {
foreach ( array(
'bearstheme-fonts-css',
'bwg_googlefonts-css',
'vc_google_fonts_abril_fatfaceregular-css',
'vc_google_fonts_roboto100100italic300300italicregularitalic500500italic700700italic900900italic-css',
'vc_google_fonts_montserratregular700-css',
) as $handle ) {
wp_dequeue_style( $handle );
wp_deregister_style( $handle );
}
wp_enqueue_style( 'cre13706-fonts', get_stylesheet_directory_uri() . '/fonts/lcp-fonts.css', array(), '1.0' );
}, 9999 );
// 3) Obrazki poza pierwszym ekranem ladujemy leniwie. WordPress oznacza tak
// tylko obrazy w tresci wpisu; obrazki WPBakery (np. "Dzien dla pan",
// galeria, plansza informacyjna) szly bez loading=lazy i ciagnely ~70 KiB
// w przebudzeniu. Hero (fetchpriority=high) i logotypy zostaja bez zmian.
add_filter( 'wp_img_tag_add_loading_attr', function ( $attr, $image, $context ) {
if ( ! empty( $attr['fetchpriority'] ) && 'high' === $attr['fetchpriority'] ) { return $attr; }
$src = isset( $attr['src'] ) ? $attr['src'] : '';
if ( $src !== '' && false !== strpos( $src, '/logo' ) ) { return $attr; }
$attr['loading'] = 'lazy';
return $attr;
}, 10, 3 );
// ==== CRE-13706 — koniec bloku ====
https://saunaolimpia.pl/post-sitemap1.xml
2026-11-02T12:37:58+01:00
https://saunaolimpia.pl/page-sitemap1.xml
2026-11-02T18:46:01+01:00
https://saunaolimpia.pl/product-sitemap1.xml
2025-01-07T13:00:10+01:00
https://saunaolimpia.pl/category-sitemap1.xml
https://saunaolimpia.pl/post_tag-sitemap1.xml