Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backport-changelog/7.0/11428.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/11428

* https://github.com/WordPress/gutenberg/pull/76978
6 changes: 3 additions & 3 deletions lib/compat/wordpress-7.0/class-wp-connector-registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ final class WP_Connector_Registry {
* For connectors with `api_key` authentication, a `setting_name` can be provided
* explicitly. If omitted, one is automatically generated using the pattern
* `connectors_{$type}_{$id}_api_key`, with hyphens in the type and ID normalized
* to underscores (e.g., connector type `spam_filtering` with ID `akismet` produces
* `connectors_spam_filtering_akismet_api_key`). This setting name is used for the
* to underscores (e.g., connector type `spam_filtering` with ID `my_plugin` produces
* `connectors_spam_filtering_my_plugin_api_key`). This setting name is used for the
* Settings API registration and REST API exposure.
*
* Registering a connector with an ID that is already registered will trigger a
Expand Down Expand Up @@ -98,7 +98,7 @@ final class WP_Connector_Registry {
* Optional. Plugin data for install/activate UI.
*
* @type string $file The plugin's main file path relative to the plugins
* directory (e.g. 'akismet/akismet.php' or 'hello.php').
* directory (e.g. 'my-plugin/my-plugin.php' or 'hello.php').
* }
* }
* @return array|null The registered connector data on success, null on failure.
Expand Down
19 changes: 0 additions & 19 deletions lib/experimental/connectors/default-connectors.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,6 @@ function _gutenberg_connectors_init(): void {
_gutenberg_register_default_ai_providers( $registry );
}

// Non-AI default connectors.
$registry->register(
'akismet',
array(
'name' => __( 'Akismet Anti-Spam', 'gutenberg' ),
'description' => __( 'Protect your site from spam.', 'gutenberg' ),
'type' => 'spam_filtering',
'plugin' => array(
'file' => 'akismet/akismet.php',
),
'authentication' => array(
'method' => 'api_key',
'credentials_url' => 'https://akismet.com/get/',
'setting_name' => 'wordpress_api_key',
'constant_name' => 'WPCOM_API_KEY',
),
)
);

/**
* Fires when the connector registry is ready for plugins to register connectors.
*
Expand Down
8 changes: 0 additions & 8 deletions routes/connectors-home/default-connectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
OpenAILogo,
ClaudeLogo,
GeminiLogo,
AkismetLogo,
DefaultConnectorLogo,
} from './logos';

Expand Down Expand Up @@ -58,7 +57,6 @@ const CONNECTOR_LOGOS: Record< string, React.ComponentType > = {
google: GeminiLogo,
openai: OpenAILogo,
anthropic: ClaudeLogo,
akismet: AkismetLogo,
};

function getConnectorLogo(
Expand Down Expand Up @@ -239,12 +237,6 @@ export function registerDefaultConnectors() {
const sanitize = ( s: string ) => s.replace( /[^a-z0-9-_]/gi, '-' );

for ( const [ connectorId, data ] of Object.entries( connectors ) ) {
// Special case: Hide Akismet unless it is already installed.
// See https://core.trac.wordpress.org/ticket/65012
if ( connectorId === 'akismet' && ! data.plugin?.isInstalled ) {
continue;
}

const { authentication } = data;

const connectorName = sanitize( connectorId );
Expand Down
20 changes: 0 additions & 20 deletions routes/connectors-home/logos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@ export const DefaultConnectorLogo = () => (
</svg>
);

// Akismet logo as inline SVG — extracted from the official akismet-refresh-logo.svg
export const AkismetLogo = () => (
<svg
width="40"
height="40"
viewBox="0 0 44 44"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<rect width="44" height="44" fill="#357B49" rx="6" />
<path
fill="#fff"
fillRule="evenodd"
d="m29.746 28.31-6.392-16.797c-.152-.397-.305-.672-.789-.675-.673 0-1.408.611-1.746 1.316l-7.378 16.154c-.072.16-.143.311-.214.454-.5.995-1.045 1.546-2.357 1.626a.399.399 0 0 0-.16.033l-.01.004a.399.399 0 0 0-.23.392v.01c0 .054.01.106.03.155l.004.01a.416.416 0 0 0 .394.252h6.212a.417.417 0 0 0 .307-.12.416.416 0 0 0 .124-.305.398.398 0 0 0-.105-.302.399.399 0 0 0-.294-.127c-.757 0-2.197-.062-2.197-1.164.02-.318.103-.63.245-.916l1.399-3.152c.52-1.163 1.654-1.163 2.572-1.163h5.843c.023 0 .044 0 .062.003.13.014.16.081.214.242l1.534 4.07a2.857 2.857 0 0 1 .216 1.04c0 .054-.003.104-.01.153-.09.726-.831.887-1.49.887a.4.4 0 0 0-.294.127l-.007.008-.007.008a.401.401 0 0 0-.092.286v.01c0 .054.01.106.03.155l.005.01a.42.42 0 0 0 .395.252h7.011a.413.413 0 0 0 .279-.13.412.412 0 0 0 .11-.297.387.387 0 0 0-.09-.294.388.388 0 0 0-.277-.135c-1.448-.122-2.295-.643-2.847-2.08Zm-11.985-5.844 2.847-6.304c.361-.728.659-1.486.889-2.265 0-.06.03-.092.06-.092s.061.032.061.091c.02.122.045.247.073.374.197.888.584 1.878.914 2.723l.176.453 1.684 4.529a.927.927 0 0 1 .092.4.473.473 0 0 1-.009.094c-.041.202-.228.272-.602.272h-6.063c-.122 0-.184-.03-.184-.092a.36.36 0 0 1 .062-.183Zm17.107-.721c0 .786-.446 1.231-1.25 1.231-.806 0-1.125-.409-1.125-1.034 0-.786.465-1.231 1.25-1.231.785 0 1.125.427 1.125 1.034ZM9.629 23.002c.803 0 1.25-.447 1.25-1.231 0-.607-.343-1.036-1.128-1.036-.785 0-1.25.447-1.25 1.231 0 .625.325 1.036 1.128 1.036Z"
clipRule="evenodd"
/>
</svg>
);

// Gemini logo as inline SVG
export const GeminiLogo = () => (
<svg
Expand Down
Loading