Repository navigation
Add the Update URI header - #113
Merged
Merged
Conversation
Blockstudio is not on WordPress.org and the slug blockstudio is free there. Without the header, a plugin registered under that slug would be offered as an update to every site running Blockstudio. With an Update URI that does not point to WordPress.org, WordPress no longer asks WordPress.org about this plugin. Updates keep coming from the GitHub releases through the Plugin Update Checker, which adds them to the update transient itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blockstudio is not hosted on WordPress.org, and the slug
blockstudiois still free there (the plugin API answersPlugin not found). WordPress sends every installed plugin to the WordPress.org update check by its slug, so if someone registered a plugin namedblockstudiothere, WordPress would offer it as an update to every site running Blockstudio.WordPress 5.8 added the
Update URIheader for exactly this: "If the value of this new field matches any URI other thanhttps://wordpress.org/plugins/{$slug}/orw.org/plugin/{$slug}, WordPress will not attempt to update it." This PR addsI used the product domain because the dev note asks for a URI with a unique hostname.
https://github.com/inline0/blockstudiowould work too, but its hostname is shared with every other GitHub-hosted plugin.Updates from GitHub are not affected: the Plugin Update Checker adds its update in the
site_transient_update_pluginsfilter, independent of the WordPress.org request, and nothing hooksupdate_plugins_blockstudio.dev. Checked in a fresh WordPress (Playground, WordPress latest, PHP 8.4) with this branch installed as 7.7.0:get_plugin_data()returns the header, and after an update check the update transient offers 7.7.1 with theblockstudio.zipasset of the GitHub release. Must-use and Composer installs do not read plugin headers, so nothing changes there.