wp-graphql / wp-graphql/wp-graphql
Extensions page: Install & Activate flows surface multiple errors (array_map fatal, plugin not found, invalid JSON, plugin file does not exist)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.8k
- Forks
- 472
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 85
Description
Problem
The Extensions page's Install & Activate flows surface multiple errors. Observed across two environments (local and deployed):
Environment 1:
- WPGraphQL for ACF card:
Uncaught Error: array_map(): Argument #2 ($array) must be of type array, null given in .../wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php on line 383rendered as the card's error notice after clicking Install & Activate - WPGraphQL Smart Cache card:
Plugin not found.
Environment 2:
- WPGraphQL for ACF card:
The response is not a valid JSON response. - WPGraphQL IDE card:
The response is not a valid JSON response. - WPGraphQL Yoast SEO Addon card:
Plugin file does not exist.(card still shows Install & Activate although the plugin appears to be installed)
In all cases the card button state does not reflect what actually happened, and the raw error strings (including a PHP fatal from WP core's REST plugins controller) are shown to the user as-is.
Suspected surfaces
- The install path proxies to the core
wp/v2/pluginsREST controller, and thearray_map(): Argument #2 must be of type array, null givenfatal comes from inside that controller, suggesting unexpected/null data for the plugin being installed (e.g. a wp.org API response shape issue or a plugin without the expected headers) Plugin file does not exist./Plugin not found.point at slug → plugin-file resolution in the activate flow (src/Admin/Extensions/Extensions.php)The response is not a valid JSON response.suggests the REST response contained PHP output/HTML, i.e. an underlying error leaking into the response body- Client-side handling in
packages/extensions/useInstallPlugin.jssurfaces raw error strings and doesn't reconcile card state after failures
Acceptance
- Install & Activate works for each extension in the official directory, from both not-installed and installed-but-inactive states
- Failures render user-friendly messages, never raw PHP fatals
- Card button/state reconciles with the actual plugin state after success and failure
- e2e coverage for the install and activate flows (these regressions are exactly what the widest-surface-first testing policy is for)
Related: #3203 (post-activation callback for extensions) touches the same flow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Install & Activate flows for installed and uninstalled extensions, then read src/Admin/Extensions/Extensions.php for slug-to-plugin-file resolution and packages/extensions/useInstallPlugin.js for client-side error and card-state handling. Use the reported REST errors to trace the install response, and add e2e coverage showing friendly failures and state reconciliation for each flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript, php
- Domain
- api, backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100