• This is a general question regarding plugin updates/upgrades.

    When updating plugins through WordPress’s Upgrade interface – I am somewhat assured that if that plugin has any upgrade routines (ie. routines that make changes to a database table for the new version) those will run (once) when the plugin is upgraded.

    What happens when I use composer to deploy and update an entire installation?
    If composer update finds a new version of one of the plugins it just overwrites that plugin’s files.

    When going to my site after that, how would WordPress “know” that plugin has been upgraded since the last visit? Would that plugin’s upgrade routines even run? Is there a way to make that plugin run its upgrade routines? Is there a way to test a plugin has been upgraded since last visit (except for adding a ‘plugin_version’ option to database and manually testing against that?)

    Thank you one and all for any tips or documentation you might have.

Viewing 2 replies - 1 through 2 (of 2 total)
  • except for adding a ‘plugin_version’ option to database and manually testing against that?

    You said it. If the plugin has any upgrade routines, the plugin must manage them itself, by keeping track of what version (state) the database is in, and checking that this matches the code when it runs.
    Most plugins don’t have anything to do on upgrade.

    Thread Starter apedog

    (@apedog)

    Thank you Joy

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugins: how to run upgrade routines when using Composer’ is closed to new replies.