Fix - Version the theme stylesheet and custom script with the theme version - #72
Open
rajatgautam755421 wants to merge 2 commits into
Open
rajatgautam755421 wants to merge 2 commits into
rajatgautam755421 wants to merge 2 commits into
Conversation
…ersion (themegrill/radiate-pro#33) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
QA suite — passed ✅All 10 checks passed. 6 passed · 0 failed · 4 skipped · 0 flaky · 12s Automated check — no AI involved. It runs the tests in this branch. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
All reviewed changes are covered by passing regression tests with no unresolved issues.
Review effort: Lite
Findings: None
What changed in this PR
Updates theme asset versioning to prevent stale CSS and JavaScript from being served after theme updates.
Changes:
- Versions the stylesheet with the active theme version.
- Versions
custom.jswithRADIATE_THEME_VERSION. - Adds an end-to-end regression test.
| File | Summary |
|---|---|
tests/e2e/specs/homepage/asset-versions.spec.ts |
Verifies both assets use the theme version. |
functions.php |
Adds theme-version query parameters to CSS and JavaScript assets. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…-coded slug (themegrill/radiate-pro#33) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The main stylesheet (
radiate-style) andcustom.jswere enqueued without a version, so WordPress stamped them with the WordPress core version (?ver=7.1.2) instead of the theme's own. A theme update that ships CSS/JS changes kept the same query string, so browsers and CDNs could keep serving a stale file, and every WordPress core update forced all visitors to re-download unchanged theme assets.Closes themegrill/radiate-pro#33
Fix
radiate-style: version is the theme'sVersionheader (wp_get_theme()->get( 'Version' ), so a child theme's own stylesheet is versioned by the child).radiate-custom-js: version isRADIATE_THEME_VERSION.Before / After
Testing
tests/e2e/specs/homepage/asset-versions.spec.ts: reads theVersionfromstyle.cssand asserts both assets carry it. Passes 3/3; fails on the previous code (7.1.2received).functions.phpdid not get worse.🤖 Generated with Claude Code