| Server IP : 188.114.97.3 / Your IP : 104.23.243.217 Web Server : Apache System : Linux web236.dogado.net 4.18.0-553.141.2.lve.el7h.x86_64 #1 SMP Wed Jul 8 17:20:31 UTC 2026 x86_64 User : h193310 ( 10083) PHP Version : 8.4.12 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/h193310.web236.dogado.net/httpdocs/wp-content/plugins/easy-mcp-ai/ |
Upload File : |
<?php
/**
* Plugin Name: Easy MCP AI - Connector for Claude, ChatGPT & SEO Data
* Plugin URI: https://easymcpai.com
* Description: Connect Claude, ChatGPT & any AI to WordPress. Manage your entire site by chat — content, media, GA4, Search Console, SEO & more. 242 tools. Free.
* Version: 1.7.13
* Author: EasyMCPAI
* Author URI:
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: easy-mcp-ai
* Domain Path: /languages
* Requires at least: 6.0
* Requires PHP: 7.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
$easy_mcp_ai_req = (string) $_SERVER['REQUEST_URI']; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- read-only path match, not stored/output.
$easy_mcp_ai_own = (
false !== strpos( $easy_mcp_ai_req, '/.well-known/oauth-' )
|| false !== strpos( $easy_mcp_ai_req, '/.well-known/openid-configuration' )
|| false !== strpos( $easy_mcp_ai_req, '/easy-mcp-ai/v1/' )
|| false !== strpos( $easy_mcp_ai_req, 'easy_mcp_ai_oauth=' )
);
if ( ! $easy_mcp_ai_own
&& (
false !== strpos( $easy_mcp_ai_req, 'wp-login.php' )
|| false !== strpos( $easy_mcp_ai_req, 'rest_route=' )
)
) {
$easy_mcp_ai_decoded = rawurldecode( $easy_mcp_ai_req );
$easy_mcp_ai_own = (
false !== strpos( $easy_mcp_ai_decoded, '/easy-mcp-ai/v1/' )
|| false !== strpos( $easy_mcp_ai_decoded, 'easy_mcp_ai_oauth=' )
);
unset( $easy_mcp_ai_decoded );
}
if ( ! $easy_mcp_ai_own
&& isset( $_SERVER['REQUEST_METHOD'] )
&& 'POST' === strtoupper( (string) $_SERVER['REQUEST_METHOD'] ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- read-only comparison.
&& false !== strpos( $easy_mcp_ai_req, 'wp-login.php' )
&& ! empty( $_POST['redirect_to'] ) // phpcs:ignore WordPress.Security.NonceVerification.Missing -- read-only substring match; nothing is acted on or stored.
&& is_string( $_POST['redirect_to'] ) // phpcs:ignore WordPress.Security.NonceVerification.Missing -- see above.
) {
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput -- read-only substring match; nothing is acted on, stored or output.
$easy_mcp_ai_rt = (string) $_POST['redirect_to'];
foreach ( array( $easy_mcp_ai_rt, rawurldecode( $easy_mcp_ai_rt ) ) as $easy_mcp_ai_candidate ) {
if ( false !== strpos( $easy_mcp_ai_candidate, '/easy-mcp-ai/v1/' )
|| false !== strpos( $easy_mcp_ai_candidate, 'easy_mcp_ai_oauth=' ) ) {
$easy_mcp_ai_own = true;
break;
}
}
unset( $easy_mcp_ai_rt, $easy_mcp_ai_candidate );
}
if ( $easy_mcp_ai_own ) {
@ini_set( 'display_errors', '0' ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Disallowed, WordPress.PHP.NoSilencedErrors.Discouraged, Squiz.PHP.DiscouragedFunctions.Discouraged -- Intentional & request-scoped: stop other plugins' PHP notices from corrupting our OAuth/MCP JSON responses. Suppresses display only (logging unaffected).
@ini_set( 'display_startup_errors', '0' ); // phpcs:ignore WordPress.PHP.IniSet.Risky, WordPress.PHP.NoSilencedErrors.Discouraged, Squiz.PHP.DiscouragedFunctions.Discouraged -- See above; display suppression only, scoped to our own JSON endpoints.
if ( empty( $_SERVER['HTTP_AUTHORIZATION'] ) ) {
require_once __DIR__ . '/includes/class-auth-header.php';
$easy_mcp_ai_hdrs = Easy_MCP_AI\Auth_Header::request_headers();
if ( null !== $easy_mcp_ai_hdrs ) {
$easy_mcp_ai_bearer = Easy_MCP_AI\Auth_Header::recover_bearer( $easy_mcp_ai_hdrs );
if ( null !== $easy_mcp_ai_bearer ) {
$_SERVER['HTTP_AUTHORIZATION'] = $easy_mcp_ai_bearer;
}
unset( $easy_mcp_ai_bearer );
}
unset( $easy_mcp_ai_hdrs );
}
}
unset( $easy_mcp_ai_req, $easy_mcp_ai_own );
}
define( 'EASY_MCP_AI_VERSION', '1.7.13' );
define( 'EASY_MCP_AI_PLUGIN_FILE', __FILE__ );
define( 'EASY_MCP_AI_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'EASY_MCP_AI_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'EASY_MCP_AI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
require_once EASY_MCP_AI_PLUGIN_DIR . 'includes/class-plugin.php';
register_activation_hook( __FILE__, array( 'Easy_MCP_AI\\Activator', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Easy_MCP_AI\\Deactivator', 'deactivate' ) );
Easy_MCP_AI\Plugin::instance();
add_filter(
'plugin_action_links_' . EASY_MCP_AI_PLUGIN_BASENAME,
function ( $links ) {
$prepend = array(
'dashboard' => '<a href="' . esc_url( admin_url( 'admin.php?page=easy-mcp-ai' ) ) . '">' . esc_html__( 'Getting Started', 'easy-mcp-ai' ) . '</a>',
'plugins' => '<a href="' . esc_url( admin_url( 'admin.php?page=easy-mcp-ai-plugin-integrations' ) ) . '">' . esc_html__( 'Plugin', 'easy-mcp-ai' ) . '</a>',
'abilities' => '<a href="' . esc_url( admin_url( 'admin.php?page=easy-mcp-ai-abilities' ) ) . '">' . esc_html__( 'Abilities', 'easy-mcp-ai' ) . '</a>',
'external_data' => '<a href="' . esc_url( admin_url( 'admin.php?page=easy-mcp-ai-external-data' ) ) . '">' . esc_html__( 'External Data', 'easy-mcp-ai' ) . '</a>',
);
$append = array(
'settings' => '<a href="' . esc_url( admin_url( 'admin.php?page=easy-mcp-ai-settings' ) ) . '">' . esc_html__( 'Settings', 'easy-mcp-ai' ) . '</a>',
);
return array_merge( $prepend, $links, $append );
}
);
add_filter(
'plugin_row_meta',
function ( $links, $file ) {
if ( EASY_MCP_AI_PLUGIN_BASENAME !== $file ) {
return $links;
}
$links[] = '<a href="https://wordpress.org/support/plugin/easy-mcp-ai/reviews/" target="_blank" rel="noopener">' . esc_html__( 'Rate Plugin', 'easy-mcp-ai' ) . '</a>';
return $links;
},
10,
2
);