Skip to content

Abilities API: Plugin Settings: General#1112

Closed
n7studios wants to merge 5 commits into
abilities-api-productsfrom
abilities-api-plugin-settings
Closed

Abilities API: Plugin Settings: General#1112
n7studios wants to merge 5 commits into
abilities-api-productsfrom
abilities-api-plugin-settings

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

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.

Screenshot 2026-06-18 at 15 21 53
Ability Description Required input Output
kit/settings-general-get Returns the current values of the Kit General settings group. Secret values (API keys, OAuth tokens, reCAPTCHA secret) are never returned. none { non_inline_form, non_inline_form_honor_none_setting, non_inline_form_limit_per_session, recaptcha_site_key, recaptcha_minimum_score, debug, no_scripts, no_css, no_add_new_button, usage_tracking }
kit/settings-general-update Updates one or more values in the Kit General settings group. Only keys declared in the input schema can be updated; secret values cannot be set via this ability. Unknown keys are rejected. partial object of any subset of: non_inline_form, non_inline_form_honor_none_setting, non_inline_form_limit_per_session, recaptcha_site_key, recaptcha_minimum_score, debug, no_scripts, no_css, no_add_new_button, usage_tracking same shape as kit/settings-general-get (post-save state)

Testing

  • MCPSettingsGeneralTest: Tests that MCP tools are registered, permissions are honored and get/update tools work for the Plugin's general settings.

Checklist

@n7studios n7studios added this to the 3.4.0 milestone Jun 18, 2026
@n7studios n7studios self-assigned this Jun 18, 2026
@github-actions

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team June 18, 2026 10:33
@n7studios n7studios marked this pull request as ready for review June 18, 2026 10:33

@ciccio-kit ciccio-kit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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' ) );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is float a valid type or should this be number instead?

@n7studios n7studios deleted the branch abilities-api-products June 22, 2026 02:50
@n7studios n7studios closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants