Last week I had released a version of a WordPress plugin that works if the user was doing a fresh install, however if they already had the plugin and upgraded it using the WordPress upgrade automatically feature, problems occurred and some of the database elements were erased. So I had to revert back immediately.

I was wondering if there was a way to test the plugin through the upgrade automatically functionality before hand instead of having to release it and hoping you get it right the first time.

Thanks in advance,


2 Answers 2


If I am not mistaken upgrade process is essentially:

  1. Deactivating plugin.
  2. Replacing files with newer version.
  3. Re-activating plugin.

Had you treid to simply reproduce this sequence manually?

  • 1
    Not always, you can also just replace the files on the server, and then you don't have steps 1 and 3. In fact, because this was inconsistent, the register_activation_hook doesn't fire in 3.1 anymore when you do an upgrade. But it did in previous versions, and perhaps Omar's plugin always set the database to a clean version on activation?
    – Jan Fabry
    Feb 8, 2011 at 9:16
  • 1
    @Jan Fabry Not always what? I think (de)activation is always part of automatic upgrade process (which question is about). Of course it also makes sense to test manual update, but that is out of scope of this question (as I understand it).
    – Rarst
    Feb 8, 2011 at 9:30
  • 2
    Ok, so maybe step 1 will still fire, but after WP 3.1 step 3 will certainly not fire anymore (when looking from a hook perspective).
    – Jan Fabry
    Feb 8, 2011 at 9:42

I think the most straight forward route is to have a demo site that you use over to one side (Consider it a QA environment). Just open that site up and trigger the download/update on this site once you commit your changes to SVN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.