build(wporg): rebrand plugin to Heretek Control Core for WordPress.org compliance

- Establish heretek-control-core.php as canonical main plugin bootstrap
- Convert emcp-tools.php to non-conflicting backward-compatibility forwarder
- Update readme.txt header and tagline removing trademarked terms per Rule 17
- Update bin/build-wporg-zip.sh to package slug heretek-control-core
- Regenerate assets-wporg banners and icons with HCC / Heretek Control Core branding
- Rebrand admin interface, menu items, and headers to Heretek Core / Heretek Control Core
- Update composer.json, release tooling, and README.md
This commit is contained in:
John Smith
2026-09-05 15:38:15 -04:00
parent 23b12d73b9
commit 8ab6b50260
19 changed files with 362 additions and 352 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
<h1 align="center">
<img src="assets/img/icon-sm.png" width="80" alt="Heretek Control Core logo"><br>
MCP Tools for Elementor & WordPress
Heretek Control Core
</h1>
<p align="center">
<strong>The Enterprise-Grade Model Context Protocol (MCP) Server for WordPress, Elementor &amp; Gutenberg</strong><br>
<strong>Autonomous Model Context Protocol (MCP) Platform for Web &amp; Content Engineering</strong><br>
<em>Maintained by <a href="https://github.com/Heretek-AI">Heretek AI</a> · 100% Open Source · All 269+ Pro Abilities Unlocked</em>
</p>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

+15 -3
View File
@@ -1,5 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
<rect width="256" height="256" rx="44" fill="#0f172a" stroke="#dc2626" stroke-width="4"/>
<circle cx="128" cy="128" r="70" fill="none" stroke="#dc2626" stroke-width="6" opacity="0.8"/>
<text x="128" y="142" font-family="DejaVu Sans, Arial, sans-serif" font-size="42" font-weight="bold" fill="#ffffff" text-anchor="middle">EMCP</text>
<defs>
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#09090b"/>
<stop offset="100%" stop-color="#18181b"/>
</linearGradient>
<linearGradient id="crimson" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#ef4444"/>
<stop offset="100%" stop-color="#991b1b"/>
</linearGradient>
</defs>
<rect width="256" height="256" rx="46" fill="url(#bg)" stroke="#dc2626" stroke-width="4"/>
<circle cx="128" cy="128" r="76" fill="none" stroke="url(#crimson)" stroke-width="6" opacity="0.85"/>
<polygon points="128,42 202,84 202,172 128,214 54,172 54,84" fill="none" stroke="#ef4444" stroke-width="2" stroke-dasharray="8,6" opacity="0.45"/>
<text x="128" y="142" font-family="DejaVu Sans, Arial, sans-serif" font-size="44" font-weight="bold" fill="#ffffff" text-anchor="middle" letter-spacing="2">HCC</text>
<text x="128" y="172" font-family="DejaVu Sans, Arial, sans-serif" font-size="11" font-weight="bold" fill="#ef4444" text-anchor="middle" letter-spacing="3">CONTROL CORE</text>
</svg>

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 1.1 KiB

