My plugin uses camelCase in file and folder like
myPlugin/myPlugin.php
I’ve encountered several issues with this on plugin updates. Most of them work just fine and it’s more a cosmetic thing but on some places I just like to go with all lowercase.
What’s the best way (or is there any) to update the plugin to
myplugin/myplugin.php
without hazzle the users?
Please note this is a custom plugin and not available on the repo and yes I had to do it lowercase in the first place.
If you just wanted to just change the filename you would have both myPlugin.php
and myplugin.php
in the plugin and then update the option active_plugins
in the database to the new name. Once all of the users have updated you can remove myPlugin.php
.
But you want to rename both the folder and filename.
I would get myPlugin/myPlugin.php
to install and activate myplugin/myplugin.php
. Once myplugin/myplugin.php
is installed myplugin/myplugin.php
can delete myPlugin/myPlugin.php
You can use TGM Plugin Activation for installing and activating the new plugin. Make to include a check so that the new and old version are not running at the same time.
You can use deactivate_plugins()
and delete_plugins()
to deactivate and uninstall the plugin.