wp-cli / dist-archive-command

Create a distribution .zip or .tar.gz based on a plugin or theme's .distignore file
https://developer.wordpress.org/cli/commands/dist-archive/
MIT License
47 stars 23 forks source link

Only use version from plugin header. #93

Open BrianHenryIE opened 4 months ago

BrianHenryIE commented 4 months ago

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.