Make WordPress Core

Opened 4 weeks ago

Last modified 2 weeks ago

#65909 new enhancement

Show “Activate” after updating an inactive plugin from the Add Plugins screen

Reported by: nithi22 Owned by:
Priority: normal Milestone: Awaiting Review
Component: Plugins Version:
Severity: normal Keywords: has-patch has-test-info has-screenshots
Cc: Focuses:

Description

When installing a new plugin from the Add Plugins screen, the “Install Now” button changes to “Activate” after installation completes.
However, when a plugin is already installed but inactive and has an update available in the Add Plugins screen:

  1. Go to Plugins → Add New.
  2. Search for an installed, inactive plugin with an available update.
  3. Click “Update Now.”
  4. After the update completes, the button does not change to “Activate.”
  5. The user must go to Plugins → Installed Plugins and activate it from there.

It would improve consistency and usability if the “Update Now” button changed to “Activate” after a successful update of an inactive plugin, matching the behavior after installing a new plugin.

Video Reference:- https://www.loom.com/share/cd0cfabf209f46d2b37559991e90a6b2

Attachments (1)

trac-65909-playground-activate.png (159.0 KB ) - added by arkaprabhachowdhury 2 weeks ago.
WordPress Playground evidence: the updated inactive plugin card changes to Activate.

Download all attachments as: .zip

Change History (4)

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


4 weeks ago
#1

  • Keywords has-patch added

## Trac Ticket
https://core.trac.wordpress.org/ticket/65909

## Description

When updating an inactive plugin from the Add Plugins screen (Plugins > Add New), the button currently remains as a disabled "Updated!" state. Users must navigate to the Installed Plugins screen to activate it.

This PR brings consistency with the plugin installation flow: after successfully updating an inactive plugin, the button changes to "Activate" (or "Network Activate").

### The Changes

  1. wp_ajax_update_plugin() (src/wp-admin/includes/ajax-actions.php):
    • Added activateUrl generation when the updated plugin is inactive and the current user has the activate_plugin capability (matching the logic in wp_ajax_install_plugin()).
  1. wp.updates.updatePluginSuccess (src/js/_enqueues/wp/updates.js):
    • Added a call to wp.updates.checkPluginDependencies() when response.activateUrl is present in the response.
  1. wp.updates.checkPluginDependenciesSuccess & wp.updates.checkPluginDependenciesError (src/js/_enqueues/wp/updates.js):
    • Extended selector matching and class removal to include .update-now alongside .install-now so update buttons seamlessly transform into .activate-now buttons.

### How to Test

  1. Ensure an inactive plugin with an available update is installed on the site.
  2. Navigate to Plugins > Add New.
  3. Search for the inactive plugin.
  4. Click Update Now.
  5. After the update completes, observe the button transition from "Updating..." → "Updated!" → "Activate".
  6. Click Activate to verify one-click activation works directly from the card.

Fixes #65909.

@arkaprabhachowdhury
2 weeks ago

WordPress Playground evidence: the updated inactive plugin card changes to Activate.

#2 @arkaprabhachowdhury
2 weeks ago

Test Report

Description

This report validates that the current patch for Trac #65909 addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/13163 at e4f5422d8cc25c0d94639b89f80aecd523f7dd1b

Environment

  • WordPress: 7.2-alpha-20260827.074207
  • PHP: 7.4.33
  • Server: PHP.wasm
  • Browser: Chromium
  • OS: Windows
  • Theme: Twenty Twenty-Five
  • MU Plugins: None activated
  • Plugins: Classic Editor 1.6.3, installed and inactive before testing

Steps to Test

  1. Install Classic Editor 1.6.3 without activating it.
  2. Open Plugins → Add Plugin and search for Classic Editor.
  3. Confirm Update Now is available for version 1.7.0.
  4. Click Update Now and wait for the update and dependency check to complete.
  5. Confirm the same card changes to Activate.
  6. Click Activate.

Expected Results

  • ✅ After an inactive plugin updates from Add Plugins, its card changes to an actionable Activate button.
  • ✅ Clicking Activate activates the plugin directly.

Actual Results

  • ✅ Classic Editor updated from 1.6.3 to 1.7.0.
  • ✅ The card changed to Activate after the dependency check.
  • ✅ Clicking Activate showed the “Plugin activated” notice and listed Classic Editor as active.

Supplemental Artifacts

Last edited 2 weeks ago by arkaprabhachowdhury (previous) (diff)

#3 @arkaprabhachowdhury
2 weeks ago

  • Keywords has-test-info has-screenshots added
Note: See TracTickets for help on using tickets.