Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR A – Guard in enqueue.php
Avoid frontend I/O on first paint: guard SCSS compiler in enqueue.php
This PR prevents unnecessary filesystem work on frontend requests when the SCSS compiler is disabled. Currently, scss-compiler.php is always loaded and bootscore_compile_scss() is called; the disable check runs later inside the compiler, after glob()/filemtime() scans have already happened. This can delay first paint.
Changes
Add a guard in inc/enqueue.php to check BOOTSCORE_SCSS_DISABLE_COMPILER (and the bootscore/scss/disable_compiler filter) before requiring/triggering the compiler.
Impact
Verification
Backward compatibility: Fully backward compatible.
PR B – Early return in scss-compiler.php
Fast-path disable: early return in scss-compiler.php before FS checks
This PR moves the disable check to the top of BootscoreScssCompiler::compile(). Previously, the check happened only after building modified-checks (glob()/filemtime()), causing unnecessary I/O even when the compiler was disabled.
Changes
Impact
Verification
Backward compatibility: No breaking changes; defensive early return only.
Why?
Performance
Eliminate SCSS compiler overhead when disabled by guarding in enqueue.php or early-returning in the compiler.
On this repo we had already some discussions/reports about perfomance issues and I ran into the same issue since version 6.2.x. When you had compiled already your SCSS before deploying, there is no need to run the scss-compiler all the time on each pageload. This has a particularly negative effect on the pageload on systems with slow file systems, because here scss-compiler is running at the frontend all the time.
When do you want add some CSS issues, for sure you can everytime enable the scss-compiler. But when you let run a website with this theme without doing any CSS changes constantly, you just can disable it in wp-config.php with define('BOOTSCORE_SCSS_DISABLE_COMPILER', true); and my guards are preventing all the checks, which are only needed, when the scss-compiler is running. For sure - the possibility for disabling it isn't new. The constant was available all the time but it was just placed to late into the code, so the side effects were slowing down the installation.