Changing plugin slug with update

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.

Leave a Comment