The Abilities Explorer experiment provides an admin interface for discovering, inspecting, testing, and documenting all abilities registered via the WordPress Abilities API. It adds a menu item ("Abilities Explorer") under the "Tools" menu in the WordPress admin that displays a searchable, filterable table of all registered abilities with the ability to view details and invoke abilities directly from the UI.
When enabled, the Abilities Explorer adds an "Abilities Explorer" menu item under the "Tools" menu in the WordPress admin sidebar. This provides:
Key Features:
- Dashboard with statistics showing total abilities by provider (Core, Plugin, Theme)
- Searchable, sortable table of all registered abilities
- Filter abilities by provider type
- Detailed view for each ability showing input/output schemas
- Built-in test runner to invoke abilities with custom JSON input
- JSON validation against input schemas
- Copy-to-clipboard functionality for schemas
The experiment consists of four main classes:
- Abilities_Explorer (
Abilities_Explorer.php): Main experiment class handling registration and asset loading - Admin_Page (
Admin_Page.php): Manages admin menu, page rendering, and AJAX handlers - Ability_Handler (
Ability_Handler.php): Interfaces with the WordPress Abilities API to fetch, format, validate, and invoke abilities - Ability_Table (
Ability_Table.php): ExtendsWP_List_Tablefor the abilities listing
WordPress\AI\Experiments\Abilities_Explorer\Abilities_Explorer::register()wires everything once enabled:admin_enqueue_scripts→ enqueues JS/CSS on thetoplevel_page_ai-abilities-explorerscreenadmin_menu→ adds the top-level "Abilities" menu pagewp_ajax_ai_ability_explorer_invoke→ handles AJAX ability invocation
-
PHP Side:
enqueue_assets()loadsexperiments/abilities-explorerbundle and localizeswindow.AbilityExplorerwith:enabled: Whether the experiment is enabledajaxUrl: WordPress AJAX URLnonce: Security nonce for AJAX requestsstrings: Localized UI strings
-
JavaScript Side:
- Handles test runner functionality (invoke, validate, clear)
- Real-time JSON validation in the input textarea
- Copy-to-clipboard for schemas
- Auto-formatting of JSON input
The admin page supports three views:
- List View (
action=list, default): Statistics dashboard + searchable table - Detail View (
action=view&ability=slug): Full ability details with schemas - Test Runner (
action=test&ability=slug): Interactive ability testing interface
Abilities are categorized by provider:
- Core: Abilities with
wordpress,wp, orcorenamespace prefix - Theme: Abilities matching the active theme's stylesheet or template name
- Plugin: All other abilities (default)
The experiment performs JSON Schema validation:
- Required field checking
- Type validation (string, number, integer, boolean, array, object)
- Real-time JSON syntax validation in the UI
- Navigate to Abilities Explorer in the "Tools" menu in the admin menu
- Find the ability you want to test
- Click the Test button
- Edit the JSON input (pre-populated with example values from the schema)
- Click Validate Input to check JSON syntax and schema compliance
- Click Invoke Ability to execute
- View the result in the Result section
The test runner automatically generates example input based on the ability's input schema:
- Uses
defaultvalues if specified - Falls back to
examplevalues - Generates type-appropriate defaults (empty string, 0, false, empty array/object)
- Requires
manage_optionscapability to access the admin page - AJAX requests verify nonce and capability before invoking abilities
-
Enable the experiment:
- Go to
Settings → AI - Toggle Abilities Explorer to enabled
- Go to
-
Test the list view:
- Navigate to Abilities Explorer in the "Tools" menu in the admin menu
- Verify statistics are displayed
- Search for abilities by name or description
- Filter by provider type
- Sort columns
-
Test the detail view:
- Click on an ability name or View button
- Verify input/output schemas are displayed
- Test copy buttons
-
Test the test runner:
- Click Test on any ability
- Modify the JSON input
- Click Validate Input
- Click Invoke Ability
- Verify results are displayed
- Requires the WordPress Abilities API (
wp_get_abilities,wp_get_abilityfunctions) - Users must have
manage_optionscapability
- Provider detection is heuristic-based and may not be accurate for all abilities
- Input validation is basic JSON Schema validation (required fields, types)
- Does not support nested object validation