Connector validity check assumes text generation, so speech-only and image-only connectors report as invalid
#933 opened on Aug 13, 2026
Repository metrics
- Stars
- (246 stars)
- PR merge metrics
- (Avg merge 5d 4h) (72 merged PRs in 30d)
Description
Description
has_valid_ai_credentials() decides whether any configured connector is valid by asking a single question: can it generate text? A site whose only connector is a speech or image provider is therefore told its connectors may be invalid, when they are correctly configured and working.
The notice shown is:
The AI plugin requires a valid AI Connector to function properly. Please review the AI Connectors you have configured to ensure they are valid.
That reads as "your connector is broken." The connector is fine; it simply does not do text.
Expected: the plugin explains that its features need a text-generation connector, and that the configured connector does not provide one.
Actual: a red error notice asking the user to review their connectors "to ensure they are valid."
Note the UI already distinguishes two cases — "no connectors configured" versus "configured but not valid" — and a non-text connector lands in the second. So the connector is detected correctly; it is the verdict and the wording that mismatch.
Step-by-step reproduction instructions
- Install WordPress 7.0.4 and the AI plugin 1.2.0, with no AI connector configured.
- Activate a connector plugin that registers a non-text capability only, and give it a working API key. I used an ElevenLabs provider registering
TEXT_TO_SPEECH_CONVERSIONandSPEECH_GENERATION. - Confirm in Settings → Connectors that the connector shows as Connected.
- Visit the AI plugin settings screen.
The red "ensure they are valid" notice appears.
Screenshots, screen recording, code snippet
Run against the environment above, with the connector configured and authenticated:
$p = wp_ai_client_prompt( 'Test' );
var_dump( $p->is_supported_for_text_generation() ); // false
var_dump( $p->is_supported_for_text_to_speech_conversion() ); // true
var_dump( WordPress\AI\has_valid_ai_credentials() ); // false
The connector is registered, authenticated, and usable for the capability it advertises. Only the text-generation question fails.
The verdict comes from includes/helpers.php, in has_valid_ai_credentials() (line 617 on develop at the time of writing):
// See if we have credentials that give us access to generate text.
try {
return wp_ai_client_prompt( 'Test' )->is_supported_for_text_generation();
} catch ( Throwable $t ) {
return false;
}
That result reaches the settings screen as PAGE_DATA.hasValidCredentials.
Why this may be worth separating
Most current features — alt text, summarisation, classification, comment moderation — genuinely do need text generation, so gating them is right. The issue is that a capability-specific requirement is reported as a global validity judgement.
This will affect more sites over time. The AI Client SDK defines capabilities for text-to-speech, speech generation, image generation, video generation, and embeddings, and connectors implementing the non-text ones are starting to appear. Any such connector, alone on a site, produces this notice.
There is precedent in this repository for a finer-grained approach: PR #679 ("Gate image generation UI on provider support detection") gates the image generation UI on whether a provider actually supports it, and PR #748 refined that detection. The global credentials check has not yet picked up the same capability awareness.
Possible directions, not prescriptive:
- Keep
has_valid_ai_credentials()as the "can this plugin do its text-based work" gate, but reword the notice to name the missing capability, e.g. "These features need a connector that generates text. Your configured connectors provide speech only." - Split the check: a connector is valid if it authenticates and registers any capability; sufficient for a feature is then decided per feature, the way image generation already is.
- Report per-capability status on the settings screen, so a site can see that speech is available even while text is not.
Happy to work on a PR if there is a preferred direction.
Environment info
- WordPress 7.0.4
- AI plugin 1.2.0. The same code is present on
develop, so this is not specific to the released version. - PHP AI Client 1.3.1 (bundled in core)
- Connector under test: a third-party ElevenLabs provider, v0.3.0
- Environment:
wp-env, block theme (Twenty Twenty-Five), Chrome on macOS
Confirmations
- Searched existing issues: yes. I looked for
valid connector,has_valid_ai_credentials, and capability/connector wording. The closest existing work is about whether credentials are present (#197, #534, #731, #799) rather than about a valid connector of a non-text modality, and PRs #603, #679, #748 on capability detection. I did not find an existing report of this behaviour, but I may have missed one. - Tested with all plugins deactivated except the AI plugin: not applicable, and I want to be straightforward about why rather than tick the box. This behaviour requires a second plugin — a connector — to be active. With every other plugin deactivated there is no connector at all, which produces the other branch of this notice ("Verify you have one or more AI Connectors configured"). The minimal reproduction is the AI plugin plus exactly one non-text connector.
- Theme type: Block.
AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5). Used for: reproducing the behaviour in a local wp-env environment, tracing it to has_valid_ai_credentials(), searching for duplicates, and drafting this report. The reproduction commands above were executed and their output is quoted verbatim.