Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPLv3",
"require": {
"convertkit/convertkit-wordpress-libraries": "2.6.0",
"wordpress/mcp-adapter": "^0.5.0"
"wordpress/mcp-adapter": "^0.6.1"
},
"require-dev": {
"php-webdriver/webdriver": "^1.0",
Expand Down Expand Up @@ -97,7 +97,8 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"automattic/jetpack-autoloader": true
}
},
"repositories": [
Expand Down
22 changes: 15 additions & 7 deletions includes/class-wp-convertkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,24 @@
return;
}

// Bail if the WordPress MCP Adapter autoloader is missing.
if ( ! file_exists( CONVERTKIT_PLUGIN_PATH . '/vendor/autoload.php' ) ) {
return;
}
// Load MCP Adapter if another Plugin hasn't already loaded it.
if ( ! class_exists( 'WP\\MCP\\Core\\McpAdapter' ) ) {
// Bail if the WordPress MCP Adapter autoloader is missing.
if ( ! file_exists( CONVERTKIT_PLUGIN_PATH . '/vendor/autoload.php' ) ) {
return;
}

// Load MCP Adapter.
require_once CONVERTKIT_PLUGIN_PATH . '/vendor/autoload.php';
// Load MCP Adapter.
require_once CONVERTKIT_PLUGIN_PATH . '/vendor/autoload.php';

// Bail if the MCP Adapter class doesn't exist - something went wrong with the autoloader.
if ( ! class_exists( 'WP\\MCP\\Core\\McpAdapter' ) ) {
return;
}
}

// Bail if the MCP Adapter class doesn't exist - something went wrong with the autoloader.
// Sanity check MCP Adapter is loaded.
if ( ! class_exists( 'WP\\MCP\\Core\\McpAdapter' ) ) {

Check failure on line 265 in includes/class-wp-convertkit.php

View workflow job for this annotation

GitHub Actions / Coding Standards / WordPress 7.1-RC3 / PHP 8.0

Negated boolean expression is always false.
return;
}

Expand Down
Loading