0

I am using composer to install plugins to my sites, but is worried that composer update will crash my site for those plugins that might issuing database update when there's new version

Suppose, in a hypothetical wordpress site:

I installed plugin version 1.0

Few months later, the latest version is now plugin version 1.3

I run composer update (this is the same way as I download a copy of the latest plugin and just copy-paste-overwrite the files in the plugins folder) and the plugin files has now been overwritten by the plugin files for version 1.3, which handles the file part

BUT what if, in plugin version 1.2 the author required its users to do some database upgrade, is there a chance that me updating from v 1.0 directly to v 1.3 I would skip such notices about database upgrade?

Is there a rule for wordpress that when you update your plugin ONLY files will be updated, and the database upgrade will prompted at later time?

Regards,

  • How this would be handled would vary from plugin to plugin, and there are no rules about how to do it. In my experience most large plugins, like WooCommerce and Advanced Custom Fields, will prompt the user in WordPress to perform the database update. They are also pretty good about allowing database updates across multiple versions. The thing is it's entirely up to the developer, so you will need to check each plugin individually and keep an eye on their development. The safest thing to do is to just update the plugins through WordPress or WP-CLI. – Jacob Peattie Feb 16 '18 at 1:59
2

The straight answer is "no" and it is also inpossible to have such a thing as code always depends on some DB format, and you can not just change the code without the DB.

What happens when you upgrade over several releases will depend on the quality of the plugins and the testings being done to them. You can almost always be sure that one "step" upgrades were tested but it is much more problematic to assume that multiple "steps" upgrade was tested well.

As always, the best thing is to do the upgrades on a staging enviroment, and do some sanity tests before doing anything on production.

0

There is no such rule. Plugin update may contain database changes or may not contain. Generally all plugin update code written on WordPress init hook. Once your WordPress will init all plugin update code will get executed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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