1

I've made a plugin which I will give to some users to test by manually uploading the zip file. I later on want to host the plugin in the WordPress.org plugin directory, but I want to avoid users having to uninstall my plugin to install the directory-hosted one because I have code in my uninstaller that deletes all of the terms, etc. that my plugin adds.

Is there a way to make WordPress track a plugin in the official directory instead of a locally uploaded zip?

1
  • 1
    Literally all you need to do to receive updates via .org is to have the same name as a plugin hosted in the .org repository. So as long as your manually uploaded version has the same directory name and a lower version number your users will get updates from the repository when you host it there. Jan 10, 2019 at 23:54

2 Answers 2

1

As long as everything was made according to WP best practices all your manually installed versions will update the same as the ones installed from wordpress.org.

The updater looks at many things to identify your plugin. However, the most important is the plugin URI (you can change the directory of many plugins and they will still work), but the name and slug are also checked. After WP detects that it has a matching plugin it will check the version and send out update information as needed.

Edit 1 Based on a little more research, I see that the update check seems to be done by wordpress.org at this url: http://api.wordpress.org/plugins/update-check/1.1/ to see how the call is structured you can look at the core code for wp_update_plugins().

The reason your manually installed plugin will update is the same as the reason you can manually download and install a plugin from wordpress.org and see it recieve updates in the wp-admin.

5
  • Do you know where in the source code the checks that you mention are made? I looked in update.php and can't find such checks.
    – Sean
    Jan 12, 2019 at 11:13
  • It's my understanding that the update process in WP only looks at the WP repository. If the plugin is not there, then Update won't see it. Unless you do the setup for the local update, as mentioned in my answer. But it is tricky to set up. Once done , though, the WP update process will look at your 'private' repository to do the updates. I use it for a private plugin I use on many sites I manage. Jan 13, 2019 at 3:33
  • @RickHellewell I believe the OP wants to install the plugin manually on sites, and then have it update once the plugin is on wordpress.org. I'm not sure how a 'private' repository is relevant. Can you please help me understand? Jan 14, 2019 at 1:46
  • 1
    @Sean I belive the code that makes the checks is actually done here: http://api.wordpress.org/plugins/update-check/1.1/. You can see how the call is structured in the source for this function: developer.wordpress.org/reference/functions/wp_update_plugins Jan 14, 2019 at 2:00
  • @JustinWaulters I originally read the question as wanting to get updates from other than the repository. Looks like I may have gotten it backwards. Assuming that the plugin name and installed folder doesn't change due to where it gets put into the WP repository, then updates should happen normally. Jan 14, 2019 at 3:07
1

There is a way to have a privately-hosted plugin folder that will get updated via the normal Admin, Updates process. It's a bit complex to set up, but I have done it.

The info is here: https://github.com/YahnisElsts/plugin-update-checker#github-integration .

I modified it to use a private area of a domain I own to be the code repository.

1
  • Good to know! I may use this if my plugin can't be hosted on WordPress.org for some reason.
    – Sean
    Jan 12, 2019 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.