Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#65218 accepted defect (bug)

update-core.php - plugin slug is not clean

Reported by: timse201's profile timse201 Owned by: audrasjb's profile audrasjb
Milestone: 7.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

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 (4)

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


5 weeks 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 weeks ago

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

#3 @audrasjb
4 weeks ago

  • Milestone changed from Awaiting Review to 7.0.1
  • Version trunk deleted

#4 @audrasjb
4 weeks ago

  • Milestone changed from 7.0.1 to 7.1
  • Owner set to audrasjb
  • Status changed from new to accepted
Note: See TracTickets for help on using tickets.