Skip to content

feat: add extended providers with WP 7.0 Connectors integration#269

Closed
Jameswlepage wants to merge 4 commits intoWordPress:developfrom
Jameswlepage:feature/7-0-core-ai-compat
Closed

feat: add extended providers with WP 7.0 Connectors integration#269
Jameswlepage wants to merge 4 commits intoWordPress:developfrom
Jameswlepage:feature/7-0-core-ai-compat

Conversation

@Jameswlepage
Copy link
Copy Markdown
Contributor

@Jameswlepage Jameswlepage commented Mar 5, 2026

Summary

  • Adds 9 extended AI providers (Cloudflare Workers AI, Cohere, DeepSeek, Fal.ai, Grok, Groq, Hugging Face, Ollama, OpenRouter) via the Extended Providers experiment
  • On WP 7.0+, registers these providers on Settings > Connectors with custom SVG icons, API key management via REST API, and provider-specific settings
  • Cloudflare: dual-field setup (Account ID + API Key)
  • Ollama: endpoint URL field instead of API key (local provider)
  • Fixes PHP 8.1+ setAccessible() deprecation in bootstrap.php
  • Fixes Ollama URL construction per PR Add Extended Providers experiment #148 review feedback

What's included

File Purpose
includes/Providers/*/ 9 provider implementations (27 files) from feature/providers
includes/Experiments/Extended_Providers/Extended_Providers.php Experiment class with connectors integration
build/connectors-extended.js Script module registering connectors with icons
includes/Experiment_Loader.php Register Extended_Providers experiment
includes/bootstrap.php PHP 8.1+ compat fix

How it works

  1. Extended Providers experiment registers provider classes with the AiClient registry
  2. On WP 7.0+, register_connector_settings() creates REST-accessible settings for each provider's API key
  3. connectors-extended.js imports from @wordpress/connectors and registers each provider with __experimentalRegisterConnector
  4. Provider metadata and icons render in the Connectors admin page alongside core's OpenAI/Claude/Gemini

Test plan

  • On WP 7.0 trunk, navigate to Settings > Connectors — all 12 providers should appear with icons
  • Enter an API key for an extended provider — it should save and show "Connected"
  • Cloudflare shows Account ID + API Key fields
  • Ollama shows Endpoint URL field
  • On WP 6.x with bundled client — extended providers still work via the existing credentials screen

🤖 Generated with Claude Code

Open WordPress Playground Preview

Jameswlepage and others added 4 commits February 20, 2026 14:02
Register 9 additional AI providers (Cloudflare Workers AI, Cohere,
DeepSeek, Fal.ai, Grok, Groq, Hugging Face, Ollama, OpenRouter)
through the Extended Providers experiment. On WP 7.0+, these appear
on Settings > Connectors with custom icons, API key management via
REST API, and provider-specific settings (Cloudflare Account ID +
API Key, Ollama endpoint URL).

- Copy provider classes from feature/providers branch
- Add connectors JS module with SVG icons for all 9 providers
- Register connector settings with show_in_rest for REST API access
- Bridge stored keys to AiClient registry
- Fix PHP 8.1+ setAccessible() deprecation in bootstrap.php
- Fix Ollama URL construction (PR WordPress#148 review feedback)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Jameswlepage <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Jameswlepage
Copy link
Copy Markdown
Contributor Author

Opened in error — this work belongs on #148. Closing.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 4.41791% with 1601 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.36%. Comparing base (4fbb197) to head (8957cf0).
⚠️ Report is 118 commits behind head on develop.

Files with missing lines Patch % Lines
...eriments/Extended_Providers/Extended_Providers.php 1.68% 292 Missing ⚠️
includes/bootstrap.php 10.86% 205 Missing ⚠️
...des/Providers/Cohere/CohereTextGenerationModel.php 0.00% 142 Missing ⚠️
...udes/Providers/Grok/GrokModelMetadataDirectory.php 0.00% 86 Missing ⚠️
...udflare/CloudflareWorkersAiTextGenerationModel.php 0.00% 80 Missing ⚠️
...udes/Providers/FalAi/FalAiImageGenerationModel.php 0.00% 77 Missing ⚠️
...des/Providers/Ollama/OllamaTextGenerationModel.php 0.00% 65 Missing ⚠️
...udes/Providers/Groq/GroqModelMetadataDirectory.php 0.00% 56 Missing ⚠️
.../Providers/Cohere/CohereModelMetadataDirectory.php 0.00% 45 Missing ⚠️
...oviders/Cloudflare/CloudflareWorkersAiProvider.php 0.00% 39 Missing ⚠️
... and 27 more
Additional details and impacted files
@@              Coverage Diff               @@
##             develop     #269       +/-   ##
==============================================
- Coverage      56.69%   38.36%   -18.33%     
- Complexity       505      911      +406     
==============================================
  Files             32       63       +31     
  Lines           2568     4548     +1980     
==============================================
+ Hits            1456     1745      +289     
- Misses          1112     2803     +1691     
Flag Coverage Δ
unit 38.36% <4.41%> (-18.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant