Upgrade/Install: Use a clean plugin slug for the plugin details URL on the Updates screen#11798
Upgrade/Install: Use a clean plugin slug for the plugin details URL on the Updates screen#11798itzmekhokan wants to merge 1 commit into
Conversation
…n the Updates screen. 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. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
The
View version X details.link rendered bylist_plugin_updates()on the WordPress Updates screen uses$plugin_data->update->slugdirectly when building theplugin-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.
Trac ticket: https://core.trac.wordpress.org/ticket/65218