mirror of
https://github.com/Heretek-AI/heretek-control-core.git
synced 2026-10-12 02:03:55 +00:00
feat(admin): add an EMCP Modules tab and move EMCP's own subsystems onto it
The WordPress tab had grown to 21 sections, roughly half of which were not WordPress management at all but features this plugin implements itself: the theme builder, backup and migrate, redirects, the change ledger, the search index, the content mirror, the snippet sandbox, project memory, cloud sync. Thirteen sections move to a new EMCP Modules tab, leaving the WordPress tab to mean tools that drive WordPress APIs and nothing else. Three sections are new, filling the same gap the Themer tools had. The seven Cloud and Marketplace tools registered and worked but were catalogued nowhere, so they could not be toggled and no count included them. Resize Media moves out of Stock & Media into an Image Optimization section of its own: it is that module's only MCP tool and only registers when the module is on, so listing it beside the stock-photo tools left a dead toggle on the WordPress tab for anyone not using it. After this the only uncatalogued abilities are the three compact-mode meta-tools, which are excluded by design. Catalogued goes 260 to 267. Nothing changed about what any tool does, its permissions, or whether it is enabled by default. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a1e5043a80
commit
307ab778c0
@@ -12,6 +12,8 @@ Adds nine widgets and dynamic data to EMCP Themer, and rewrites how raw SQL is c
|
||||
Author Box and Sitemap also ship as blocks, since the block editor has no equivalent. Comments, search and post navigation already exist as core blocks, so those are not duplicated.
|
||||
- **The EMCP Themer widgets sit at the top of the panel while you edit a theme template.** The category used to land near the bottom, under everything else, which is the wrong place when the whole point of the screen is to build a template. On an ordinary page or post it stays where it was, and the widgets remain available there, since a sitemap, search form or posts grid is useful outside a template too.
|
||||
- **Post Meta and Archive Loop are untouched.** Post Info and Archive Posts are new widgets beside them, not replacements, so templates you have already built keep rendering exactly as they do now. Archive Loop is relabelled "Archive Posts (classic)" so the two are tellable apart in the panel.
|
||||
- **New "EMCP Modules" tab on the Tools screen.** The WordPress tab had grown to 21 sections, about half of which were not WordPress management at all: the theme builder, backup and migrate, redirects, the change ledger, content search, the content mirror, the PHP snippet sandbox, project memory, and cloud sync. Those now have their own tab, so the WordPress tab means tools that drive WordPress itself and nothing else. Nothing changed about what any tool does or whether it is enabled.
|
||||
- **The Cloud and Marketplace tools now appear on the Tools screen too,** in their own sections, along with Resize Media which moves from Stock & Media into an Image Optimization section of its own. Like the Themer tools, these registered and worked but were not listed anywhere, so they could not be toggled and were missing from every count.
|
||||
- **The nine EMCP Themer tools now appear on the Tools screen,** in their own section under the WordPress tab. They have always registered and worked, but had no entry on that screen, so you could not see them, could not switch one off on its own, and they were missing from every tool count the plugin reports. All nine stay on by default, and the Modules tab toggle remains the single switch for the whole feature.
|
||||
- **Themer templates can pull in live data, the way Elementor Pro's dynamic widgets do.** A heading can show the post title, an image can show the featured image, a button can link to the post. Pick the source from the field itself rather than hunting for a special widget: in Elementor it appears in the dynamic picker on any field that accepts one, and in the block editor it binds to a Heading, Paragraph, Image, or Button.
|
||||
**This works on free Elementor.** Elementor ships the machinery for dynamic fields but none of the sources, so on a free install the picker is empty. EMCP fills it. Ten sources are free: post title, post excerpt, post URL, post date, post ID, featured image, archive title, site title, site logo, and the site description.
|
||||
|
||||
+110
-15
@@ -1370,6 +1370,28 @@ class EMCP_Tools_Admin {
|
||||
* @since 3.13.0
|
||||
* @return string[]
|
||||
*/
|
||||
/**
|
||||
* The EMCP Cloud + Marketplace tool slugs.
|
||||
*
|
||||
* Doubly conditional: the Cloud module must be on AND the site must be
|
||||
* connected to an account, so their absence is the normal case and must not
|
||||
* read as drift.
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @return string[]
|
||||
*/
|
||||
public static function cloud_tool_slugs(): array {
|
||||
return array(
|
||||
'emcp-tools/cloud-status',
|
||||
'emcp-tools/cloud-list',
|
||||
'emcp-tools/cloud-backup',
|
||||
'emcp-tools/cloud-pull',
|
||||
'emcp-tools/cloud-config-sync',
|
||||
'emcp-tools/cloud-marketplace-list',
|
||||
'emcp-tools/cloud-marketplace-install',
|
||||
);
|
||||
}
|
||||
|
||||
public static function themer_tool_slugs(): array {
|
||||
return array(
|
||||
'emcp-tools/create-theme-template',
|
||||
@@ -3408,6 +3430,9 @@ class EMCP_Tools_Admin {
|
||||
'plugins' => __( 'Plugins', 'emcp-tools' ),
|
||||
'themes' => __( 'Themes', 'emcp-tools' ),
|
||||
'gutenberg' => __( 'Gutenberg', 'emcp-tools' ),
|
||||
// EMCP's own subsystems: features this plugin implements rather than
|
||||
// WordPress APIs it drives. Keeps the WordPress tab to core management.
|
||||
'modules' => __( 'EMCP Modules', 'emcp-tools' ),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4130,6 +4155,7 @@ class EMCP_Tools_Admin {
|
||||
// legitimately absent — skip them so the guard flags genuine drift
|
||||
// (renamed/removed tools) and not expected environment-gating.
|
||||
$emcp_conditional = array_merge(
|
||||
self::cloud_tool_slugs(),
|
||||
self::themer_tool_slugs(),
|
||||
self::themer_php_tool_slugs(),
|
||||
self::acf_tool_slugs(),
|
||||
@@ -4250,7 +4276,7 @@ class EMCP_Tools_Admin {
|
||||
),
|
||||
),
|
||||
'redirects' => array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Redirects', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/list-redirects' => array(
|
||||
@@ -4281,7 +4307,7 @@ class EMCP_Tools_Admin {
|
||||
),
|
||||
),
|
||||
'migrate' => array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Backup & Migrate', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/create-backup' => array(
|
||||
@@ -4509,7 +4535,7 @@ class EMCP_Tools_Admin {
|
||||
),
|
||||
),
|
||||
'transactions' => array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Changes & Rollback', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/list-changes' => array( 'label' => __( 'List Changes', 'emcp-tools' ), 'description' => __( 'List recent AI-made changes (Elementor/filesystem/database), newest first.', 'emcp-tools' ), 'badges' => array( 'read-only' ) ),
|
||||
@@ -4518,7 +4544,7 @@ class EMCP_Tools_Admin {
|
||||
),
|
||||
),
|
||||
'search' => array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Content Search', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/search-content' => array( 'label' => __( 'Search Content', 'emcp-tools' ), 'description' => __( 'Search the site\'s pages, templates, widgets, and global styles to reuse existing content.', 'emcp-tools' ), 'badges' => array( 'read-only' ) ),
|
||||
@@ -4526,7 +4552,7 @@ class EMCP_Tools_Admin {
|
||||
),
|
||||
),
|
||||
'content_mirror' => array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Content Mirror (Git)', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/export-content' => array( 'label' => __( 'Export Content', 'emcp-tools' ), 'description' => __( 'Export page/template content to git-trackable JSON files.', 'emcp-tools' ), 'badges' => array() ),
|
||||
@@ -5568,11 +5594,6 @@ class EMCP_Tools_Admin {
|
||||
'description' => __( 'Edit an attachment\'s alt text, title, caption, description.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
'emcp-tools/resize-media' => array(
|
||||
'label' => __( 'Resize Media', 'emcp-tools' ),
|
||||
'description' => __( 'Resize a Media Library image in place (scale to fit or crop), reversible via backup. Registers only when the Image Optimization module is enabled.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
'emcp-tools/delete-media' => array(
|
||||
'label' => __( 'Delete Media', 'emcp-tools' ),
|
||||
'description' => __( 'Delete an attachment (permanent; requires confirm).', 'emcp-tools' ),
|
||||
@@ -5784,7 +5805,7 @@ class EMCP_Tools_Admin {
|
||||
// v4) and the admin re-enables them here. There is no "activate" tool: an
|
||||
// AI can only create drafts; a human admin activates them on the Sandbox tab.
|
||||
$tools['php_snippets'] = array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'PHP Snippets (Sandbox)', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/validate-php-snippet' => array(
|
||||
@@ -5826,7 +5847,7 @@ class EMCP_Tools_Admin {
|
||||
// install. Both read/write in nature but low-risk (data movement, not
|
||||
// arbitrary execution) — enabled-by-default, unlike the sandboxes themselves.
|
||||
$tools['sandbox_cloud'] = array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Sandbox Cloud (Export / Import)', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/export-sandbox-artifact' => array(
|
||||
@@ -5845,7 +5866,7 @@ class EMCP_Tools_Admin {
|
||||
// Project Memory (Pro) — recall/remember/save-session-summary. Disabled by
|
||||
// default; the approved-guidance injection works with these off.
|
||||
$tools['memory'] = array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'pro' => true,
|
||||
'label' => __( 'Project Memory (Pro)', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
@@ -5867,6 +5888,80 @@ class EMCP_Tools_Admin {
|
||||
),
|
||||
);
|
||||
|
||||
// EMCP Cloud — free module, but the tools only register once the site is
|
||||
// actually connected to a cloud account, so the whole section is gated on
|
||||
// that rather than showing toggles that control nothing.
|
||||
if ( class_exists( 'EMCP_Tools_Cloud_Module' ) && EMCP_Tools_Cloud_Module::is_enabled()
|
||||
&& class_exists( 'EMCP_Tools_Cloud' ) && EMCP_Tools_Cloud::is_connected() ) {
|
||||
$tools['cloud'] = array(
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'EMCP Cloud', 'emcp-tools' ),
|
||||
'note' => __( 'Back up and sync your sandbox artifacts and settings to your EMCP Cloud account. These tools appear once this site is connected.', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/cloud-status' => array(
|
||||
'label' => __( 'Cloud Status', 'emcp-tools' ),
|
||||
'description' => __( 'Plan, limits, and usage for the connected account.', 'emcp-tools' ),
|
||||
'badges' => array( 'read-only' ),
|
||||
),
|
||||
'emcp-tools/cloud-list' => array(
|
||||
'label' => __( 'Cloud List', 'emcp-tools' ),
|
||||
'description' => __( 'List the artifacts backed up to your account, optionally by kind.', 'emcp-tools' ),
|
||||
'badges' => array( 'read-only' ),
|
||||
),
|
||||
'emcp-tools/cloud-backup' => array(
|
||||
'label' => __( 'Cloud Backup', 'emcp-tools' ),
|
||||
'description' => __( 'Back up a local sandbox artifact (block, widget, or PHP snippet) to your account.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
'emcp-tools/cloud-pull' => array(
|
||||
'label' => __( 'Cloud Pull', 'emcp-tools' ),
|
||||
'description' => __( 'Pull a cloud artifact into this site by UUID. It lands as a new inactive draft.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
'emcp-tools/cloud-config-sync' => array(
|
||||
'label' => __( 'Cloud Config Sync', 'emcp-tools' ),
|
||||
'description' => __( 'Push or pull a config blob (settings, brand kit, tool toggles) to or from EMCP Cloud.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$tools['marketplace'] = array(
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Marketplace', 'emcp-tools' ),
|
||||
'note' => __( 'Browse and install published EMCP Cloud marketplace listings. An install always lands as a new inactive draft for you to review before it runs.', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/cloud-marketplace-list' => array(
|
||||
'label' => __( 'Marketplace List', 'emcp-tools' ),
|
||||
'description' => __( 'Browse published marketplace listings (blocks, widgets, snippets).', 'emcp-tools' ),
|
||||
'badges' => array( 'read-only' ),
|
||||
),
|
||||
'emcp-tools/cloud-marketplace-install' => array(
|
||||
'label' => __( 'Marketplace Install', 'emcp-tools' ),
|
||||
'description' => __( 'Install a listing by slug. It is imported as a new inactive draft.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Image Optimization — free, opt-in module (it mutates uploads). One tool;
|
||||
// the compression and WebP pipeline itself is settings, not MCP surface.
|
||||
if ( class_exists( 'EMCP_Tools_Image_Optimization_Module' ) && EMCP_Tools_Image_Optimization_Module::module_is_active() ) {
|
||||
$tools['image_optimization'] = array(
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Image Optimization', 'emcp-tools' ),
|
||||
'note' => __( 'Compression, WebP generation, and the bulk optimizer are configured on the Modules tab. This is the one operation exposed over MCP.', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/resize-media' => array(
|
||||
'label' => __( 'Resize Media', 'emcp-tools' ),
|
||||
'description' => __( 'Resize a Media Library image in place (scale to fit, or crop to exact size). The attachment id and URLs are unchanged, and the original is backed up.', 'emcp-tools' ),
|
||||
'badges' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// EMCP Themer — free, module-gated. The template CPT lives under its own
|
||||
// top-level menu, but the tools belong on this grid like every other
|
||||
// domain, so an admin can see and toggle them individually. All nine are
|
||||
@@ -5874,7 +5969,7 @@ class EMCP_Tools_Admin {
|
||||
// kill switch for the whole feature.
|
||||
if ( class_exists( 'EMCP_Tools_Themer_Module' ) && EMCP_Tools_Themer_Module::is_enabled() ) {
|
||||
$tools['themer'] = array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'EMCP Themer (theme builder)', 'emcp-tools' ),
|
||||
'note' => __( 'Build headers, footers, and single/archive/search/404 layouts with any page builder, then decide where each one applies. Template CONTENT is built with the Gutenberg or Elementor tools against the returned template_id; these tools create and route the templates.', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
@@ -5933,7 +6028,7 @@ class EMCP_Tools_Admin {
|
||||
// module is active, alongside where the feature actually lives.
|
||||
if ( class_exists( 'EMCP_Tools_Themer_Module' ) && EMCP_Tools_Themer_Module::is_enabled() ) {
|
||||
$tools['themer_php'] = array(
|
||||
'platform' => 'wordpress',
|
||||
'platform' => 'modules',
|
||||
'label' => __( 'Themer PHP Templates', 'emcp-tools' ),
|
||||
'tools' => array(
|
||||
'emcp-tools/create-theme-php-template' => array(
|
||||
|
||||
+1
-1
Submodule pro updated: 201938aeb3...162e934dbb
@@ -181,6 +181,8 @@ Adds nine widgets and dynamic data to EMCP Themer, and rewrites how raw SQL is c
|
||||
* Added: nine new Themer widgets, so a Single, Archive, Search or 404 template can actually be finished: Author Box, Post Navigation, Post Comments, Search Form, Sitemap, Post Info, Archive Posts, Featured Image and Post Excerpt. All free. Author Box and Sitemap also ship as blocks; comments, search and post navigation already exist as core blocks so they are not duplicated.
|
||||
* Added: the EMCP Themer widgets sit at the top of the panel while you edit a theme template, instead of near the bottom. On an ordinary page or post they stay where they were and remain available, since a sitemap, search form or posts grid is useful outside a template too.
|
||||
* Added: Post Info and Archive Posts are new widgets beside Post Meta and Archive Loop rather than replacements, so templates you have already built keep rendering exactly as they do now. Archive Loop is relabelled "Archive Posts (classic)" so the two are tellable apart.
|
||||
* Added: a new "EMCP Modules" tab on the Tools screen. The WordPress tab had grown to 21 sections, about half of which were EMCP features rather than WordPress management (theme builder, backup and migrate, redirects, changes and rollback, content search, content mirror, PHP snippets, project memory, cloud). Those move to their own tab. Nothing changed about what any tool does.
|
||||
* Added: the Cloud and Marketplace tools now appear on the Tools screen, and Resize Media moves into its own Image Optimization section. They worked before but were not listed anywhere.
|
||||
* Added: the nine EMCP Themer tools now appear on the Tools screen, in their own section under the WordPress tab. They always worked but had no entry there, so you could not see or toggle them individually. All nine stay on by default.
|
||||
* Added: Themer templates can pull in live data the way Elementor Pro's dynamic widgets do. A heading can show the post title, an image the featured image, a button can link to the post. You pick the source from the field itself: in Elementor it appears in the dynamic picker, and in the block editor it binds to a Heading, Paragraph, Image or Button.
|
||||
* Added: this works on free Elementor. Elementor ships the machinery for dynamic fields but none of the sources, so on a free install that picker is empty. EMCP fills it with ten free sources: post title, excerpt, URL, date and ID, featured image, archive title, site title, site logo and site description. Pro adds custom fields (ACF-aware), author details, taxonomy terms, and a fallback value for when a field is empty.
|
||||
|
||||
Reference in New Issue
Block a user