Skip to content

Upgrade/Install: Link to Plugins page after uploading a plugin zip - #14236

Open
wprashed wants to merge 1 commit into
WordPress:trunkfrom
wprashed:fix/66186-plugin-upload-return-to-plugins-page
Open

wprashed wants to merge 1 commit into
WordPress:trunkfrom
wprashed:fix/66186-plugin-upload-return-to-plugins-page

Conversation

@wprashed

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66186


Description

When a plugin is installed by uploading a zip file (Plugins > Add New Plugin > Upload Plugin), the installation result screen shows an "Activate Plugin" button and a secondary "Go to Plugin Installer" link pointing to plugin-install.php.

In [37221] (#35429), the upload form was moved into the Add Plugins screen and an 'upload' === $this->type && 'plugins' === $from branch was added to send users back to where the form now lives. However, users who just uploaded a plugin zip file do not need to browse the plugin directory next; they need to manage their installed plugins on the Plugins page (plugins.php), matching how theme uploads work in Theme_Installer_Skin.

Solution

Remove the 'upload' === $this->type && 'plugins' === $from branch from Plugin_Installer_Skin::after(). Uploads now fall through to the default "Go to Plugins page" (plugins.php) link. Installs from the WordPress.org directory ('web' === $this->type) continue to show "Go to Plugin Installer".

How to test

  1. Go to Plugins > Add New Plugin > Upload Plugin and upload a valid plugin zip file.
  2. On the installation result screen, verify that the secondary link now reads "Go to Plugins page" and points to plugins.php.
  3. Install a plugin directly from the WordPress directory (with JS disabled or via update.php?action=install-plugin) and verify that it still shows "Go to Plugin Installer".

When a plugin is installed via zip upload (Plugins > Add New Plugin > Upload Plugin), the installation result screen previously linked back to the Plugin Installer (`plugin-install.php`).

In [37221] (#35429), the upload form was moved into the Add Plugins screen and an `'upload' === $this->type && 'plugins' === $from` branch was added to send users back to the screen where the form was placed. However, users who upload a zip file have already acquired the plugin and do not need to browse the directory next; they need to manage their installed plugins on the Plugins page (`plugins.php`), matching the behavior of theme uploads in `Theme_Installer_Skin`.

This removes the dedicated `'upload' === $this->type && 'plugins' === $from` branch in `Plugin_Installer_Skin::after()`, so uploads fall through to the default "Go to Plugins page" (`plugins.php`) link. Directory installs ('web') still link to "Go to Plugin Installer".

Props wprashed.
Fixes #66186.
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props wprashed.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant