Skip to content

Fix - Version the theme stylesheet and custom script with the theme version - #72

Open
rajatgautam755421 wants to merge 2 commits into
developfrom
fix/33-asset-versions
Open

rajatgautam755421 wants to merge 2 commits into
developfrom
fix/33-asset-versions

Conversation

@rajatgautam755421

@rajatgautam755421 rajatgautam755421 commented Sep 30, 2026 •

Copy link
Copy Markdown

Summary

The main stylesheet (radiate-style) and custom.js were 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's Version header (wp_get_theme()->get( 'Version' ), so a child theme's own stylesheet is versioned by the child).
  • radiate-custom-js: version is RADIATE_THEME_VERSION.

Before / After

Before After
before after

Testing

  • New spec tests/e2e/specs/homepage/asset-versions.spec.ts: reads the Version from style.css and asserts both assets carry it. Passes 3/3; fails on the previous code (7.1.2 received).
  • Homepage/header/blog specs still pass; PHPCS for functions.php did not get worse.

🤖 Generated with Claude Code

…ersion (themegrill/radiate-pro#33)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js with RADIATE_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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants