How to prepare (compress/zip) a plugin to enable updating instead of adding new instance?

I created my own plugins and install/update them by uploading the zip file in the dashboard. That worked well, but suddenly1 a new instance of the plugin gets added instead of updating the already installed one. Before WP would ask do you want to replace version X with version Y, but that dialog does not appear anymore.

I had this issue before, but back then I had the date and version in the name of the zip file. Ever since I always use the same name for the zip file (e.g. my-plugin.zip), it used to update the plugin.

Now WP creates new directories my-plugin-1, my-plugin-2, ... when updating.

Is there a best practice for creating the zip files?

What let's WP decide whether to install a new instance or update?

Update

It seems that it now works again as before, the zip files are recognizes as updates. I have no clue why it stop working nor why it started working again.

I would still be interested on how to best prepare (compress/zip) plugins to enable an update instead of adding a new instance.

Is it the name of the zip file? The name of the zipped folder? The name in the style.css manifest?


1 I'm sure there is a good reason for it, but I don't know yet what changed that caused this

Topic ziparchive plugin-development updates plugins Wordpress

Category Web


This is the default behaviour for WordPress. But there is a plugin called "Easy theme and plugin upgrades" that handles this for plugin and template updates: https://de.wordpress.org/plugins/easy-theme-and-plugin-upgrades/

After installing the plugin, you can just upload a new zip and it wont't install another plugin/theme instance. Instead, the plugin generates a backup of the older version and overwrites the plugin folder.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.