Trac: Read the asset cache-busting version from common.ini - #763
Conversation
site_head.html and site_footer.html each hardcoded their own scripts_version, requiring both to be bumped in lockstep on every wp-trac.css/js release. Read it from the [wporg] scripts_version setting in common.ini instead, so there's a single source of truth.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
This PR centralizes Trac asset cache-busting by reading scripts_version from Trac’s shared configuration (common.ini) instead of hardcoding it independently in multiple templates, reducing the chance of version drift across pages.
Changes:
- Updated
site_head.htmlandsite_footer.htmlto setscripts_versionviaenv.config.get('wporg', 'scripts_version'). - Bumped the configured
[wporg] scripts_versionvalue incommon.inito243.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| trac.wordpress.org/templates/site_head.html | Pulls the CSS cache-busting version from Trac config instead of a hardcoded template value. |
| trac.wordpress.org/templates/site_footer.html | Pulls the JS cache-busting version from Trac config instead of a hardcoded template value. |
| trac.wordpress.org/conf/common.ini | Updates the single source of truth for the asset cache-busting version to 243. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
site_head.htmlandsite_footer.htmleach hardcoded their ownscripts_version, so every wp-trac.css/js cache bump required editing both files in lockstep.scripts_versionfrom a new[wporg]section incommon.iniviaenv.config.get('wporg', 'scripts_version'), giving a single source of truth.Test plan
wp-trac.css/wp-trac.js/trac-security.jsURLs render with?243[wporg] scripts_versionincommon.inialone updates both templates' asset URLs