Make WordPress Core

Opened 4 months ago

Last modified 6 weeks ago

#65218 accepted defect (bug)

update-core.php - plugin slug is not clean

Reported by: timse201 Owned by: audrasjb
Priority: normal Milestone: Future Release
Component: Administration Version:
Severity: normal Keywords: has-patch early
Cc: Focuses:

Description

The plugin slug we use to generate the link is not clean on update core. It includes the parent folder. e.g. /plugin/plugin.php. The API is smart enough to redirect to the en_us page.
On the plugins screen, we use a clean one.

$plugin_data->update->slug

https://github.com/WordPress/wordpress-develop/blob/5e7fd3f6a7caf06e55b4b2781bd42a26165e5b3e/src/wp-admin/update-core.php#L570

Change History (6)

This ticket was mentioned in PR #11798 on WordPress/wordpress-develop by @khokansardar.


4 months ago
#1

  • Keywords has-patch added

The View version X details. link rendered by list_plugin_updates() on the WordPress Updates screen uses $plugin_data->update->slug directly when building the plugin-install.php?tab=plugin-information&plugin=... URL. In some cases this value is empty or includes the parent folder (e.g. plugin/plugin.php) instead of a clean plugin slug, producing a malformed details URL. The api.wordpress.org redirects mask this, but the URL is still incorrect and inconsistent with the link rendered on the Plugins screen.

This adds a small defensive fallback that derives the slug from the plugin directory name (matching the pattern already used in WP_Plugin_Upgrader) whenever the update response does not provide a clean slug.

Props timse201.
See #65218.

#2 @audrasjb
4 months ago

Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.

#3 @audrasjb
4 months ago

  • Milestone Awaiting Review7.0.1
  • Version trunk

#4 @audrasjb
4 months ago

  • Milestone 7.0.17.1
  • Owner set to audrasjb
  • Status newaccepted

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


6 weeks ago

#6 @adrianduffell
6 weeks ago

  • Keywords early added
  • Milestone 7.1Future Release

This was discussed in today's bug scrub. I’d like to punt it since 7.1 RC 1 is due in about 48 hours time. It looks valuable to fix soon, so tagging with early for consideration in 7.2.

Last edited 6 weeks ago by adrianduffell (previous) (diff)
Note: See TracTickets for help on using tickets.