When your plugin is running
100,000 200,000+ active installs every change that you make is a big deal. For example, when you need to alter the structure of the database you aren’t changing it once, you are changing it 100,000 200,000+ times. Every install needs to make the change, not just your isolated development environment. This reality can be very daunting, however, there are steps that you can take to make the process of change painless an exceptional experience.
Over the past couple of major releases Ninja Forms has made some structural changes to its database tables. A long, long time ago form options were stored as a serialized array in the corresponding form’s table row. This allowed for a dynamic set of options to be stored for each form depending on extensions, version, etc. Today form options are stored in a separate table referenced by the form ID. This allows for options to be searched independently of the form without having to fetch the table row and unserialize the options field.
Being that Ninja Forms is a versioned plugin in the WordPress repository all
100,000 200,000+ active users needed to have their table structures upgraded after they updated the plugin. The solution is easy enough: provide a process for each user’s table structure to be upgraded. No big deal. Write the code and ship it with the update.
This becomes a much more complex situation with each change. The second upgrade may rely on the changes made by the first upgrade (and so on). It would be nice if users of the plugin would update with every new release, however, this is not reality (nor is it the reality of WordPress).
Over the past few weeks we have been working on a process to ensure that every update receives the same exceptional update experience that users of the Ninja Forms plugin deserve. Regardless of what version a user is updating from, wether they are just now making the jump from v2.2.6 to v2.9.12 or have been consistently updating with every minor release, no one should ever have to fear the update process.
Next time I will dig deeper into how we built this new upgrade process, the Ninja Forms Upgrade Handler.