'',
'chatgpt' => '',
];
return $marks[$client['id']] ?? '';
}
/**
* @param string $url - Where the link goes.
* @return string
*/
private static function newTab($url)
{
return 'href="' . \esc_url($url) . '" target="_blank" rel="noopener noreferrer"';
}
/**
* @param array $substeps - The click path the step's button would have saved.
* @return array
*/
private static function buttonFallback(array $substeps)
{
return [
/* translators: opens manual instructions for when the setup button did not work. */
'summary' => \__('Button didn\'t work?', 'extendify-local'),
'substeps' => $substeps,
];
}
// phpcs:disable Generic.Files.LineLength.TooLong -- one msgid per sentence; the markup can push one past 120.
/**
* @param string $assistant - The assistant's product name.
* @return string
*/
private static function approveOnSite($assistant)
{
return sprintf(
/* translators: %s: an AI assistant's name, such as Claude. Approve is this site's button. */
\__(
'You\'ll be taken to WordPress to choose what %s can do. Then click Approve.',
'extendify-local'
),
$assistant
);
}
/**
* @return array
*/
private static function claude()
{
$dialog = '?' . http_build_query([
'modal' => 'add-custom-connector',
'connectorName' => self::siteName(),
'connectorUrl' => Metadata::resource(),
], '', '&', PHP_QUERY_RFC3986);
return [
'id' => 'claude',
'name' => 'Claude',
'gate' => [
'tone' => 'ok',
/* translators: Free is a Claude plan name; keep it in English. */
'text' => \__('Works on every Claude plan. The Free plan allows one custom connector.', 'extendify-local'),
],
'steps' => [
[
/* translators: heading of the first setup step; Claude is a product name. */
'title' => \__('Add this site to Claude', 'extendify-local'),
'links' => [
[
/* translators: button that opens Claude's add-connector dialog in a new tab. */
'label' => \__('Add to Claude', 'extendify-local'),
'url' => 'https://claude.ai/customize/connectors' . $dialog,
'primary' => true,
],
],
'substeps' => [
/* translators: Continue is a button label in Claude's add-connector dialog. */
\__('Claude opens with the name and address filled in. Click Continue.', 'extendify-local'),
/* translators: Add is a button label in Claude's add-connector dialog. */
\__(
'On the next screen, leave the authentication settings as they are and click Add.',
'extendify-local'
),
],
'asides' => [
self::buttonFallback([
sprintf(
/* translators: %s: link attributes, keep them as is. */
\__('Open Claude\'s connector settings.', 'extendify-local'),
self::newTab('https://claude.ai/customize/connectors')
),
/* translators: Add custom connector is a label in Claude. */
\__('Click +, then Add custom connector.', 'extendify-local'),
[
/* translators: Continue is a button label in Claude's add-connector dialog. */
'text' => \__('Fill in the name and address, then click Continue.', 'extendify-local'),
'fields' => [
/* translators: the label of the name field an assistant asks for when adding this site. */
'name' => \__('Name', 'extendify-local'),
/* translators: the label over this site's MCP address. MCP is a protocol name. */
'url' => \__('MCP server URL', 'extendify-local'),
],
],
/* translators: Add is a button label in Claude's add-connector dialog. */
\__('Leave the authentication settings as they are and click Add.', 'extendify-local'),
]),
[
/* translators: opens the setup for Claude's business plans; keep the plan names in English. */
'summary' => \__('On a Team or Enterprise plan?', 'extendify-local'),
'links' => [
[
/* translators: button opening Claude's organization settings, which only an owner can reach. */
'label' => \__('Add for your organization', 'extendify-local'),
'url' => 'https://claude.ai/admin-settings/connectors' . $dialog,
'primary' => false,
],
],
'substeps' => [
sprintf(
/* translators: %s: link attributes, keep them as is. Add, Custom and Web are labels in Claude. */
\__(
'An owner uses the button below to add it once for everyone. If that doesn\'t work, open Organization settings, click Add, then Custom (choose Web if asked).',
'extendify-local'
),
self::newTab('https://claude.ai/admin-settings/connectors')
),
sprintf(
/* translators: %s: link attributes, keep them as is. Connect is a button label in Claude; translate it. */
\__(
'Then each member clicks Connect next to it in Claude\'s connector settings and approves access.',
'extendify-local'
),
self::newTab('https://claude.ai/customize/connectors')
),
],
],
],
],
[
/* translators: heading of the setup step, where the person approves the assistant here. */
'title' => \__('Approve access', 'extendify-local'),
'substeps' => [
/* translators: Connect is the button on the screen Claude shows next. */
\__('Claude asks you to connect. Click Connect.', 'extendify-local'),
self::approveOnSite('Claude'),
/* translators: describes the Claude screen shown after approving; nothing on it needs changing. */
\__(
'You\'ll be taken back to Claude, to a screen listing its permissions. You don\'t need to change anything.',
'extendify-local'
),
],
],
[
/* translators: heading of the last setup step, where the connection is used in a chat. */
'title' => \__('Use it in a chat', 'extendify-local'),
'text' => [
/* translators: the quoted request is an example to type into Claude; translate it. */
\__('Start a new chat and ask Claude about your site, for example: “List my latest posts.”', 'extendify-local'),
/* translators: + and Connectors open Claude's tools menu in a chat. In right-to-left languages, write the arrow as ←. */
\__(
'If it doesn\'t use your site, click + → Connectors and check that this site is turned on.',
'extendify-local'
),
],
],
],
];
}
/**
* @return array
*/
private static function chatgpt()
{
return [
'id' => 'chatgpt',
'name' => 'ChatGPT',
'gate' => [
'tone' => 'warn',
/* translators: Business, Enterprise and Edu are OpenAI plan names; keep them in English. */
'text' => \__(
'On Business, only admins and owners can connect it. On Enterprise and Edu, an admin has to allow it first.',
'extendify-local'
),
],
'steps' => [
[
/* translators: heading of a setup step; developer mode is a ChatGPT setting. */
'title' => \__('Turn on developer mode', 'extendify-local'),
'text' => [
/* translators: Settings, Security and login and Developer mode are ChatGPT labels. In right-to-left languages, write the arrow as ←. */
\__(
'In ChatGPT, open Settings → Security and login and turn on Developer mode.',
'extendify-local'
),
],
],
[
/* translators: heading of a setup step where this site is added to ChatGPT as an MCP app. */
'title' => \__('Add this site as an MCP app', 'extendify-local'),
'substeps' => [
/* translators: + is a button in ChatGPT's Plugins page; Browse plugins and Create app are ChatGPT labels. */
\__(
'Open Plugins with the button below. Click + (top right, or next to the search box under Browse plugins) and choose Create app.',
'extendify-local'
),
/* translators: Create MCP app is a ChatGPT button label. */
\__('Click Create MCP app in the bottom-left corner.', 'extendify-local'),
/* translators: Connection and Authentication are ChatGPT field labels; use the same word for Connection as the address field's label below. OAuth is a sign-in standard. */
\__(
'Give it a name, paste this address into Connection, and leave Authentication set to OAuth.',
'extendify-local'
),
],
'links' => [
[
/* translators: button that opens ChatGPT's Plugins page in a new tab. */
'label' => \__('Open ChatGPT Plugins', 'extendify-local'),
'url' => 'https://chatgpt.com/plugins',
'primary' => true,
],
],
'fields' => [
/* translators: the label of the name field an assistant asks for when adding this site. */
'name' => \__('Name', 'extendify-local'),
/* translators: the label over this site's MCP address, as ChatGPT names that field; the step above names it too, so use the same word. */
'url' => \__('Connection', 'extendify-local'),
],
],
[
/* translators: heading of the setup step, where the person approves the assistant here. */
'title' => \__('Approve access', 'extendify-local'),
'substeps' => [
/* translators: the quoted checkbox and Create are ChatGPT labels. */
\__(
'Check I understand and want to continue, then click Create.',
'extendify-local'
),
/* translators: Sign in with is the start of a ChatGPT button label. */
\__('Click Sign in with followed by your app\'s name.', 'extendify-local')
. ' ' . self::approveOnSite('ChatGPT'),
/* translators: describes the ChatGPT page shown after approving; nothing on it needs changing. */
\__(
'You\'ll be taken back to ChatGPT, to the app\'s page listing its permissions. You don\'t need to change anything.',
'extendify-local'
),
],
],
[
/* translators: heading of the last setup step, where the connection is used in a chat. */
'title' => \__('Use it in a chat', 'extendify-local'),
'text' => [
/* translators: @ is typed in ChatGPT's message box; + and More are its chat menu labels. In right-to-left languages, write the arrow as ←. */
\__(
'Start a new chat, type @ and pick your site, or open + → More.',
'extendify-local'
),
\__('ChatGPT asks before it changes anything on your site.', 'extendify-local'),
],
],
],
];
}
// phpcs:enable Generic.Files.LineLength.TooLong
/**
* @return array
*/
private static function anythingElse()
{
return [
'id' => 'other',
/* translators: the picker tile for any assistant not listed by name, beside Claude and ChatGPT. */
'name' => \__('Other', 'extendify-local'),
'gate' => [
'tone' => 'ok',
/* translators: MCP is a protocol name; keep it in English. */
'text' => \__(
'Works with any AI assistant that can connect to a remote MCP server.',
'extendify-local'
),
],
'steps' => [
[
/* translators: heading of a setup step for an assistant not listed by name. */
'title' => \__('Add this site\'s address to your assistant', 'extendify-local'),
/* translators: MCP is a protocol name; keep it in English. */
'text' => \__(
'In your assistant\'s MCP or connector settings, add a remote server with this address.',
'extendify-local'
),
'fields' => [
/* translators: the label over this site's MCP address. MCP is a protocol name. */
'url' => \__('MCP server URL', 'extendify-local'),
],
],
[
/* translators: heading of an optional setup step: the assistant configures itself. */
'title' => \__('Or let it set itself up', 'extendify-local'),
/* translators: coding tools are AI assistants that run in a code editor or a terminal. */
'text' => \__(
'Assistants that can change their own settings, like coding tools, can use this prompt.',
'extendify-local'
),
'fields' => ['prompt' => ''],
],
[
/* translators: heading of the setup step, where the person approves the assistant here. */
'title' => \__('Approve access', 'extendify-local'),
/* translators: Approve is the button on this site's own sign-in page. */
'text' => \__(
'You\'ll be taken to WordPress. Sign in if prompted, then click Approve.',
'extendify-local'
),
],
],
];
}
}