[issue-632] Add settings UI to toggle individual AI connector activation status#661
[issue-632] Add settings UI to toggle individual AI connector activation status#661farhanmaba wants to merge 5 commits into
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. |
|
This is ready :-) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #661 +/- ##
=============================================
+ Coverage 74.57% 74.68% +0.10%
- Complexity 1754 1757 +3
=============================================
Files 85 85
Lines 7548 7588 +40
=============================================
+ Hits 5629 5667 +38
- Misses 1919 1921 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dkotter
left a comment
There was a problem hiding this comment.
I think we need more discussion on this before proceeding.
My suggestion is this is something that should be added upstream to WordPress itself, as we aren't responsible for the Connectors API within this plugin.
That said, we have taken the approach of experimenting here to try and prove out ideas that may make their way upstream. If we want that here, I'd suggest we try integrating within the Connectors screen (if possible) instead of introducing new settings within the AI plugin
What?
Closes #632
Introduces toggles for each active AI connector in the General AI Settings page to easily activate or deactivate individual connectors without losing their saved credentials (e.g. API keys) in the database.
Why?
Currently, users cannot deactivate an active AI connector without removing its API key or configuration completely. When testing multiple providers (like OpenAI and Google), deleting keys makes it inconvenient to switch back and forth.
By introducing administrative toggles, users can temporarily disable a specific connector from being used by the AI plugin, while retaining the configured credentials in the background for quick reactivation later.
How?
wpai_connector_{$connector_id}_enabledfor each active connector dynamically inSettings_Registration.php.AI Connectorssection at the top of the AI Settings page inSettings_Page.php. Each connector maps to its toggle setting automatically via the existingDataFormconfiguration.has_connector_authentication(),is_connector_configured(), andget_ai_connectors()inhelpers.phpto respect the status of the toggle settings.tests/Integration/Includes/HelpersTest.phpto verify functionality.Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini Flash 3.5
Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.
Testing Instructions
Screenshots or screencast
Changelog Entry