feat: add settings import/export functionality#734
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
The failing JavaScript quality check is due to a conflict between eslint and typescript. While eslint prefers dot notation, typescript complains about it (TS4111). Should I suppress the eslint error? |
We do have a number of these that we already ignore with inline statements so I think that's fine |
What?
Closes #191
This PR implements the ability to export and import non-sensitive AI configuration settings and introduces a dedicated AI section in WordPress Site Health.
Why?
Allowing users to move AI configurations between environments (e.g., staging to production, multi-site etc.) improves the developer experience. By excluding sensitive credentials from the export, we ensure security while maintaining portability. The Site Health integration provides administrators with a quick overview of the plugin's status and credential health.
How?
includes/REST/Settings_IO_Controller.phpto handleGET /ai/v1/settings/exportandPOST /ai/v1/settings/import.SENSITIVE_PATTERNSfiltering to ensure API keys, tokens, and secrets are never exported or overwritten during import.includes/Admin/Site_Health.phpto provide debug information (version, enabled features, credential status) and a status test for connectivity.routes/ai-home/stage.tsx.tests/Integration/Includes/REST/Settings_IO_ControllerTest.phpandtests/Integration/Includes/Admin/Site_HealthTest.php.Use of AI Tools
AI assistance: Yes
Tool(s): GitHub Copilot
Model(s): Claude Sonnet 4.6, GPT-4o
Used for: Authoring the codebase exploration, UI components, and the integration test suite.
Testing Instructions
Screenshots or screencast
Menu Items:

Confirmation prompt before completing import:

Changelog Entry