diff --git a/package.json b/package.json index 1e792d9..6817f8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ultimate-ai-connector-compatible-endpoints", - "version": "1.1.0", + "version": "1.1.1", "private": true, "license": "GPL-2.0-or-later", "scripts": { diff --git a/readme.txt b/readme.txt index 37e932c..e02b045 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: superdav42 Tags: ai, connector, ollama, llm, local-ai Requires at least: 7.0 Tested up to: 7.0 -Stable tag: 1.1.0 +Stable tag: 1.1.1 Requires PHP: 7.4 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -73,6 +73,10 @@ Yes. WordPress 7.0 ships the AI Client SDK in core, so this connector plugin wor == Changelog == += 1.1.1 - Released on 2026-04-07 = + +* Fix: re-assert our `registerConnector()` call across multiple ticks (microtask + 0/50/250/1000 ms) so the WP core `registerDefaultConnectors()` auto-register can't clobber the custom card with the generic API-key UI. The two scripts can run in either order depending on dynamic-import resolution; this guarantees we end up last. The proper upstream fix is in https://github.com/WordPress/gutenberg/pull/77116 — once that ships in a Gutenberg release, this workaround can be removed. + = 1.1.0 - Released on 2026-04-01 = * Improved: Renamed plugin to "Ultimate AI Connector for Compatible Endpoints" for clarity and trademark compliance. diff --git a/src/index.jsx b/src/index.jsx index a737adb..722c3e2 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -400,10 +400,31 @@ function CompatibleEndpointConnectorCard( { slug, label, description } ) { // Register the connector card. // The slug matches the provider ID used in the PHP AI Client registry so that // this JS registration overrides the auto-discovered entry in WP 7.0+. -registerConnector( 'ultimate-ai-connector-compatible-endpoints', { +const SLUG = 'ultimate-ai-connector-compatible-endpoints'; +const CONFIG = { label: __( 'Compatible Endpoint' ), description: __( 'Connect to Ollama, LM Studio, or any AI endpoint using the standard chat completions API format.' ), render: CompatibleEndpointConnectorCard, -} ); +}; + +// WP core's `routes/connectors-home/content` module runs +// `registerDefaultConnectors()` from inside an async dynamic import. By the +// time it executes, our top-level registerConnector() has already populated +// the store — and the store reducer spreads new config over existing +// entries, so the default's `args.render = ApiKeyConnector` overwrites our +// custom render. The fix in WordPress/gutenberg#77116 will solve this in +// core, but until that lands and ships we re-assert our registration on +// multiple ticks (sync + microtask + setTimeout 0/50/250/1000ms) to +// guarantee we end up last regardless of dynamic-import resolution order. +function registerOurs() { + registerConnector( SLUG, CONFIG ); +} + +registerOurs(); +Promise.resolve().then( registerOurs ); +setTimeout( registerOurs, 0 ); +setTimeout( registerOurs, 50 ); +setTimeout( registerOurs, 250 ); +setTimeout( registerOurs, 1000 ); diff --git a/ultimate-ai-connector-compatible-endpoints.php b/ultimate-ai-connector-compatible-endpoints.php index 10fcd63..a2c17ca 100644 --- a/ultimate-ai-connector-compatible-endpoints.php +++ b/ultimate-ai-connector-compatible-endpoints.php @@ -4,7 +4,7 @@ * Description: Registers an AI Client provider for Ollama, LM Studio, or any AI endpoint using the standard chat completions API format. * Requires at least: 7.0 * Requires PHP: 7.4 - * Version: 1.1.0 + * Version: 1.1.1 * Author: Ultimate Multisite Community * Author URI: https://ultimatemultisite.com * License: GPL-2.0-or-later @@ -21,7 +21,7 @@ return; } -define( 'ULTIMATE_AI_CONNECTOR_COMPATIBLE_ENDPOINTS_VERSION', '1.1.0' ); +define( 'ULTIMATE_AI_CONNECTOR_COMPATIBLE_ENDPOINTS_VERSION', '1.1.1' ); // --------------------------------------------------------------------------- // Load function files (no SDK dependency).