Opened 6 months ago
Closed 5 months ago
#61294 closed defect (bug) (fixed)
Plugin Dependencies: Ensure dependency detection for newly installed plugins
Reported by: | costdev | Owned by: | hellofromTonya |
---|---|---|---|
Milestone: | 6.5.4 | Priority: | normal |
Severity: | normal | Version: | 6.5 |
Component: | Plugins | Keywords: | has-patch has-testing-info commit fixed-major dev-reviewed |
Focuses: | Cc: |
Description
[57658] removed auto-deactivation and bootstrapping logic from the Plugin Dependencies feature. In doing so, initialization calls were added to various locations in Core to ensure dependencies were detected and ready to be checked. However, an initialization call was missed in the AJAX callback before checking plugin dependencies.
This means that a plugin's dependencies may not be detected, and lead to a false positive, which in turn allows the user to click Activate
only to see a failure message.
Steps to reproduce
- Go to
Plugins > Add New Plugin
. - Search
WooCommerce
, and find a plugin that requires it. - Click on WooCommerce's "More details" link in the "Additional plugins are required" notice.
- Click
Install Now
in the modal. - Close the modal.
- Refresh.
- Click
Install Now
on the dependent. - 🐞 Once installed, it'll have a clickable
Activate
button, and when clicked, will fail. - 🐞 Opening DevTools > Network, the final admin-ajax.php entry will show a response including "This has no required plugins", which is obviously incorrect.
When testing a patch to validate it works as expected:
- ✅ The
Activate
button should not be clickable.
Change History (14)
This ticket was mentioned in PR #6630 on WordPress/wordpress-develop by @costdev.
6 months ago
#1
#3
@
5 months ago
Aha, that's why I kept seeing "Activation failed" state rather than the "Activate" button being unavailable, i.e. when testing #61269.
#4
@
5 months ago
- Keywords needs-testing removed
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/6630
Steps to Reproduce or Test
Starting state: WooCommerce is installed, but not activated.
I tested this as part of my #61269 testing.
- Click
Install Now
on any of the plugins requiring WooCommerce as their dependency. - 🐞 Once installed, it'll have a clickable
Activate
button, and when clicked, will fail. - 🐞 Opening DevTools > Network, the final
admin-ajax.php
entry will show a response including "This has no required plugins", which is obviously incorrect.
Expected Results
When testing a patch to validate it works as expected:
- ✅ The "Activate" button should be disabled.
When reproducing a bug:
- ❌ 🐞 Once installed, it'll have a clickable
Activate
button, and when clicked, will fail. - ❌ 🐞 Opening DevTools > Network, the final
admin-ajax.php
entry will show a response including "This has no required plugins", which is obviously incorrect.
Environment
OS: macOS
Browser: Firefox 126.0
Web server: nginx
PHP: 8.3
Installed Plugins: WooCommerce 8.9.1
Activated Plugins: none
Theme: TT4
Actual Results
When reproducing a bug/defect:
- ❌ 🐞 After installing any of the WooCommerce add-ons that require WooCommerce to be activated first, the
Activate
button is available and, after clicking, fails with a "Activation failed." error.
When testing the bugfix patch:
- ✅ Issue resolved with patch.
I'm able to reproduce the reported issue. Confirmed the patch resolves it.
#5
@
5 months ago
- Keywords commit added
Patch: https://github.com/WordPress/wordpress-develop/pull/6630
LGTM and is ready for commit.
#6
@
5 months ago
- Owner set to hellofromTonya
- Status changed from new to reviewing
Self-assigning for commit after thumbs up to include in 6.5.4 from @jorbin.
@hellofromTonya commented on PR #6630:
5 months ago
#8
#10
@
5 months ago
- Keywords dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for 2nd committer sign-off to backport [58252] to the 6.5-branch.
@hellofromTonya commented on PR #6630:
5 months ago
#11
Committed via https://core.trac.wordpress.org/changeset/58252.
Additional props to @kevinwhoffman for discovering this issue and @afragen for early testing of the patch.