fix: quiet per-request db.php version-check log noise - #48
Open
mrtwebdesign wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Quiets the per-request
[hypercart_query_guard][warn] db.php drop-in tested on WP …log noise emitted by thewp-content/db.phpdrop-in. The warning was firing on every request whenever WordPress was on a patch release within the tested line (e.g.7.0.2), flooding the logs.Root cause
HCQG_DB::hcqg_version_check()ran in the constructor on every request and compared the full$wp_versionstring against a7.0ceiling withversion_compare( …, '>' ). Any patch inside the tested line —7.0.1,7.0.2— compares greater than'7.0', so a compatible patch release tripped the warning on every page load. The emit was also ungated by mode and not de-duplicated.Fix (
db.php)$wp_versionis reduced to7.0(patch and pre-release suffixes stripped) before theversion_compare, so7.0.xpatches register as in-range.private static $hcqg_version_warnedguard.offmode — the check early-returns unless instrumentation is active.5.5 – 6.8comment now matches the7.0ceiling and documents the major.minor comparison.The warning still fires — once — for a genuinely untested major/minor (e.g. a real
7.1/8.0), preserving the safety net.Testing
php -l db.php— cleanDbDropinTest— 12 tests, 21 assertions passingNotes
7.0.2stays quiet while7.1/5.4warn once) in a follow-up.🤖 Generated with Claude Code