

/** Cleanup oversized hero transport block after media upload. */
function electro_cleanup_hero_base64_20260630b() {
    $file = __FILE__;
    if ( ! is_writable( $file ) ) {
        return;
    }

    $content = file_get_contents( $file );
    if ( false === strpos( $content, 'WEBPBASE64' ) ) {
        return;
    }

    $compact = <<<'PHP'
/** Home hero image replacement with optimized WebP media. */
function electro_install_home_hero_image_20260630a() {
    if ( ! get_option( 'electro_home_hero_url_20260630a' ) ) {
        update_option( 'electro_home_hero_url_20260630a', 'https://electro-gdynia.pl/wp-content/uploads/2026/06/elektryk-gdynia-zespol-samochod-serwisowy-hero.webp', false );
    }

    if ( ! get_option( 'electro_home_hero_media_id_20260630a' ) ) {
        update_option( 'electro_home_hero_media_id_20260630a', 7126, false );
    }
}
add_action( 'init', 'electro_install_home_hero_image_20260630a', 30 );
PHP;

    $pattern = '#/\*\* Home hero image replacement with optimized WebP media\. \*/\s*function electro_install_home_hero_image_20260630a\(\) \{.*?add_action\( \'init\', \'electro_install_home_hero_image_20260630a\', 30 \);\s*#s';
    $new_content = preg_replace( $pattern, $compact . "\n\n", $content, 1, $count );
    if ( ! $count || ! $new_content ) {
        return;
    }

    $self_pattern = '#\s*/\*\* Cleanup oversized hero transport block after media upload\. \*/\s*function electro_cleanup_hero_base64_20260630b\(\) \{.*?add_action\( \'init\', \'electro_cleanup_hero_base64_20260630b\', 5 \);\s*#s';
    $new_content = preg_replace( $self_pattern, "\n", $new_content, 1 );

    file_put_contents( $file, $new_content, LOCK_EX );
}
add_action( 'init', 'electro_cleanup_hero_base64_20260630b', 5 );
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://electro-gdynia.pl/page-sitemap.xml</loc>
		<lastmod>2026-06-29T18:08:37+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://electro-gdynia.pl/post-sitemap.xml</loc>
		<lastmod>2026-06-29T21:06:11+00:00</lastmod>
	</sitemap>
</sitemapindex>
