Abilities API: Plugin Settings: General#1112
Conversation
WordPress Playground🚀 Your PR has been built and is ready for testing in WordPress Playground! |
ciccio-kit
left a comment
There was a problem hiding this comment.
Overall LGTM but there are a couple of things to double check before approving
| add_action( 'convertkit_admin_settings_enqueue_styles', array( $this, 'enqueue_styles' ) ); | ||
|
|
||
| // Register MCP abilities. | ||
| add_filter( 'convertkit_abilities', array( $this, 'register_abilities' ) ); |
There was a problem hiding this comment.
I might be misreading the flow here, but aren't these settings abilities now getting registered through two paths? This filter seems to call register_abilities() on the base section (keyed kit/general-*), and ConvertKit_MCP::register_settings_abilities() also adds them (keyed kit/settings-general-*). Since both instances return the same get_name(), I think wp_register_ability() could end up being called twice with the same name, but I'm not 100% sure how the dedup works. Could you double-check whether that is the case?
| 'description' => __( 'Google reCAPTCHA v3 site key.', 'convertkit' ), | ||
| ), | ||
| 'recaptcha_minimum_score' => array( | ||
| 'type' => 'float', |
There was a problem hiding this comment.
is float a valid type or should this be number instead?
Summary
Registers get and update abilities (MCP tools) for the Plugin's General Settings (Settings > Kit > General), so an MCP client can fetch and update settings.
Secret credentials, such as API Keys and OAuth Tokens, cannot be read or updated.
Testing
MCPSettingsGeneralTest: Tests that MCP tools are registered, permissions are honored and get/update tools work for the Plugin's general settings.Checklist