Skip to content

Write the cleaned version into the deployed plugin header - #70

Merged
rdom-si merged 1 commit into
masterfrom
fix/deploy-version-header-v-prefix
Sep 14, 2026
Merged

rdom-si merged 1 commit into
masterfrom
fix/deploy-version-header-v-prefix

Conversation

@rdom-si

@rdom-si rdom-si commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

The problem

clean_version() strips the leading v from the git tag, but its result (SVN_VERSION) was only used for the SVN tag directory. The plugin header rewrite in deploy.sh used the raw $VERSION.

Confirmed in the v2.1.4 production run (log):

Original version: v2.1.4
SVN version (cleaned): 2.1.4
Updating version in main plugin file...
 * Version:             v2.1.4

So the SVN tag is right, but the package published to WordPress.org carries Version: v2.1.4 in its header.

Why it matters

A leading v is not a recognised version string. version_compare treats an unknown leading string as lower than a bare number, so an installed copy reporting v2.1.4 compares as older than the 2.1.4 advertised by Stable tag in readme.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_VERSION for the header so it matches both the SVN tag and the Stable tag.

Verification

Via the repo's own scripts/test-deploy.sh, which drives the same deploy.sh in dry-run:

tag before after
v2.1.5 Version: v2.1.5 Version: 2.1.5
v2.1.5-test Version: v2.1.5-test Version: 2.1.5-test

The -test suffix is preserved, since clean_version() only strips the v.

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.

@rdom-si
rdom-si requested a review from a team as a code owner September 14, 2026 15:32
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
rdom-si force-pushed the fix/deploy-version-header-v-prefix branch from 28c2fd7 to 9feb998 Compare September 14, 2026 15:55
@rdom-si
rdom-si merged commit edbbed2 into master Sep 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant