Speaking of updates when you are doing an update for your plugin you need to think about some of the following.
Do you have changes to the database, values, fields, tables - add delete or modify?
Do you add anything to the config table for your plugin?
Do you add permissions for your plugin, and do they include guest permissions?
Do you need to add a button to the sidebar for your plugin?
Do you need to add a page for your plugin on the user side, or is it strictly admin panel?
And if you are going to do all or some of these things you need to include them in your update folder. Here is how the system works for update folders.
So you have your first version of the plugin version 1.0 Build 1
Inside the update folder of your plugin you should have a folder named 1
The system will look for that folder depending on the build in your plugin xml file.
BUT WAIT IMPORTANT the folder name cannot be greater than the build number, and it must be greater than the last build.
If you start off correctly youll be fine.
Example:
Build 1 update folder/1 (name of folder inside the update folder)
Build 2 update folder/2 (name of folder inside the update folder)
and so on....
But lets say that you have a few updates and you get out of wack. As long as you keep the update folder name inside the update folder
greater than the last folder name - and NOT greater than the build number
you will be just fine.
so inside of pluginname/update you may have folder names
1
2
5
10
just remember the rule, larger than the last one, no greater than the current build number.
Now lets talk about what is inside those folders and why you should leave them there.
First you should never remove them because if someone is updating from an older version then they will need all those updates to run on their system.
Now inside those folders there is a update.php file. Even if you are not going to do anything inside of it just create it anyway and just put this inside it.
<?php
//nothing
that way its always there and the system knows you dont want to do anything with it.
Now also inside that folder is the langs.zip file if you have updates to the plugin language file.
So what you would do is add this line to your update php file
$config = OW::getConfig();
OW::getLanguage()->importPluginLangs(OW::getPluginManager()->getPlugin('your plugin name')->getRootDir().'update/the folder name/langs.zip', 'your plugin name');
//nothing further
and then just include the langs.zip in that folder and it will install it during the update.
We wont cover database updates today but inside your update.php file you also need to include all those things we asked at the start of this post, sql commands and such.
Hope this helps