+2 -2
View File
@@ -10,7 +10,7 @@
set -euo pipefail
PLUGIN_SLUG="mcp-tools-for-elementor"
PLUGIN_SLUG="heretek-control-core"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
DIST_DIR="${ROOT_DIR}/dist"
@@ -109,7 +109,7 @@ echo "Total files: ${FILE_COUNT}"
echo "Verifying guideline compliance inside zip..."
# Check 1: Plugin headers exist
unzip -l "${ZIP_PATH}" | grep -q "${PLUGIN_SLUG}/emcp-tools.php" || { echo "ERROR: Main plugin file missing!"; exit 1; }
unzip -l "${ZIP_PATH}" | grep -q "${PLUGIN_SLUG}/heretek-control-core.php" || { echo "ERROR: Main plugin file missing!"; exit 1; }
unzip -l "${ZIP_PATH}" | grep -q "${PLUGIN_SLUG}/readme.txt" || { echo "ERROR: readme.txt missing!"; exit 1; }
# Check 2: No shell scripts allowed in WordPress plugins (setup_tools.sh, etc.)
+49 -21
View File
@@ -54,26 +54,41 @@ export function isValidVersion(version) {
}
/**
* Reads the current version from emcp-tools.php.
* Locates the canonical main plugin file.
*
* @param {string} rootDir
* @returns {string} Path to the plugin file
*/
export function getPluginFile(rootDir = ROOT_DIR) {
const candidates = [
path.join(rootDir, 'heretek-control-core.php'),
path.join(rootDir, 'emcp-tools.php')
];
const found = candidates.find((f) => fs.existsSync(f));
if (!found) {
throw new Error(`Plugin file not found. Checked: ${candidates.join(', ')}`);
}
return found;
}
/**
* Reads the current version from the main plugin file.
*
* @param {string} rootDir Root directory of the repository
* @returns {string} Current version string
*/
export function getCurrentVersion(rootDir = ROOT_DIR) {
const pluginFile = path.join(rootDir, 'emcp-tools.php');
if (!fs.existsSync(pluginFile)) {
throw new Error(`Plugin file not found: ${pluginFile}`);
}
const pluginFile = getPluginFile(rootDir);
const content = fs.readFileSync(pluginFile, 'utf8');
const match = content.match(/define\(\s*['"]EMCP_TOOLS_VERSION['"]\s*,\s*['"]([^'"]+)['"]\s*\);/);
if (!match) {
throw new Error('EMCP_TOOLS_VERSION constant not found in emcp-tools.php');
throw new Error(`EMCP_TOOLS_VERSION constant not found in ${path.basename(pluginFile)}`);
}
return match[1];
}
/**
* Updates version references in emcp-tools.php and readme.txt.
* Updates version references in the plugin file and readme.txt.
*
* @param {string} rootDir Root directory of the repository
* @param {string} newVersion Target version string
@@ -87,27 +102,40 @@ export function updateVersionFiles(rootDir = ROOT_DIR, newVersion, dryRun = fals
const filesUpdated = [];
// 1. Update emcp-tools.php
const pluginFile = path.join(rootDir, 'emcp-tools.php');
if (fs.existsSync(pluginFile)) {
// 1. Update plugin bootstrap files
const pluginFiles = [
path.join(rootDir, 'heretek-control-core.php'),
path.join(rootDir, 'emcp-tools.php')
].filter((f) => fs.existsSync(f));
for (const pluginFile of pluginFiles) {
let content = fs.readFileSync(pluginFile, 'utf8');
let changed = false;
// Update constant define( 'EMCP_TOOLS_VERSION', 'X.Y.Z' );
content = content.replace(
/(define\(\s*['"]EMCP_TOOLS_VERSION['"]\s*,\s*['"])[^'"]+(['"]\s*\);)/,
`$1${newVersion}$2`
);
if (content.includes('EMCP_TOOLS_VERSION')) {
content = content.replace(
/(define\(\s*['"]EMCP_TOOLS_VERSION['"]\s*,\s*['"])[^'"]+(['"]\s*\);)/,
`$1${newVersion}$2`
);
changed = true;
}
// Update docblock header * Version: X.Y.Z
content = content.replace(
/(\*\s*Version:\s*)([0-9A-Za-z.-]+)/,
`$1${newVersion}`
);
if (/(\*\s*Version:\s*)([0-9A-Za-z.-]+)/.test(content)) {
content = content.replace(
/(\*\s*Version:\s*)([0-9A-Za-z.-]+)/,
`$1${newVersion}`
);
changed = true;
}
if (!dryRun) {
fs.writeFileSync(pluginFile, content, 'utf8');
if (changed) {
if (!dryRun) {
fs.writeFileSync(pluginFile, content, 'utf8');
}
filesUpdated.push(pluginFile);
}
filesUpdated.push(pluginFile);
}
// 2. Update readme.txt
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "heretek-ai/elementor-mcp",
"description": "Unlocked MCP Tools for Elementor & WordPress by Heretek AI",
"name": "heretek-ai/heretek-control-core",
"description": "Heretek Control Core — Autonomous AI Control Platform by Heretek AI",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"require": {
+3 -302
View File
@@ -1,311 +1,12 @@
<?php
/**
* Plugin Name: MCP Tools for Elementor & WordPress
* Plugin URI: https://github.com/Heretek-AI/heretek-control-core
* Description: Professional Model Context Protocol (MCP) server connecting WordPress, Elementor & Gutenberg to AI assistants (Claude, Cursor, ChatGPT, Antigravity).
* Version: 3.16.1
* Requires at least: 6.9
* Tested up to: 7.1
* Requires PHP: 8.1
* Author: Heretek AI (originally by Mian Shahzad Raza)
* Author URI: https://github.com/Heretek-AI
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: emcp-tools
* Domain Path: /languages
* Backwards-compatibility bootstrap forwarder for legacy loaders.
*
* This file is the bootstrap ONLY: plugin header, the legacy-rename guard,
* constants, the Freemius SDK helper, the uninstall hook, and the entry point
* that hands off to EMCP_Tools_Bootstrap. All feature logic lives in classes
* under includes/.
* @package Heretek_Control_Core
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Free ⇄ Premium single-instance guard.
*
* The free build (folder `emcp-tools`) and the premium build (folder `emcp-pro`)
* are the SAME plugin — identical `emcp-tools.php` + `includes/`, differing only
* by the `pro/*` overlay and the `.emcp-pro` marker. WordPress treats the two
* folders as separate plugins, so `require_once` does NOT dedupe across them:
* activating the second copy while the first is active redeclares every class
* (starting at includes/class-migration.php below) → a fatal error.
*
* This guard runs BEFORE any require, so it can never redeclare. Premium always
* wins: the free copy yields to an active premium sibling (and shows a notice),
* and the premium copy retires an active free sibling. A last-resort redeclare
* net covers the one request (a premium activation) where the free copy has
* already booted.
*/
if ( ! function_exists( 'emcp_tools_retire_sibling' ) ) {
/**
* Deactivate a sibling EMCP Tools build on the next admin_init.
*
* @param string $basename Plugin basename to deactivate.
*/
function emcp_tools_retire_sibling( $basename ) {
add_action(
'admin_init',
function () use ( $basename ) {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
if ( ! function_exists( 'deactivate_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if ( is_plugin_active( $basename ) ) {
deactivate_plugins( $basename );
set_transient( 'emcp_tools_free_retired', 1, 60 );
}
}
);
}
}
$emcp_tools_is_premium_build = file_exists( __DIR__ . '/.emcp-pro' );
$emcp_tools_free_basename = 'emcp-tools/emcp-tools.php';
$emcp_tools_premium_basename = 'emcp-pro/emcp-tools.php';
// Last-resort redeclare net: another EMCP Tools copy already booted this
// request. If THIS is premium and the free copy booted first, retire free so
// the next load runs premium alone.
if ( defined( 'EMCP_TOOLS_VERSION' ) ) {
if ( $emcp_tools_is_premium_build ) {
emcp_tools_retire_sibling( $emcp_tools_free_basename );
}
return;
}
// The free build yields to an active premium sibling (bail before defining or
// requiring anything). A persistent notice tells the admin to remove the free copy.
if ( ! $emcp_tools_is_premium_build ) {
$emcp_tools_premium_active = in_array( $emcp_tools_premium_basename, (array) get_option( 'active_plugins', array() ), true )
|| ( is_multisite() && array_key_exists( $emcp_tools_premium_basename, (array) get_site_option( 'active_sitewide_plugins', array() ) ) );
if ( $emcp_tools_premium_active ) {
add_action(
'admin_notices',
function () {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
echo '<div class="notice notice-warning"><p>';
echo wp_kses(
__( '<strong>EMCP Tools Pro is active.</strong> The free version of EMCP Tools stays paused to avoid a conflict &mdash; you can safely <strong>deactivate and delete</strong> it. Everything is handled by Pro.', 'emcp-tools' ),
array( 'strong' => array() )
);
echo '</p></div>';
}
);
return;
}
}
// The premium build retires an active free sibling.
if ( $emcp_tools_is_premium_build ) {
emcp_tools_retire_sibling( $emcp_tools_free_basename );
add_action(
'admin_notices',
function () {
if ( get_transient( 'emcp_tools_free_retired' ) && current_user_can( 'activate_plugins' ) ) {
delete_transient( 'emcp_tools_free_retired' );
echo '<div class="notice notice-info is-dismissible"><p>';
echo esc_html__( 'EMCP Tools: the free version was deactivated because the Pro version is active.', 'emcp-tools' );
echo '</p></div>';
}
}
);
}
/**
* Legacy coexistence guard.
*
* This plugin was renamed from the `elementor-mcp` folder/slug to `emcp-tools`.
* On an existing site the old `elementor-mcp/elementor-mcp.php` plugin may still
* be active alongside this one during the transition. All PHP symbols were
* re-prefixed (EMCP_Tools_* / emcp_tools_*) so the two can coexist without
* "cannot redeclare" fatals — but they would still both register the same MCP
* abilities/server and share data. So while the old plugin is active we do NOT
* boot: we snapshot its settings (admin only) and show a notice, then bail
* before defining constants, initializing Freemius, or registering anything.
*/
require_once __DIR__ . '/includes/class-migration.php';
if ( EMCP_Tools_Migration::is_legacy_plugin_active() ) {
// Snapshot the old plugin's settings into the new keys WHILE it's still
// installed — once the user deletes it, its uninstall hook wipes them.
if ( is_admin() ) {
EMCP_Tools_Migration::migrate();
}
add_action(
'admin_notices',
function () {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
echo '<div class="notice notice-warning"><p>';
echo wp_kses(
__( '<strong>EMCP Tools:</strong> The previous &#8220;MCP Tools for Elementor&#8221; plugin (folder <code>elementor-mcp</code>) is still active. EMCP Tools has replaced it &mdash; please <strong>deactivate and delete</strong> the old plugin to finish the upgrade. Your settings and license carry over automatically. EMCP Tools stays paused until then.', 'emcp-tools' ),
array(
'strong' => array(),
'code' => array(),
)
);
echo '</p></div>';
}
);
// Bail before booting anything else (no constants, no Freemius, no abilities).
return;
}
// Plugin constants.
define( 'EMCP_TOOLS_VERSION', '3.16.1' );
define( 'EMCP_TOOLS_DIR', plugin_dir_path( __FILE__ ) );
define( 'EMCP_TOOLS_URL', plugin_dir_url( __FILE__ ) );
define( 'EMCP_TOOLS_BASENAME', plugin_basename( __FILE__ ) );
// Claim the WP\MCP namespace for our bundled MCP Adapter copy, at file-load —
// BEFORE any other plugin can autoload an adapter class. Other plugins bundle
// the adapter behind their own autoloaders (Rank Math SEO, …) and PHP allows
// only one class of a given name per request, so without this the namespace
// can shear across two adapter versions and the MCP session dies mid-request
// ("Session terminated", -32600). Lazy: registers a resolver, loads nothing.
require_once EMCP_TOOLS_DIR . 'includes/class-mcp-adapter-bootstrap.php';
EMCP_Tools_Adapter_Bootstrap::preload_bundled_namespace();
if ( ! function_exists( 'emcp_tools_fs' ) ) {
if ( file_exists( dirname( __FILE__ ) . '/includes/vendors/fremius/start.php' ) && ! defined( 'EMCP_WPORG_BUILD' ) ) {
// Create a helper function for easy SDK access.
function emcp_tools_fs() {
global $emcp_tools_fs;
if ( ! isset( $emcp_tools_fs ) ) {
// Activate multisite network integration.
if ( ! defined( 'WP_FS__PRODUCT_30577_MULTISITE' ) ) {
define( 'WP_FS__PRODUCT_30577_MULTISITE', true );
}
// Include Freemius SDK.
require_once dirname( __FILE__ ) . '/includes/vendors/fremius/start.php';
$emcp_tools_is_premium = file_exists( dirname( __FILE__ ) . '/.emcp-pro' );
$emcp_tools_fs = fs_dynamic_init( array(
'id' => '30577',
'slug' => 'emcp-tools',
'premium_slug' => 'emcp-pro',
'type' => 'plugin',
'public_key' => 'pk_2b2a026d5c27655581635abcd4556',
'is_premium' => $emcp_tools_is_premium,
'premium_suffix' => 'Pro',
'has_premium_version' => false,
'has_addons' => false,
'has_paid_plans' => false,
'is_org_compliant' => false,
'has_affiliation' => false,
'menu' => array(
'slug' => 'emcp-tools',
'support' => false,
),
) );
}
return $emcp_tools_fs;
}
// Init Freemius.
emcp_tools_fs();
// Signal that SDK was initiated.
do_action( 'emcp_tools_fs_loaded' );
// Disarm any stale Freemius upsells cached in the WordPress update_plugins transient.
if ( is_admin() ) {
add_action(
'admin_init',
static function () {
$updates = get_site_transient( 'update_plugins' );
if ( is_object( $updates ) && isset( $updates->response[ EMCP_TOOLS_BASENAME ] ) ) {
$entry = $updates->response[ EMCP_TOOLS_BASENAME ];
if ( empty( $entry->package ) || ( isset( $entry->url ) && false !== strpos( $entry->url, 'freemius' ) ) ) {
unset( $updates->response[ EMCP_TOOLS_BASENAME ] );
set_site_transient( 'update_plugins', $updates );
}
}
},
5
);
}
emcp_tools_fs()->add_filter(
'is_submenu_visible',
function ( $is_visible, $menu_id ) {
if ( 'contact' === $menu_id || 'affiliation' === $menu_id ) {
return false;
}
if ( 'pricing' === $menu_id && emcp_tools_fs()->can_use_premium_code() ) {
return false;
}
return $is_visible;
},
10,
2
);
} else {
// Zero-dependency unlocked stub for official WordPress.org distribution.
function emcp_tools_fs() {
static $emcp_fs_stub = null;
if ( null === $emcp_fs_stub ) {
$emcp_fs_stub = new class {
public function can_use_premium_code(): bool { return true; }
public function is_premium(): bool { return true; }
public function is_plan(): bool { return true; }
public function has_features(): bool { return true; }
public function add_filter( $hook, $callback, $priority = 10, $accepted_args = 1 ): void {}
public function add_action( $hook, $callback, $priority = 10, $accepted_args = 1 ): void {}
public function _get_license() { return (object) array( 'secret_key' => 'unlocked' ); }
public function get_upgrade_url(): string { return 'https://github.com/Heretek-AI/heretek-control-core'; }
};
}
return $emcp_fs_stub;
}
do_action( 'emcp_tools_fs_loaded' );
}
}
// Uninstall cleanup runs via Freemius's after_uninstall action or WordPress uninstaller.
require_once EMCP_TOOLS_DIR . 'includes/class-uninstaller.php';
if ( function_exists( 'emcp_tools_fs' ) && method_exists( emcp_tools_fs(), 'add_action' ) ) {
emcp_tools_fs()->add_action( 'after_uninstall', array( 'EMCP_Tools_Uninstaller', 'run' ) );
}
/**
* Canonical "Upgrade to Pro" URL — the external pricing page on the EMCP Tools
* website. Used by every upgrade CTA in the plugin admin so users land on the
* public pricing page (with full plan comparison + FAQ) rather than Freemius's
* bundled in-admin pricing iframe.
*
* MUST be function_exists-guarded: an unconditional top-level function is
* *early-bound at compile time*, so PHP would try to declare it while merely
* compiling this file — before the single-instance guard above can `return`.
* When the free (emcp-tools) and premium (emcp-pro) folders are both present,
* compiling the second copy would then redeclare it and fatal, bypassing the
* runtime guard entirely. The function_exists wrapper makes it a runtime
* (conditional) declaration the guard's early `return` skips.
*
* @since 1.7.1
*
* @return string
*/
if ( ! function_exists( 'emcp_tools_upgrade_url' ) ) {
function emcp_tools_upgrade_url(): string {
return 'https://emcptools.com/pricing';
}
}
// Hand off to the bootstrap (loads classes + wires hooks) once dependencies
// like Elementor are available.
require_once EMCP_TOOLS_DIR . 'includes/class-bootstrap.php';
add_action( 'plugins_loaded', array( 'EMCP_Tools_Bootstrap', 'boot' ), 20 );
require_once __DIR__ . '/heretek-control-core.php';
+269
View File
@@ -0,0 +1,269 @@
<?php
/**
* Plugin Name: Heretek Control Core
* Plugin URI: https://github.com/Heretek-AI/heretek-control-core
* Description: Autonomous Model Context Protocol (MCP) server connecting site builders, themes, and content management to AI assistants (Claude, Cursor, ChatGPT, Antigravity).
* Version: 3.16.1
* Requires at least: 6.9
* Tested up to: 7.1
* Requires PHP: 8.1
* Author: Heretek AI (originally by Mian Shahzad Raza)
* Author URI: https://github.com/Heretek-AI
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: emcp-tools
* Domain Path: /languages
*
* This file is the bootstrap ONLY: plugin header, the legacy-rename guard,
* constants, the Freemius SDK helper, the uninstall hook, and the entry point
* that hands off to EMCP_Tools_Bootstrap. All feature logic lives in classes
* under includes/.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Free ⇄ Premium single-instance guard.
*
* The free build (folder `heretek-control-core`) and the premium build
* are the SAME plugin codebase differing only by the `pro/*` overlay
* and the `.emcp-pro` marker.
*/
if ( ! function_exists( 'emcp_tools_retire_sibling' ) ) {
/**
* Deactivate a sibling EMCP / Heretek build on the next admin_init.
*
* @param string $basename Plugin basename to deactivate.
*/
function emcp_tools_retire_sibling( $basename ) {
add_action(
'admin_init',
function () use ( $basename ) {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
if ( ! function_exists( 'deactivate_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if ( is_plugin_active( $basename ) ) {
deactivate_plugins( $basename );
set_transient( 'emcp_tools_free_retired', 1, 60 );
}
}
);
}
}
$emcp_tools_is_premium_build = file_exists( __DIR__ . '/.emcp-pro' );
$emcp_tools_free_basename = 'heretek-control-core/heretek-control-core.php';
$emcp_tools_premium_basename = 'emcp-pro/emcp-tools.php';
// Retire legacy folder activations if active
if ( function_exists( 'emcp_tools_retire_sibling' ) ) {
emcp_tools_retire_sibling( 'emcp-tools/emcp-tools.php' );
emcp_tools_retire_sibling( 'elementor-mcp/emcp-tools.php' );
emcp_tools_retire_sibling( 'elementor-mcp/elementor-mcp.php' );
}
// Last-resort redeclare net: another copy already booted this request.
if ( defined( 'EMCP_TOOLS_VERSION' ) ) {
if ( $emcp_tools_is_premium_build ) {
emcp_tools_retire_sibling( $emcp_tools_free_basename );
}
return;
}
// The free build yields to an active premium sibling (bail before defining or
// requiring anything). A persistent notice tells the admin to remove the free copy.
if ( ! $emcp_tools_is_premium_build ) {
$emcp_tools_premium_active = in_array( $emcp_tools_premium_basename, (array) get_option( 'active_plugins', array() ), true )
|| ( is_multisite() && array_key_exists( $emcp_tools_premium_basename, (array) get_site_option( 'active_sitewide_plugins', array() ) ) );
if ( $emcp_tools_premium_active ) {
add_action(
'admin_notices',
function () {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
echo '<div class="notice notice-warning"><p>';
echo wp_kses(
__( '<strong>Heretek Control Core Pro is active.</strong> The free version stays paused to avoid a conflict &mdash; you can safely <strong>deactivate and delete</strong> it. Everything is handled by Pro.', 'emcp-tools' ),
array( 'strong' => array() )
);
echo '</p></div>';
}
);
return;
}
}
// The premium build retires an active free sibling.
if ( $emcp_tools_is_premium_build ) {
emcp_tools_retire_sibling( $emcp_tools_free_basename );
add_action(
'admin_notices',
function () {
if ( get_transient( 'emcp_tools_free_retired' ) && current_user_can( 'activate_plugins' ) ) {
delete_transient( 'emcp_tools_free_retired' );
echo '<div class="notice notice-info is-dismissible"><p>';
echo esc_html__( 'Heretek Control Core: the free version was deactivated because the Pro version is active.', 'emcp-tools' );
echo '</p></div>';
}
}
);
}
/**
* Legacy coexistence guard.
*/
require_once __DIR__ . '/includes/class-migration.php';
if ( EMCP_Tools_Migration::is_legacy_plugin_active() ) {
if ( is_admin() ) {
EMCP_Tools_Migration::migrate();
}
add_action(
'admin_notices',
function () {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
echo '<div class="notice notice-warning"><p>';
echo wp_kses(
__( '<strong>Heretek Control Core:</strong> A previous version of this plugin (folder <code>elementor-mcp</code>) is still active. Heretek Control Core has replaced it &mdash; please <strong>deactivate and delete</strong> the old plugin to finish the upgrade. Your settings carry over automatically.', 'emcp-tools' ),
array(
'strong' => array(),
'code' => array(),
)
);
echo '</p></div>';
}
);
return;
}
// Plugin constants.
define( 'EMCP_TOOLS_VERSION', '3.16.1' );
define( 'HERETEK_CONTROL_CORE_VERSION', EMCP_TOOLS_VERSION );
define( 'EMCP_TOOLS_DIR', plugin_dir_path( __FILE__ ) );
define( 'HERETEK_CONTROL_CORE_DIR', EMCP_TOOLS_DIR );
define( 'EMCP_TOOLS_URL', plugin_dir_url( __FILE__ ) );
define( 'HERETEK_CONTROL_CORE_URL', EMCP_TOOLS_URL );
define( 'EMCP_TOOLS_BASENAME', plugin_basename( __FILE__ ) );
define( 'HERETEK_CONTROL_CORE_BASENAME', EMCP_TOOLS_BASENAME );
// Claim the WP\MCP namespace for our bundled MCP Adapter copy, at file-load.
require_once EMCP_TOOLS_DIR . 'includes/class-mcp-adapter-bootstrap.php';
EMCP_Tools_Adapter_Bootstrap::preload_bundled_namespace();
if ( ! function_exists( 'emcp_tools_fs' ) ) {
if ( file_exists( dirname( __FILE__ ) . '/includes/vendors/fremius/start.php' ) && ! defined( 'EMCP_WPORG_BUILD' ) ) {
function emcp_tools_fs() {
global $emcp_tools_fs;
if ( ! isset( $emcp_tools_fs ) ) {
if ( ! defined( 'WP_FS__PRODUCT_30577_MULTISITE' ) ) {
define( 'WP_FS__PRODUCT_30577_MULTISITE', true );
}
require_once dirname( __FILE__ ) . '/includes/vendors/fremius/start.php';
$emcp_tools_is_premium = file_exists( dirname( __FILE__ ) . '/.emcp-pro' );
$emcp_tools_fs = fs_dynamic_init( array(
'id' => '30577',
'slug' => 'emcp-tools',
'premium_slug' => 'emcp-pro',
'type' => 'plugin',
'public_key' => 'pk_2b2a026d5c27655581635abcd4556',
'is_premium' => $emcp_tools_is_premium,
'premium_suffix' => 'Pro',
'has_premium_version' => false,
'has_addons' => false,
'has_paid_plans' => false,
'is_org_compliant' => false,
'has_affiliation' => false,
'menu' => array(
'slug' => 'emcp-tools',
'support' => false,
),
) );
}
return $emcp_tools_fs;
}
emcp_tools_fs();
do_action( 'emcp_tools_fs_loaded' );
if ( is_admin() ) {
add_action(
'admin_init',
static function () {
$updates = get_site_transient( 'update_plugins' );
if ( is_object( $updates ) && isset( $updates->response[ EMCP_TOOLS_BASENAME ] ) ) {
$entry = $updates->response[ EMCP_TOOLS_BASENAME ];
if ( empty( $entry->package ) || ( isset( $entry->url ) && false !== strpos( $entry->url, 'freemius' ) ) ) {
unset( $updates->response[ EMCP_TOOLS_BASENAME ] );
set_site_transient( 'update_plugins', $updates );
}
}
},
5
);
}
emcp_tools_fs()->add_filter(
'is_submenu_visible',
function ( $is_visible, $menu_id ) {
if ( 'contact' === $menu_id || 'affiliation' === $menu_id ) {
return false;
}
if ( 'pricing' === $menu_id && emcp_tools_fs()->can_use_premium_code() ) {
return false;
}
return $is_visible;
},
10,
2
);
} else {
// Zero-dependency unlocked stub for official WordPress.org distribution.
function emcp_tools_fs() {
static $emcp_fs_stub = null;
if ( null === $emcp_fs_stub ) {
$emcp_fs_stub = new class {
public function can_use_premium_code(): bool { return true; }
public function is_premium(): bool { return true; }
public function is_plan(): bool { return true; }
public function has_features(): bool { return true; }
public function add_filter( $hook, $callback, $priority = 10, $accepted_args = 1 ): void {}
public function add_action( $hook, $callback, $priority = 10, $accepted_args = 1 ): void {}
public function _get_license() { return (object) array( 'secret_key' => 'unlocked' ); }
public function get_upgrade_url(): string { return 'https://github.com/Heretek-AI/heretek-control-core'; }
};
}
return $emcp_fs_stub;
}
do_action( 'emcp_tools_fs_loaded' );
}
}
// Uninstall cleanup runs via Freemius's after_uninstall action or WordPress uninstaller.
require_once EMCP_TOOLS_DIR . 'includes/class-uninstaller.php';
if ( function_exists( 'emcp_tools_fs' ) && method_exists( emcp_tools_fs(), 'add_action' ) ) {
emcp_tools_fs()->add_action( 'after_uninstall', array( 'EMCP_Tools_Uninstaller', 'run' ) );
}
if ( ! function_exists( 'emcp_tools_upgrade_url' ) ) {
function emcp_tools_upgrade_url(): string {
return 'https://github.com/Heretek-AI/heretek-control-core';
}
}
// Hand off to the bootstrap (loads classes + wires hooks) once dependencies are available.
require_once EMCP_TOOLS_DIR . 'includes/class-bootstrap.php';
add_action( 'plugins_loaded', array( 'EMCP_Tools_Bootstrap', 'boot' ), 20 );
@@ -697,7 +697,7 @@ class EMCP_Tools_Ads_Write_Operations {
'name' => $name,
'idsite' => absint( $site_id ),
'idsub_type_format' => absint( $format_id ),
'description' => 'Created by Elementor MCP',
'description' => 'Created by Heretek Control Core',
);
$res = wp_remote_post(
+6 -6
View File
@@ -1991,8 +1991,8 @@ class EMCP_Tools_Admin {
*/
public function add_settings_page(): void {
$this->hook_suffixes[] = add_menu_page(
__( 'Elementor MCP Tools — Control Center', 'emcp-tools' ),
__( 'Elementor MCP', 'emcp-tools' ),
__( 'Heretek Control Core — Control Center', 'emcp-tools' ),
__( 'Heretek Core', 'emcp-tools' ),
'manage_options',
self::PAGE_SLUG,
array( $this, 'render_page' ),
@@ -3712,7 +3712,7 @@ class EMCP_Tools_Admin {
?>
<div class="wrap elementor-mcp-admin">
<h1><?php esc_html_e( 'EMCP Tools', 'emcp-tools' ); ?></h1>
<h1><?php esc_html_e( 'Heretek Control Core', 'emcp-tools' ); ?></h1>
<?php
// Success notice after a Settings API save (options.php redirects back
@@ -3767,8 +3767,8 @@ class EMCP_Tools_Admin {
<div class="emcp-appbar">
<div class="emcp-appbar-brand">
<img class="emcp-appbar-logo" src="<?php echo esc_url( EMCP_TOOLS_URL . 'assets/img/icon-sm.png' ); ?>" alt="" />
<span class="emcp-appbar-title emcp-appbar-title--full"><?php esc_html_e( 'ELEMENTOR MCP TOOLS', 'emcp-tools' ); ?></span>
<span class="emcp-appbar-title emcp-appbar-title--short"><?php esc_html_e( 'ELEMENTOR MCP', 'emcp-tools' ); ?></span>
<span class="emcp-appbar-title emcp-appbar-title--full"><?php esc_html_e( 'HERETEK CONTROL CORE', 'emcp-tools' ); ?></span>
<span class="emcp-appbar-title emcp-appbar-title--short"><?php esc_html_e( 'HERETEK CORE', 'emcp-tools' ); ?></span>
<span class="emcp-appbar-version">v<?php echo esc_html( EMCP_TOOLS_VERSION ); ?></span>
</div>
<div class="emcp-appbar-actions">
@@ -3867,7 +3867,7 @@ class EMCP_Tools_Admin {
<!-- Tab nav -->
<div class="emcp-appnav-wrap">
<button type="button" class="emcp-appnav-arrow emcp-appnav-arrow--prev" aria-label="<?php esc_attr_e( 'Scroll tabs left', 'emcp-tools' ); ?>" hidden><span class="dashicons dashicons-arrow-left-alt2" aria-hidden="true"></span></button>
<nav class="emcp-appnav" aria-label="<?php esc_attr_e( 'EMCP Tools sections', 'emcp-tools' ); ?>">
<nav class="emcp-appnav" aria-label="<?php esc_attr_e( 'Heretek Control Core sections', 'emcp-tools' ); ?>">
<?php
foreach ( $this->get_submenus() as $emcp_slug => $emcp_label ) :
$emcp_tab_id = ( self::PAGE_SLUG === $emcp_slug ) ? 'dashboard' : substr( $emcp_slug, strlen( self::PAGE_SLUG . '-' ) );
+1 -1
View File
@@ -72,7 +72,7 @@ $emcp_tools_server_enabled = class_exists( 'EMCP_Tools_Plugin' )
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"/></svg>
</span>
<span class="elementor-mcp-status-card-info">
<span class="elementor-mcp-status-card-label"><?php esc_html_e( 'MCP Tools for Elementor', 'emcp-tools' ); ?></span>
<span class="elementor-mcp-status-card-label"><?php esc_html_e( 'Heretek Control Core', 'emcp-tools' ); ?></span>
<span class="elementor-mcp-status-card-value"><?php esc_html_e( 'Active', 'emcp-tools' ); ?></span>
</span>
</div>
+1 -1
View File
@@ -365,7 +365,7 @@ $emcp_features = array(
<?php
printf(
/* translators: %s: installed version number */
esc_html__( 'Elementor MCP Tools v%s', 'emcp-tools' ),
esc_html__( 'Heretek Control Core v%s', 'emcp-tools' ),
esc_html( $emcp_ver['current'] )
);
?>
+1 -1
View File
@@ -592,7 +592,7 @@ class EMCP_Tools_Bootstrap {
'<div class="notice notice-error"><p>%s</p></div>',
sprintf(
/* translators: %s: comma-separated list of missing dependencies */
esc_html__( 'MCP Tools for Elementor requires the following to be installed and active: %s', 'emcp-tools' ),
esc_html__( 'Heretek Control Core requires the following to be installed and active: %s', 'emcp-tools' ),
'<strong>' . esc_html( $list ) . '</strong>'
)
);
+1 -1
View File
@@ -193,7 +193,7 @@ class EMCP_Tools_GitHub_Updater {
}
$info = new stdClass();
$info->name = 'MCP Tools for Elementor & WordPress (Pro)';
$info->name = 'Heretek Control Core (Pro)';
$info->slug = $this->slug;
$info->version = $release['version'];
$info->author = '<a href="https://github.com/Heretek-AI">Heretek AI</a>';
+3 -3
View File
@@ -261,8 +261,8 @@ class EMCP_Tools_Plugin {
wp_register_ability_category(
'emcp-tools',
array(
'label' => __( 'MCP Tools for Elementor', 'emcp-tools' ),
'description' => __( 'Tools for reading and manipulating Elementor page designs via MCP.', 'emcp-tools' ),
'label' => __( 'Heretek Control Core', 'emcp-tools' ),
'description' => __( 'Tools for site management, content, and page builders via MCP.', 'emcp-tools' ),
)
);
}
@@ -344,7 +344,7 @@ class EMCP_Tools_Plugin {
'emcp-tools-server', // server_id
'mcp', // route_namespace
'emcp-tools-server', // route
__( 'MCP Tools for Elementor Server', 'emcp-tools' ), // server_name
__( 'Heretek Control Core Server', 'emcp-tools' ), // server_name
EMCP_Tools_Site_Context::compose_instructions( EMCP_Tools_Site_Context::default_base() . "\n\n" . EMCP_Tools_Site_Context::environment_summary() ), // description (base + env + site context)
'v' . EMCP_TOOLS_VERSION, // version
array( \WP\MCP\Transport\HttpTransport::class ), // transports
+6 -6
View File
@@ -1,6 +1,6 @@
=== MCP Tools for Elementor & WordPress ===
=== Heretek Control Core ===
Contributors: Heretek-AI, mianshahzadraza
Tags: elementor, mcp, ai, gutenberg, claude
Tags: mcp, ai, automation, elementor, gutenberg
Requires at least: 6.9
Tested up to: 7.1
Stable tag: 3.16.1
@@ -8,11 +8,11 @@ Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Professional Model Context Protocol (MCP) server bridging WordPress, Elementor & Gutenberg to AI assistants (Claude, Cursor, ChatGPT, Antigravity) with 269+ enterprise abilities.
Autonomous Model Context Protocol (MCP) server connecting site builders, themes, and content management to AI assistants (Claude, Cursor, ChatGPT, Antigravity) with 269+ enterprise abilities.
== Description ==
MCP Tools for Elementor bridges the gap between AI tools and Elementor page design. It extends the official WordPress MCP Adapter to expose a focused set of MCP (Model Context Protocol) tools that let AI agents like Claude, Cursor, and other MCP-compatible clients create and manipulate Elementor page designs programmatically.
Heretek Control Core connects your site to AI assistants and agents via the Model Context Protocol (MCP). It extends the official WordPress MCP Adapter to expose a comprehensive set of MCP tools that let AI agents like Claude, Cursor, and other MCP-compatible clients manage site content, configure settings, and manipulate page designs programmatically.
As of v3.0.0 the 62 per-widget tools were folded into a catalog-backed model, so the active tool surface is much smaller while every widget stays reachable, and the toolset takes its first steps beyond Elementor with general WordPress content management, curated site-settings control, full plugin and theme management, media attachment management, safe user management, filesystem access, and database inspection over MCP. The v3.0.0 beyond-Elementor surface adds 8 WordPress Content tools + 3 surfaced WordPress core abilities + 2 WordPress Settings tools + 13 Plugins & Themes tools + 3 Media Library tools + 4 Users tools + 1 Performance Analyzer tool + 1 Security & Malware Scanner tool + 6 Filesystem tools + 6 Database tools. Tool counts scale with your environment (registered counts, verified on Elementor 4.1.4): around 107 tools on a free Elementor install, ~121 with the Elementor 4.0+ atomic elements, ~117 with Elementor Pro, and ~131 with Pro + Elementor 4.0+ (WooCommerce widgets are reached through add-pro-widget; the Pro build also registers a woo-read/woo-write dispatcher pair over products, orders, and customers). When Advanced Custom Fields (free or PRO) is active, 2 ACF tools register on top of any of those counts: `acf-read` and `acf-write`, two dispatchers that expose 15 ACF operations (8 read, 7 write; the Custom Post Type and taxonomy operations need ACF 6.1+). Each dispatcher is a single toggle under Tools → Plugins → ACF, listing the operations it covers; `acf-read` is on by default and `acf-write` ships off. About 39 other tools ship disabled-by-default (SEO & Accessibility, Widget Builder, PHP Snippets, the 9 Plugins & Themes write tools, delete-media, the 2 Users write tools, the 3 Filesystem write tools, and the 3 Database write tools), so the typical active surface is smaller.
@@ -68,9 +68,9 @@ As of v3.0.0 the 62 per-widget tools were folded into a catalog-backed model, so
== Installation ==
1. Upload the `emcp-tools` folder to `/wp-content/plugins/`.
1. Upload the `heretek-control-core` folder to `/wp-content/plugins/`.
2. Activate the plugin through the 'Plugins' menu in WordPress. The MCP Adapter is bundled. No separate install is required (WordPress 6.9+ already includes the Abilities API).
3. Open the new **EMCP Tools** top-level menu, go to the **Connection** tab, and confirm **Activate Abilities API for EMCP** is enabled (on by default) to expose the MCP server.
3. Open the new **Heretek Core** top-level menu, go to the **Connection** tab, and confirm **Activate Abilities API for EMCP** is enabled (on by default) to expose the MCP server.
4. (Optional) Install and activate [Elementor](https://wordpress.org/plugins/elementor/) (version 3.20+) to enable the Elementor tool family (page design, widgets, layout, templates, brand kits, and more). All beyond-Elementor tools are fully functional without it.
= WP-CLI Connection (Local) =