| 1 |
<?php |
| 2 |
/** |
| 3 |
* Kit MCP Prompt: Setup. |
| 4 |
* |
| 5 |
* @package ConvertKit |
| 6 |
* @author ConvertKit |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Guided workflow to confirm the site is connected to Kit and set the default |
| 11 |
* Form. Produces a prompt named `kit/setup`. |
| 12 |
* |
| 13 |
* @package ConvertKit |
| 14 |
* @author ConvertKit |
| 15 |
*/ |
| 16 |
class ConvertKit_MCP_Prompt_Setup extends ConvertKit_MCP_Prompt { |
| 17 |
|
| 18 |
/** |
| 19 |
* Returns the prompt's short name. |
| 20 |
* |
| 21 |
* @since 3.5.0 |
| 22 |
* |
| 23 |
* @return string |
| 24 |
*/ |
| 25 |
protected function get_prompt_name() { |
| 26 |
|
| 27 |
return 'setup'; |
| 28 |
|
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns the prompt's label. |
| 33 |
* |
| 34 |
* @since 3.5.0 |
| 35 |
* |
| 36 |
* @return string |
| 37 |
*/ |
| 38 |
public function get_label() { |
| 39 |
|
| 40 |
return __( 'Set up Kit', 'convertkit' ); |
| 41 |
|
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Returns the prompt's description. |
| 46 |
* |
| 47 |
* @since 3.5.0 |
| 48 |
* |
| 49 |
* @return string |
| 50 |
*/ |
| 51 |
public function get_description() { |
| 52 |
|
| 53 |
return __( 'Guided setup: confirm the site is connected to Kit, then choose the default Form shown on your content.', 'convertkit' ); |
| 54 |
|
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* Returns the prompt text. |
| 59 |
* |
| 60 |
* @since 3.5.0 |
| 61 |
* |
| 62 |
* @param array $input Prompt arguments (unused). |
| 63 |
* @return array|WP_Error |
| 64 |
*/ |
| 65 |
public function execute_callback( $input ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found |
| 66 |
|
| 67 |
return $this->render( |
| 68 |
array( |
| 69 |
'# ' . __( 'Set up Kit', 'convertkit' ), |
| 70 |
__( 'Goal: confirm the WordPress site is connected to a Kit account, then set sensible defaults. Read `kit://overview` first for how the pieces fit together.', 'convertkit' ), |
| 71 |
'## ' . __( 'Preflight', 'convertkit' ), |
| 72 |
__( '- Read `kit://account`. If it is empty, the site is not connected yet: tell the user to connect it under Settings > Kit in WordPress (this uses OAuth sign in and cannot be done over MCP), then stop until it is connected.', 'convertkit' ), |
| 73 |
__( '- Read `kit://settings` for the current configuration and `kit://forms` for the available Forms.', 'convertkit' ), |
| 74 |
'## ' . __( 'Steps', 'convertkit' ), |
| 75 |
__( '1. Ask the user which Form should show by default, and on which post types. Use `kit://forms` to map the Form name to its numeric ID.', 'convertkit' ), |
| 76 |
__( '2. Set the default Form(s) with `kit/settings-general-update`. Confirm the change with the user before applying it.', 'convertkit' ), |
| 77 |
__( '3. Verify with `kit/settings-general-get`.', 'convertkit' ), |
| 78 |
) |
| 79 |
); |
| 80 |
|
| 81 |
} |
| 82 |
|
| 83 |
} |
| 84 |
|