Make WordPress Core

Opened 3 years ago

Last modified 6 weeks ago

#59631 new defect (bug)

Despite using Update URI Plugin header, WP still tries to fetch the Update notes from WP org

Reported by: anonymized_14808221 Owned by:
Priority: normal Milestone: Awaiting Review
Component: Plugins Version: 5.8
Severity: normal Keywords: 2nd-opinion has-patch has-unit-tests
Cc: Focuses: administration

Description (last modified by alexstine)

Despite setting a ​Plugin Header Update URI directive WP still will try to fetch the Update information (changelog) from a WP Org plugin.

And when filtering the url with ​update_plugins_{hostname} , it will simply load an instance of the "Add new plugin" screen in the ThickBox loaded when clicking "View version vx.x.x details"

I am quite sure I do not miss anything, as I read through all the (undocumented) new feature announcements.

This is a minimal approach you need to replicate the issue:

  • Update plugin header directive to use Update URI: https://domain.tld
  • Either hook into update_plugins_{hostname} and pass a version higher than your currently installed one, or
  • Hook into pre_set_site_transient_update_plugins and pass a new new_version higher than your currently installed one

Of course make sure you do actually have a remote update to be shown.
==> You could also just edit the database entry of _site_transient_update_plugins to trigger the "has update" alert in the plugins list...

All this makes the Update URI pretty much dysfunctional (in the sense that it is not really useful at all) and the developer still needs to manually filter the ThickBox content for the "View update details" or even for the "Plugin details".
And the documentation about all this is either inexistent or very limited (opened a separate issue about that ​here

IMO, passing a custom Update URI should completely unhook all Callisto the WP Org Api and either not allow to "view details" at all, or at least provide some ways to populate that window with custom details (or at least read from the plugin data, which it does not: it reads from remote).

Change History (8)

This ticket was mentioned in ​Slack in #meta by bedas. ​View the logs.


3 years ago

This ticket was mentioned in ​Slack in #meta by bedas. ​View the logs.


3 years ago

#4 @dd32
3 years ago

  • Component General → Plugins
  • Version 6.3.3 → 5.8

This ticket was mentioned in ​Slack in #core by dd32. ​View the logs.


2 years ago

#6 @webdados
2 years ago

IMHO, setting the "Update URI" (to false for example), should deactivate any update or information request to the wordpress.org API.

On the wp_update_plugins routine, all the installed plugins are queried on wordpress.org, even if they're not part of the repo, and have specifically set Update URI as false (as mentioned here ​https://make.wordpress.org/core/2021/06/29/introducing-update-uri-plugin-header-in-wordpress-5-8/).

I suggest we make the "false" value on "Update URI" a clear instruction from the developer that the plugin does not belong to the repo and it should not be included in any API call whatsoever.

As we stand now, we might be creating serious confidentiality issues and even breaking the GDPR laws. If someone develops a private plugin for a company, there's not reason why .org should receive it's headers which may include information about the developer and the company that should not be shared by 3rd parties (in which case WordPress.org is the 3rd party).

This ticket was mentioned in ​PR #13928 on ​WordPress/wordpress-develop by ​@georgestephanis.


6 weeks ago
#7

  • Keywords has-patch has-unit-tests added

Plugins and themes whose Update URI header points outside WordPress.org can never receive an update from WordPress.org, but wp_update_plugins() and wp_update_themes() still send them, headers included, to api.wordpress.org. That discloses private and premium plugin/theme lists to a third party, which is a privacy (and potentially GDPR) concern for sites and for plugin vendors.

This omits any plugin or theme whose Update URI is set to something other than a WordPress.org URL, using the forms described in #950 (https://wordpress.org/{plugins,themes}/{slug}/ and w.org/{plugins,themes}/{slug}) as the "hosted on WordPress.org" patterns.

  • New private helper _wp_is_wporg_update_uri() decides whether a header value identifies a WordPress.org hosted item. It is deliberately permissive: if in doubt the item is still sent, which is today's behaviour.
  • wp_update_plugins() builds its payload (and the active list) from the remaining plugins only.
  • wp_update_themes() does the same. If the active theme is omitted, active is dropped too so its slug isn't disclosed.
  • Omitted items are still recorded in checked and still pass through update_plugins_{$hostname} / update_themes_{$hostname}, so third-party updaters are unaffected.

Not changed: the translations payload, which is keyed by text domain and still includes entries for omitted items. That can be a follow-up.

Open question: I could not verify server-side behaviour of the API (it isn't open source), including whether the themes endpoint tolerates a request with no active key.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Drafted the implementation, the PHPUnit tests, and this description. The work was done under the direction of a human, who reviewed the changes and takes responsibility for them.

---
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.

🤖 Generated with ​Claude Code

​@georgestephanis commented on ​PR #13928:


6 weeks ago
#8

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

oof, rate limited.

Note: See TracTickets for help on using tickets.