Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When I'm writing a fix to some bugs, I often increment the version and send it to the bug finder to see if my fix works. If I have 1.2.5 and I want to create a beta that will become redundant once I commit my code, should I use 1.2.5-beta or 1.2.6-beta? My concern is that 1.2.6 < 1.2.6-beta so that the string comparison may favour the beta and the bug finder would not get a notification of the stable version being released.

EDIT:

If the string is compared absolutely without taking into account the release type, you could use 1.2.5-fix and then 1.2.6. The problem is also outlined at http://en.wikipedia.org/wiki/Software_versioning#Pre-release_versions

share|improve this question

2 Answers 2

up vote 4 down vote accepted

If your current plugin version is 1.2.5, and you have a beta version for the next version, it should be called 1.2.6-beta. Your user can install it, and when the real 1.2.6 version is released on the repository, WordPress will notify the user on the Plugins page and let him update.

WordPress uses a PHP function called version_compare to compare version numbers for this purpose. When comparing version numbers, WordPress will recognize them like this:

1.2.5 < 1.2.6-beta < 1.2.6

I've tested this out with a plugin of my own in the repository, currently at version 0.45.11. I changed the version number of the plugin on my own site to 0.45.11-beta, and WordPress let me update to 0.45.11 from the Plugins admin page.

share|improve this answer

You should not be releasing beta versions of plugins you expect to follow up with a non-beta release. Beta is for testing, release it on your website or something, but only do stable releases to the repo unless you plan on keeping the plugin in beta.

share|improve this answer
    
Yes, when sending the file to the bug finder for testing, I don't commit it to the repo, rather I email them. The issue of updating to 1.2.6 from 1.2.6-beta only arises for the bug finder. –  Aram Kocharyan Jan 30 '12 at 2:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.