Write the cleaned version into the deployed plugin header - #70
Merged
Merged
Conversation
clean_version() strips the leading "v" from the git tag, but its result was only used for the SVN tag directory. The plugin header rewrite used the raw $VERSION, so a tag of v2.1.4 produced "Version: v2.1.4" inside the package published to WordPress.org while the SVN tag was correctly 2.1.4. A leading "v" is not a recognised version string: version_compare treats it as lower than a bare number, so an installed copy reporting v2.1.4 compares as older than the 2.1.4 advertised by the Stable tag in readme.txt, which can leave an update prompt that never clears after updating. Use $SVN_VERSION for the header so it matches the SVN tag and the Stable tag. Verified with scripts/test-deploy.sh: a v2.1.5 tag now yields "2.1.5" where it previously yielded "v2.1.5", and a v2.1.5-test tag still yields "2.1.5-test". This affects every release using a v-prefixed tag, so 2.1.4 and earlier are already published with the prefixed header.
rdom-si
force-pushed
the
fix/deploy-version-header-v-prefix
branch
from
September 14, 2026 15:55
28c2fd7 to
9feb998
Compare
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.
The problem
clean_version()strips the leadingvfrom the git tag, but its result (SVN_VERSION) was only used for the SVN tag directory. The plugin header rewrite indeploy.shused the raw$VERSION.Confirmed in the v2.1.4 production run (log):
So the SVN tag is right, but the package published to WordPress.org carries
Version: v2.1.4in its header.Why it matters
A leading
vis not a recognised version string.version_comparetreats an unknown leading string as lower than a bare number, so an installed copy reportingv2.1.4compares as older than the2.1.4advertised byStable taginreadme.txt. The likely user-visible effect is an update prompt that never clears after updating.I have not reproduced that prompt on a live site, so treat the consequence as reasoned rather than observed. The header discrepancy itself is confirmed from the run log above.
The fix
Use
$SVN_VERSIONfor the header so it matches both the SVN tag and theStable tag.Verification
Via the repo's own
scripts/test-deploy.sh, which drives the samedeploy.shin dry-run:v2.1.5Version: v2.1.5Version: 2.1.5v2.1.5-testVersion: v2.1.5-testVersion: 2.1.5-testThe
-testsuffix is preserved, sinceclean_version()only strips thev.Scope
Every release using a
v-prefixed tag is affected, which is all of them back through at least v2.0.x. 2.1.4 and earlier are already published with the prefixed header; this only corrects future releases. Worth someone checking a real install to see whether the update prompt actually misbehaves, which would decide if 2.1.5 is worth cutting sooner rather than later.