Plugin SVN & update API – how are plugins identified?

When submitting a plugin, the slug becomes the sanitized plugin name, as submitted. The “Name” of the plugin can change after this, but the slug remains the same forever more.

When WordPress needs to check for a plugin update, it gets all the header information of the plugin and the directory name that the plugin is in, and sends that to WordPress.org.

Three factors are currently used to try to make a match against the plugins in the directory. Note that I say “currently”, because this changes every so often as we try to improve the matching algorithms.

  1. The plugin directory name is often the “slug” of the plugin. At least, it is if you installed it from the directory to begin with. So we check for a slug with that directory name. This is not a great indicator, but it helps.

  2. The “Name” in the plugin header is searched for as well, since Name must be unique in the plugin directory. If there is no match on that exact name, then the Name is sanitized to produce a slug, and we search for that slug as well, just in case. This doesn’t always work.

  3. The “Plugin URI” in the header is checked for a match as well. Since we know that value for all plugins in the directory, then that can be considered reasonably unique for each plugin. Thus, plugin authors are well advised to put in a Plugin URI that points to a domain they control and a URL that is unique to the plugin.

All three of these factors are then weighted, and the top result is returned. The weights used for each of the three reflect a confidence level in the accuracy of the data. For example, Name is weighted higher than the plugin-directory-as-slug, because most authors don’t change Plugin Names very often, and plugin-directory can actually be anything if the user installed it manually or something.

The closer the match to these three items, the more likely it is that that matches the plugin. But at least one exact match on these must be found for any result to be returned.

For custom one-off plugins, I tend to use the site name in the plugin name itself. This helps me with organization as well. So my one-off plugin name might be “ottopress.com – Fix issue with whatever”. Unlikely for any plugin in the directory to match your domain.

Leave a Comment