#50034 closed defect (bug) (invalid)
Plugin with name conflict is being deleted on scheduled plugins update
Reported by: | apedog | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
I have a custom plugin configured to update from a github repo.
Since its creation, another plugin with the same name/slug has been added to WordPress plugins repository.
My plugin is set to auto-update (using Easy Updates Manager). It has no recent updates so should remain unchanged.
However on daily auto-update Cron schedule, the plugin is being deleted. And I am unceremoniously greeted with the following error notice:
The plugin has been deactivated due to an error: Plugin file does not exist.
Most probably because of name conflict with the plugin in the WordPress repo. At least I assume that's the reason.
Possible fix: Introduce a plugin header field telling WP to never associate the plugin with the WP.org plugins repo. This should work whether plugin is activated or not. ie. without requiring the plugin itself to hook into WordPress core functionality to avert its deletion.
* WordPress Repository: false
Or some other more elegant naming convention. Like:
* Plugin Repository: github.com | wordpress.org
The later would even be more extensible.
Change History (5)
#2
@
21 hours ago
That's not a proper solution.
I've already had this happen to me twice - where a small plugin I wrote was superseded by another plugin using the same generic slug (usually with similar functionality too).
Core should supply a plugin author with a way to ensure against such deletion. I write a plugin for a client. It works fine for years - then one day someone adds a plugin to WP.org repo with the same name and - *poof* - the plugin is magically disappeared from my client's site.
I'd reconsider setting the severity to 'major'...
#3
@
19 hours ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
#4
@
8 hours ago
- Resolution duplicate deleted
- Status changed from closed to reopened
First off I'd like to admit an embarrassing fact..
The plugin slug conflict did NOT cause the deletion of my plugin on auto-update.
My plugin was configured to update from github - and wp core respected that.
What happened was that I had accidentally moved the plugin inside another plugin's directory. (I believe wp also looks one directory down the hierarchy - so it was still available on the Plugins page as it always had been). My plugin was deleted when its "parent" plugin had auto-updated.
Unfortunately if your non-dot org plugin has an identical slug to a plugin on dot org and the version number is higher on dot org then your plugin will be updated with the dot org plugin.
You can either create a version number that's much higher than the one on dot org or use a different updater for your plugin. GitHub Updater has a filter to override an identical slug from dot org updating on top of your plugin.