Opened 5 months ago
Last modified 7 days ago
#65223 accepted defect (bug)
Connectors plugin install flow does not show filesystem credentials form when FTP is required
| Reported by: | ekamran | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | AI | Version: | 7.0 |
| Severity: | normal | Keywords: | has-test-info has-patch has-unit-tests |
| Cc: | Focuses: | javascript, administration |
Description
When installing a connector plugin from Settings > Connectors on a site that requires filesystem credentials, the install attempt fails with a generic notice instead of showing the standard "Connection Information" filesystem credentials form.
The regular Plugins > Add Plugin installer shows the credentials form correctly for the same plugin in the same environment.
Steps to Reproduce
- Install WordPress 7.0-RC3.
- Log in as an administrator.
- Force filesystem credentials, for example by setting FS_METHOD to ftpext in wp-config.php.
- Ensure the AI plugin is installed and active.
- Ensure one connector provider plugin is not installed, for example ai-provider-for-anthropic.
- Go to Settings > Connectors.
- Click Install for Anthropic.
Actual Results
The page stays on Settings > Connectors and shows a generic notice:
Failed to install plugin for Anthropic.
No filesystem credentials modal is shown.
Expected Results
The Connectors install flow should surface the standard WordPress "Connection Information" modal so the administrator can enter FTP credentials, matching the behavior of Plugins > Add Plugin.
Control Test
Using the same environment and the same plugin:
- Go to Plugins > Add Plugin.
- Search for ai-provider-for-anthropic.
- Click Install Now.
This correctly opens the "Connection Information" dialog with Hostname, FTP Username, FTP Password, and Connection Type fields.
Environment
WordPress: 7.0-RC3
AI plugin: 0.9.0
Connector tested: AI Provider for Anthropic 1.0.2
Filesystem method: ftpext
Environment: Local Docker wp-env
Notes
This appears to affect the Connectors page install flow that uses the REST plugin save flow. The standard plugin installer handles the filesystem credentials case correctly, so this may need special handling in the Connectors install action.
Attachments (3)
Change History (25)
#2
@
5 months ago
The actual work for this would need to be done in the Gutenberg repo. For a recent PR touching these files, see https://github.com/WordPress/gutenberg/pull/77521
See also https://github.com/WordPress/wordpress-develop/pull/11779
#3
@
5 months ago
Confirmed the bug on WordPress 7.0-RC3. No patch exists yet — I'm looking into the Connectors install flow in Gutenberg. The relevant files appear to be touched in gutenberg/pull/77521. Will follow up with a patch if feasible.
#4
@
5 months ago
In order to test this out myself, I wanted to ensure that my wordpress-develop environment was configured with a live FTP filesystem method. I created a repo with instructions for how to set this up: https://github.com/westonruter/wordpress-develop-ftp-fs
With that active, I can confirm when attempting to install the Open AI provider I get an error:
Failed to install plugin for OpenAI.
Note: Make sure the ftp_credentials is deleted in WordPress options to ensure the credentials dialog is opened.
#5
@
5 months ago
Thanks for confirming this.
I re-tested this against WordPress 7.0-RC4 and can still reproduce the same behavior with FS_METHOD set to ftpext.
In this setup, the standard Plugins > Add Plugin flow opens the expected “Connection Information” FTP credentials modal, but installing a provider from Settings > Connectors still stays on the Connectors screen and shows the generic error notice instead.
I’m happy to help test a patch for this flow, or help with a Gutenberg-side fix if that would be useful.
#6
@
5 months ago
- Keywords has-patch added; needs-patch removed
@ekamran Thanks!
I have created a Gutenberg PR (with the help of Claude): https://github.com/WordPress/gutenberg/pull/78367
Please test.
#8
@
5 months ago
Patch Testing Report:
Patch Tested: https://github.com/WordPress/gutenberg/pull/78367
The environment I am using below:
- PHP: 8.2.x
- WordPress: 7.0-RC4
- Web server: Apache
- Database: MySQL
- Browser: Chrome
- OS: Windows 11
- Theme: Twenty Twenty-Five
Steps I followed:
- Installed WordPress 7.0-RC4 and logged in as an Administrator.
- Forced filesystem credentials by setting FS_METHOD to ftpext in the wp-config.php file.
- Verified that the AI plugin was installed and active, while the ai-provider-for-anthropic plugin was not yet installed.
- Navigated to Connectors and clicked the Install button for Anthropic.
Result:
- Before applying the patch, I encountered the error: "Failed to install plugin for Anthropic."
- After applying the patch, the FTP credentials modal appeared correctly when clicking the Install button for Anthropic.
#9
@
5 months ago
I re-tested the latest Gutenberg PR branch locally with FS_METHOD set to ftpext.
After rebuilding the Gutenberg assets, I can confirm the filesystem credentials modal now appears for both flows I checked:
- Installing a provider connector from Settings > Connectors.
- Installing the AI plugin from the top callout on Settings > Connectors.
I also noted a failing targeted unit test on the Gutenberg PR itself, so I left the detailed test output there to keep the code-specific discussion on GitHub.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
5 months ago
#12
@
5 months ago
This will be fixed by this Gutenberg PR: https://github.com/WordPress/gutenberg/pull/78367
@wildworks @westonruter do you think this one is realistic for 7.0 final RC scheduled today? I'd say we can fix this in 7.0.1.
#13
@
5 months ago
- Milestone 7.0 → 7.0.1
As per today's bug scrub and according to @wildworks's feedback, I'm moving this ticket to 7.0.1 as it will need more review and work.
#14
@
5 months ago
Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.
#15
@
4 months ago
@audrasjb does this ticket still need more testing, or has it been fixed by the Gutenberg PR https://github.com/WordPress/gutenberg/pull/78367 you shared?
This ticket was mentioned in Slack in #core by masteradhoc. View the logs.
4 months ago
#17
@
3 months ago
- Milestone 7.0.1 → 7.0.2
As the RC for WP 7.0.1 is expected to land tomorrow we'll have to punt this to 7.0.2.
#18
@
3 months ago
Reproduction Report
Environment
The environment I am using below:
Steps taken
- Added define( 'FS_METHOD', 'ftpext' ); to wp-config.php (no FTP credentials defined)
- Logged in as Administrator on WordPress 7.1-alpha
- Navigated to Plugins > Add New and attempted to install Hello Dolly, FTP credentials modal appeared correctly
- Navigated to Settings > Connectors
- Clicked Install for OpenAI connector
- 🐞 Bug occurs
Expected behavior
- The FTP/Connection Information modal should appear on Connectors when installing a provider plugin, same as Plugins > Add New
Actual behavior
- On Connectors: snackbar error "Failed to install plugin for OpenAI." with no credentials modal
- On Plugins > Add New: credentials modal appears as expected (control test)
Additional Notes
- Local Sites environment (nginx, PHP 8.2)
- FS_METHOD correctly forces FTP mode, confirmed via Plugins > Add New control test
Screenshots/Screencast with results
- Screenshot 1: https://prnt.sc/bJRn_yOFGzvh > Add New (Hello Dolly)
- Screenshot 2: https://prnt.sc/9l2vQ8A92FJS > Error on Connectors page (OpenAI Install)
#20
@
3 months ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/78367
Environment
- WordPress: 7.0-RC3
- Subdirectory: No
- PHP: 8.3.32
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 150.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- Test Reports 1.3.0
- WordPress Beta Tester 4.0.0
Steps taken
- Configured the file system method by adding
define( 'FS_METHOD', 'ftpext' );inwp-config.php. - Applied pull request / patch #78367 in the testing environment.
- Logged into the WordPress admin dashboard as an administrator.
- Ensured the core AI plugin was active and the AI Provider for Anthropic plugin was uninstalled.
- Navigated to Settings > Connectors and clicked the Install button for Anthropic.
- Handled the filesystem credentials prompt when required.
- Verified that the plugin installed successfully and the API Key input field appeared correctly.
- Patch is solving the problem
Expected result
- The Connectors installation flow should successfully handle filesystem credentials when required and proceed to install the plugin, revealing the API key configuration field.
Actual Results
- The patch works as expected. The plugin installed successfully through the Settings > Connectors flow under a restricted filesystem method, and the API Key input field appeared correctly.
Additional Notes
- Tested pull request #78367.
Screenshots/Screencast with results
- Yes
Support Content
- N/A
This ticket was mentioned in PR #13953 on WordPress/wordpress-develop by @sheldorofazeroth.
7 days ago
#22
- Keywords has-unit-tests added
When the filesystem method requires credentials that are not stored (for example, FS_METHOD is ftpext), installing a connector plugin from Settings > Connectors fails with "Failed to install plugin for X." The REST API plugins endpoint rejects the request up front (fs_unavailable) and cannot take credentials. Plugins > Add Plugin works in the same environment because it uses wp.updates.installPlugin(), which shows the "Connection Information" modal.
The Gutenberg PR changes the Connectors client to install through wp.updates.installPlugin() when credentials are needed. This PR adds the server-side pieces that flow needs:
src/wp-admin/options-connectors.php: enqueues theupdatesscript and printswp_print_request_filesystem_credentials_modal()andwp_print_admin_notice_templates(), the same wayplugin-install.phpandimport.phpdo. The modal is only printed when credentials are actually required.src/wp-includes/connectors.php: adds afilesystemCredentialsRequiredflag to the Connectors script module data. It istrueonly when the filesystem method is notdirectand no credentials are stored. This is the same checkWP_REST_Plugins_Controller::is_filesystem_available()uses, so the client switches towp.updatesin exactly the cases where REST would fail.- Tests: covers the flag for
direct, for a non-direct method without stored credentials, and for a non-direct method with stored credentials.
The PHP changes do nothing on their own. They take effect once the Gutenberg change lands and the pinned Gutenberg hash is bumped. Until then, the extra script and markup on this screen are inert.
Testing Instructions
Automated:
npm run test:php -- --group connectors
Manual (needs the Gutenberg change from WordPress/gutenberg#78367 in the build):
- Set
define( 'FS_METHOD', 'ftpext' );inwp-config.php, and do not store FTP credentials. - Make sure the AI plugin is active and a provider plugin (for example,
ai-provider-for-anthropic) is not installed. - Go to Settings > Connectors and click Install for that provider.
- Expected: the "Connection Information" modal opens. Valid credentials install and activate the plugin. Cancel aborts with no error notice.
- Remove the
FS_METHODline and repeat. The install goes through REST with no modal, as before.
Server-side check without the Gutenberg change: with FS_METHOD set to ftpext, the Connectors page source contains #request-filesystem-credentials-dialog and "filesystemCredentialsRequired":true. With direct, there is no modal and the flag is false.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: https://github.com/WordPress/gutenberg/issues/77352
If we can't fix this for 7.0 properly, at least we could treat a
FS_METHODofftpextas being the same asDISALLOW_FILE_MODS.