Blocksy + Brizy: Blocksy fonts-manager.php taking 3s in Code Profiler – workaround that fixed it for me
Hi everyone,
I ran into a pretty weird performance issue on one of my sites that uses Blocksy as the theme and Brizy (with Bunny CDN) to handle fonts and layouts. I thought I’d share what I found and how I fixed it, in case it helps someone else or gives the devs a useful data point.
The symptom
Using Code Profiler Pro, I saw that:
-
wp-content/themes/blocksy/inc/css/fonts-manager.phpwas taking around 3 seconds per uncached request. -
This was on Brizy-heavy pages, with Code Profiler’s caching and optimisations disabled.
That looked wrong, especially because:
-
I have dynamic CSS set to “file” in Blocksy.
-
All front‑end fonts are handled by Brizy + Bunny CDN, and in the page source there were no Google Fonts calls from Blocksy at all.
So Blocksy’s font manager shouldn’t really be doing much on the front end in this setup.
What turned out to be happening
Blocksy ships with a google-fonts.json file that contains the entire Google font catalogue (in my case it was close to 1 MB). On uncached requests, Blocksy’s fonts-manager.php was:
-
Reading that JSON file.
-
Decoding it and normalising all fonts/variants.
-
Doing this even though I wasn’t actually using Blocksy’s Google Fonts on the front end.
The workaround that fixed it
Since I only use Brizy’s fonts and don’t need Blocksy to load Google Fonts at all, I added a couple of filters to short‑circuit Blocksy’s Google font handling.
I dropped this into a small mu‑plugin / code snippet:
<?php // 1. Tell Blocksy not to use remote Google Fonts at all. add_filter( 'blocksy:typography:google:use-remote', function () { return false; } ); // 2. Provide an empty Google font source so the big JSON is not parsed. add_filter( 'blocksy-typography-google-fonts-source', function () { return [ 'items' => [] // No Google fonts; page builder handles fonts instead. ]; } );
Result:
-
The
fonts-manager.phpscript basically disappeared from the top of the profiler list. -
Total PHP time dropped, and visually nothing changed on the front end (Brizy fonts still loaded exactly as before).
Why I’m posting this
-
For other users on Blocksy + Brizy (or another builder that fully handles fonts): if you see
fonts-manager.phpeating seconds of PHP time in a profiler, this approach might help. -
For the Blocksy devs: it might be worth detecting when Google fonts are completely unused / disabled and skipping the JSON load and full catalogue processing in that case. On smaller hosting, parsing a ~1 MB JSON font list on every uncached request adds up quickly, especially when combined with a heavy page builder.
-
Hi Patrick,
Thank you for taking the time to share your solution and for providing a detailed breakdown.
This will definitely be useful for other users experiencing the same issue.
Best regards,
Ariel H.0
Please sign in to leave a comment.
Comments
1 comment