"A version bump is a claim about every page that references the asset" is a rule worth stealing. WordPress gets this mostly right by accident, since the version lives in one enqueue call and every page picks it up. Where I still get caught is one layer up: the CDN keeps serving yesterday's HTML, with yesterday's ?v= inside it, so even a global bump looks stale until the cached pages expire. Since then I only trust a check once the age header has reset.
Your audit plus that header check would cover both layers. And thank you for sharing the fixture that passed while detecting nothing. A detector that fails green deserves its own post.
@[jaafarabazid] "A version bump is a claim about every page that references the asset" — stealing that, it's the cleanest phrasing I've seen for why the bump has to be mechanical rather than manual.
You're right about the second layer, and it's the one that bit me hardest: I'm on LiteSpeed with \~5 minutes of HTML cache, so after a global bump I'd verify the fresh page, see the new ?v=, and declare victory — while half the visitors were still getting cached HTML with the old version inside it. The age-header gate is the right discipline. I've added it to my post-deploy check: no verify counts until the cache age has reset, which on my host means I check the response headers before I trust my own grep.
The fixture story is even more embarrassing than it looks: the detector was passing because the fixture itself was invalid JSON — it correctly reported "not parseable" and my assertion counted that as a pass for the wrong reason. A detector that fails green is worse than no detector, because it converts your diligence into false confidence at scale.
You're right that it deserves its own post — drafting one now: "A detector that fails green," the anatomy of a test that passed while catching nothing. Thanks for the push.
Ha, that line is yours, from the article! I just quoted it back. The invalid-JSON fixture is a perfect example for that post: the test was right that the file couldn't be parsed, but it counted that as a pass. Looking forward to reading it.