Repository navigation
Conversation
…allow plugin updates to come from an external-to-WordPress.org source. A plugin must handle this.
…-WordPress.org source where the slug field will not be set, but still show the plugin details.
…mpt this new branch of code.
|
@dd32 does this actually allow updates to plugins from 3rd party hosts? If yes, is it really useful given the restrictions in Guideline 8? https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/ Or am I misunderstanding it's utility outside of not updating a plugin with the same slug that is different from a plugin in the plugin directory? |
|
Is this PR more in line with what's suggested here? |
It does, but only if there's other code on the site to handle it. For example, a plugin can register itself as handling updates for
Since this should never be used by a WordPress.org hosted plugin, the guidelines aren't relevant.
The utility is that this is an abstracted API that allows two things:
Part two is mostly already solved, as there exist libraries and plugins which can do it now safely. |
|
hi @dd32 |
|
I hope this patch gets into WP 6.0 for themes |
This PR introduces a header that the WordPress.org plugins api will ignore for the purposes of plugin updates.
This PR doesn't touch themes, as this is proof-of-concept.
The
Update URIfield should:esc_url_raw()so custom scheme's are out.github://someone/somethingis not valid.https://some-url-that-will-never-exist-at-all-everormy-custom-plugin-nameare valid.Update URI: falseis valid, and unless code is handling the 'false' hostname, the plugin will never get an update notification.If present, the WordPress.org plugins API will currently not return a result for it, UNLESS, it matches the following format:
(This is alpha, so it's been added to the updates API but will be removed if this PR doesn't end up in WordPress.)
Included, is a filter which 3rd party plugins can use to offer updates for a given hostname (Yes, it's tied to a hostname), and they can return their plugin data blob and it should just work natively.
There's a few other small changes around WordPress not expecting that the
slugfield is always set, but that's the only real change to the rest of WordPress needed.Included is also an example plugin, whose Name + Author indicate that it's the WordPress.org Hello Dolly plugin.
When installed on...
Trac ticket: https://core.trac.wordpress.org/ticket/14179
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.