plugin-update-checker icon indicating copy to clipboard operation
plugin-update-checker copied to clipboard

Could you update other plugins from a separate plugin? And if so, could you install instead of only update if the code is not in the plugin being updated?

Open gerardreches opened this issue 4 months ago • 1 comments

First question

I was just wondering... Would it be possible to have a plugin taking care of updating the rest of plugins? Let me explain:

Traditional usage:

  • Plugin A contains the plugin-update-checker code in its main file so it checks for its own updates.

What I would like to do:

  • Plugin A optionally contains the plugin-update-checker code in its main file to get own updates.
  • Plugin A contains an additional instance of the plugin-update-checker code to check for plugin B's updates.
  • Plugin A contains yet another additional instance of the plugin-update-checker code to check for plugin C's updates.

Of course, we are assuming that you already have the public repositories or whatever option you chose for plugins B and C updates, and that your plugin A is doing the necessary checks to make sure plugins B and C are installed.

Because as long as I provide the plugin's slug and file path, it shouldn't matter where I place the PucFactory::buildUpdateChecker() method, is that correct?

Second question (only if what is asked in the first question is possible)

Taking it a step further, since the plugin-update-checker code (and library) would not be within the plugin to be updated, wouldn't that make it possible to not just update, but also install the plugins from the Updates page?

Maybe it would trigger some error since it can't check the installed version of the plugin (because it is not installed), but maybe an enhancement could make it possible.

gerardreches avatar Aug 13 '25 21:08 gerardreches

Yes, you can have a plugin that handles updates for other plugins. As you said, it doesn't matter where the buildUpdateChecker() method is placed. As long as you give it the correct file path and other details, it will work even if the path points to a different plugin. And you can create as many update checker instances as you need.

As for installing new plugins: PUC doesn't have that feature. It would probably require additional changes, not just an extension of the update mechanism. As far as I know, WordPress itself doesn't have a feature that would let you install new plugins from the "Updates" page. Either way, I think this would be outside the current scope of this library.

YahnisElsts avatar Aug 14 '25 08:08 YahnisElsts