Should all WordPress Plugins have a Database Schema Version?

Should WordPress plugins that make any database schema changes have a local database scheme version number?

The plugin README file has tags for Requires at leastTested up to and Stable tag.

I’m suggesting that alongside defining the plugin version, and the three README tags, there should be a value for the schema. This means that plugin authors can explicitly note when their plugin is updating the schema.

Whether it goes in the main plugin file next to plugin version, or in the README file I’m not sure it makes any difference. But if we build in some hooks to trigger on schema version change then we gain two things. Firstly, developers like it as they can explicitly perform tasks based on schema versions and version changes. And secondly, users can be notified that the plugin is about to make schema changes. Which might encourage backups.

I think that’s a win-win!

Published by

TCBarrett

Open Source Architect (Web Geek)