Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
25 changes: 23 additions & 2 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
4 changes: 2 additions & 2 deletions ultimate-ai-connector-compatible-endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use this version constant to invalidate the connector bundle.

inc/admin.php:14-32 still passes '1.0.0' to wp_register_script_module() for build/connector.js. That lets upgraded sites keep a cached pre-1.1.1 bundle, so the new re-registration logic may never run and the generic API-key card can still appear until caches expire.

Suggested change in inc/admin.php
-		'1.0.0'
+		ULTIMATE_AI_CONNECTOR_COMPATIBLE_ENDPOINTS_VERSION
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ultimate-ai-connector-compatible-endpoints.php` at line 24, Update the script
registration to use the version constant instead of the hard-coded '1.0.0':
replace the literal version passed to wp_register_script_module for the
build/connector.js registration in inc/admin.php with
ULTIMATE_AI_CONNECTOR_COMPATIBLE_ENDPOINTS_VERSION so caches are invalidated
when the constant changes; ensure the call that registers the connector script
(wp_register_script_module for 'build/connector.js' or the corresponding handle
name) uses that constant for its $ver argument.


// ---------------------------------------------------------------------------
// Load function files (no SDK dependency).
Expand Down
Loading