It looks like if there's a PHP file with a PHPdoc version number in the header like this, in a class file in the root folder of the plugin that isn't the main plugin file, it will be used instead of the actual plugin version number:
/**
* Class file
*
* @version 7.2.0
*/
Describe how other contributors can replicate this bug
Create a folder lifterlms with a main plugin file with the standard plugin header (ie. lifterlms.php)
Create a file that's alphabetically before the main plugin file with the following header, ie. class-lifterlms.php
<?php
/**
* Main LifterLMS class
*
* @package LifterLMS/Main
*
* @since 1.0.0
* @version 7.2.0
*/
Run wp dist-archive lifterlms from the wp-content/plugins folder
Expected
Creates zip archive with name lifterlms.7.6.0.zip
Actual
Creates zip archive with name liftrerlms.7.2.0.zip
Let us know what environment you are running this on
OS: Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 x86_64
Shell: /bin/zsh
PHP binary: /usr/local/Cellar/php@8.2/8.2.18/bin/php
PHP version: 8.2.18
php.ini used: /usr/local/etc/php/8.2/php.ini
MySQL binary: /usr/local/bin/mysql
MySQL version: mysql Ver 8.1.0 for macos14.0 on x86_64 (Homebrew)
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /Users/brianhogg/laravel/lifter2/wp-content/plugins/lifterlms
WP-CLI packages dir: /Users/brianhogg/.wp-cli/packages/
WP-CLI cache dir: /Users/brianhogg/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.10.0
Provide a possible solution
Other than removing the @version 7.2.0 header in the other class file I'm not sure a fix without checking the code that fetches the plugin version number. Likely just needs a tweak to what it's looking for to ignore @version but grab Version:
Bug Report
Describe the current, buggy behavior
It looks like if there's a PHP file with a PHPdoc version number in the header like this, in a class file in the root folder of the plugin that isn't the main plugin file, it will be used instead of the actual plugin version number:
Describe how other contributors can replicate this bug
lifterlms
with a main plugin file with the standard plugin header (ie.lifterlms.php
)class-lifterlms.php
wp dist-archive lifterlms
from thewp-content/plugins
folderExpected
Creates zip archive with name
lifterlms.7.6.0.zip
Actual
Creates zip archive with name
liftrerlms.7.2.0.zip
Let us know what environment you are running this on
Provide a possible solution
Other than removing the
@version 7.2.0
header in the other class file I'm not sure a fix without checking the code that fetches the plugin version number. Likely just needs a tweak to what it's looking for to ignore@version
but grabVersion: