Let’s assume that you have made changes to your app, plugin, widget, or design theme and are about to publish the version for users.
How to do it properly so that the update works correctly in users’ accounts:
- Increase the version number in the product’s configuration file:
app.php
— for apps,plugin.php
— for plugins,widget.php
— for widgets,theme.xml
— for design themes.
The common principle of choosing version numbers is as follows:
- If only errors have been fixed and minor improvements have been made then the 3rd version part is increased; e.g., from
1.0.0
to1.0.1
. - If new functionality has been added or major improvements have been made then the 2nd version part is increased; e.g., from
1.0.0
to1.1.0
. - If a significant part of the source code has been reworked then the 1st version part is increased; e.g., from
1.0.0
to2.0.0
.
- For apps, plugins, widgets: add meta update files (read more) in the following cases:
- The new version does not contain some files which were included in the previous version — to ensure that the previous version’s files remaining on users’ servers do not interfere with the updated source code.
- The new version uses a different data storage format for your product — to ensure that the updated source code correctly works in the user accounts where data have already been saved in the old format.
- The new version uses database tables or table fields which were not used by the previous version. Even if you have described new tables and their fields in the
db.php
files, they are not automatically created when a product is updated to a newer version. Thedb.php
file is used only when a product is installed rather and not when a product is updated.
- For products using gettext localization files: update the localization:
- Generate an updated version of a localization file using the console command and add translations for the newly added keys.
- Remove unused localization keys from the file. You can view them by using the same console command run with the
--debug
argument. - Save the file with the
.po
name extension within the Poedit app; this will generate a new version of the localization file with the.mo
extension.
- Try to run the update installation in a test environment:
- Install the previous product version in a test account and perform various user actions with it so that its default configuration is changed. Or do not perform any actions to test the case when a user has installed your product and has not been using it until the installation of this update.
- Copy the new version’s files into that account by overwriting existing files.
- Clear cache in Settings app.
- Test the new product version in that test account.
- Should any errors be found, fix them in the new version’s source files and repeat the test procedure until the desired result is achieved.
- Update the descriptions, images, and user guides of your product, available Webasyst Store and on your website.