{"id":51183281,"url":"https://github.com/georgestephanis/connector-priority","last_synced_at":"2026-06-27T08:30:29.100Z","repository":{"id":359603771,"uuid":"1246769777","full_name":"georgestephanis/connector-priority","owner":"georgestephanis","description":"Drag-and-drop priority ordering for AI connectors on the WordPress Settings › Connectors screen","archived":false,"fork":false,"pushed_at":"2026-05-22T17:52:25.000Z","size":447,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2026-05-22T20:20:46.884Z","etag":null,"topics":["artificial-intelligence","drag-and-drop","gutenberg","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://github.com/georgestephanis/connector-priority","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgestephanis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-22T14:33:33.000Z","updated_at":"2026-05-22T17:52:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/georgestephanis/connector-priority","commit_stats":null,"previous_names":["georgestephanis/connector-priority"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/georgestephanis/connector-priority","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgestephanis%2Fconnector-priority","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgestephanis%2Fconnector-priority/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgestephanis%2Fconnector-priority/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgestephanis%2Fconnector-priority/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgestephanis","download_url":"https://codeload.github.com/georgestephanis/connector-priority/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgestephanis%2Fconnector-priority/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34847287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","drag-and-drop","gutenberg","wordpress","wordpress-plugin"],"created_at":"2026-06-27T08:30:28.430Z","updated_at":"2026-06-27T08:30:29.091Z","avatar_url":"https://github.com/georgestephanis.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connector Priority\n\n![Connector Priority](assets/banner-772x250.png)\n\n[![Try in WordPress Playground](https://img.shields.io/badge/Try%20in-WordPress%20Playground-3858e9?logo=wordpress\u0026logoColor=white)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/georgestephanis/connector-priority/trunk/.github/blueprint.json)\n\nA WordPress plugin that adds drag-and-drop priority ordering for AI connectors on the **Settings \u003e Connectors** screen introduced in WordPress 7.0.\n\n## What it does\n\nWhen multiple AI provider connectors are active (e.g. OpenAI, Anthropic, and Google are all connected), WordPress currently has no way to express which one should be preferred. This plugin adds:\n\n- A **\"Set AI Priority Order\"** button on the Connectors screen that opens a dedicated priority editor inside the same admin SPA.\n- A **drag-and-drop list** of all registered AI providers — drag to reorder, then click **Save Priority Order**.\n- The saved order is stored in the `wp_connector_priority_order` site option and exposed via the `/wp/v2/settings` REST endpoint.\n- Two public PHP functions for use by other plugins and themes:\n  - `wp_get_connector_priority_order()` — returns the full ordered list of connector IDs.\n  - `wp_get_preferred_ai_connector()` — returns the ID of the highest-priority AI connector that is currently active.\n\n## Requirements\n\n- WordPress 7.0 or later (requires the Connectors API and Boot module SPA).\n- At least one AI provider plugin installed (Anthropic, Google, OpenAI, or a third-party provider).\n\n## Installation\n\n1. Upload the `connector-priority` folder to `wp-content/plugins/`.\n2. Activate the plugin from **Plugins \u003e Installed Plugins**.\n3. Visit **Settings \u003e Connectors** — a \"Set AI Priority Order\" button will appear at the top of the connector list.\n\n## Usage\n\n1. Click **Set AI Priority Order** on the Connectors screen.\n2. Drag providers up or down to set your preferred order.\n3. Click **Save Priority Order**.\n\nThe saved order is immediately available via `wp_get_connector_priority_order()`.\n\n**Runtime enforcement (what works today):**\n- **Connectors screen UI** — the main connector list renders AI providers in your saved priority order.\n- **`ai` plugin features** — excerpt generation, content suggestions, alt-text, etc. respect the saved order via the `wpai_preferred_text_models`, `wpai_preferred_image_models`, and `wpai_preferred_vision_models` filters.\n\n**What still needs a core change:** Code that calls `wp_ai_client_prompt()` directly\n(outside the `ai` plugin) bypasses these filters. Full enforcement for all callers\nrequires upstream changes to `PromptBuilder`; see [CORE-CHANGES.md](CORE-CHANGES.md)\nfor proposed patches.\n\n## Developer API\n\n```php\n// Returns all connector IDs in priority order (padded with any unordered ones at the end).\n$order = wp_get_connector_priority_order();\n// → ['openai', 'anthropic', 'google', 'akismet']\n\n// Returns the ID of the highest-priority active AI connector, or null.\n$provider = wp_get_preferred_ai_connector();\n// → 'openai'\n```\n\n## Architecture notes\n\nSource JavaScript and CSS live in `src/`; built assets are committed to `build/` and served by WordPress. `npm run build` (webpack via `@wordpress/scripts`) bundles both JS entries as native ES modules so WordPress's Script Module system can load them with `type=\"module\"`. dnd-kit is bundled into the content file; React/ReactDOM are externalised to the WP page globals.\n\nThe drag-and-drop UI (`src/priority-content.js`) is a native ES module registered as a WordPress Script Module and mounted at the `/priority` route inside the existing connectors SPA. Navigation uses the Boot module's `?p=` path-parameter convention.\n\nSee [CORE-CHANGES.md](CORE-CHANGES.md) for a full description of the upstream WordPress core changes that would give this plugin complete end-to-end priority enforcement.\n\n## Development\n\n```bash\nnpm install          # install tooling\nnpm run build        # compile src/ → build/\nnpm run lint:js      # ESLint\nnpm run lint:css     # Stylelint\nnpm run lint:php     # PHPCS (requires composer install)\nnpm run format       # Prettier (JS + CSS)\nnpm run build-plugin # package a distributable zip\n```\n\n## License\n\nGPL-2.0-or-later — see \u003chttps://www.gnu.org/licenses/gpl-2.0.html\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgestephanis%2Fconnector-priority","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgestephanis%2Fconnector-priority","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgestephanis%2Fconnector-priority/lists"}