Skip to content

Only use version from plugin header.#93

Open
BrianHenryIE wants to merge 6 commits intowp-cli:mainfrom
BrianHenryIE:Uses-version-from-plugin-header-when-multiple-versions-are-present
Open

Only use version from plugin header.#93
BrianHenryIE wants to merge 6 commits intowp-cli:mainfrom
BrianHenryIE:Uses-version-from-plugin-header-when-multiple-versions-are-present

Conversation

@BrianHenryIE
Copy link
Member

@BrianHenryIE BrianHenryIE commented May 2, 2024

The minimum definition for a plugin file says its set of headers must have the Plugin Name header. This PR changes the version parsing code to only consider a parsed version if it is part of a PHP file's plugin headers, by checking does the "Plugin Name" header exist first.

Previously, it was considering any @version in any PHP docblock.

Fixes #92

Edit: looks like I didn't start the branch off upstream/master. I'll rewrite it soon.

@BrianHenryIE BrianHenryIE requested a review from a team as a code owner May 2, 2024 04:39
@BrianHenryIE BrianHenryIE marked this pull request as draft May 2, 2024 04:43
@swissspidy swissspidy changed the title Only use version from plugin header. Fix #92 Only use version from plugin header. May 2, 2024
@BrianHenryIE BrianHenryIE force-pushed the Uses-version-from-plugin-header-when-multiple-versions-are-present branch from 529293a to 1c1e5bb Compare July 12, 2024 01:17
@BrianHenryIE BrianHenryIE marked this pull request as ready for review July 12, 2024 01:18
@@ -0,0 +1,119 @@
<?php

class Version_Tool {
Copy link
Member

Choose a reason for hiding this comment

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

@davidperezgar
Copy link

Yes! it happens to me sometimes that it gets the first PHP in the folder and it does not get the Plugin name.
+1

@swissspidy swissspidy added the command:dist-archive Related to 'dist-archive' command label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:dist-archive Related to 'dist-archive' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect version number used when creating zip archive

3 participants