abilities
3 weeks ago
avcf-cluster-loader.php
3 weeks ago
class-avcf-diagnostic.php
3 weeks ago
class-avcf-mcp-auth.php
3 weeks ago
class-avcf-mcp.php
3 weeks ago
avcf-cluster-loader.php
217 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Atarim DoIt — cluster class loader. |
| 4 | * |
| 5 | * Centralises every third-party / cluster require_once so the main plugin |
| 6 | * file stays stable as clusters are added or removed. Loading flow is |
| 7 | * UNCHANGED from when these lived in the main file: detectors load eagerly |
| 8 | * (phase 1); ability classes load only when the Abilities API + MCP Adapter |
| 9 | * are present, with the base class first, then the MCP layer is bootstrapped |
| 10 | * (phase 2). To add a cluster, add its require_once lines here — the main plugin |
| 11 | * file does not change. |
| 12 | * |
| 13 | * @package atarim-visual-collaboration |
| 14 | */ |
| 15 | |
| 16 | if ( ! defined('ABSPATH') ) { |
| 17 | exit; |
| 18 | } |
| 19 | |
| 20 | // --------------------------------------------------------------------------- |
| 21 | // Phase 1: detectors — eager, no AVCF_Abilities_Base dependency. |
| 22 | // --------------------------------------------------------------------------- |
| 23 | // WP Activity Log integration — third-party partner integration. |
| 24 | // (Abilities class is required below alongside the rest of the MCP layer.) |
| 25 | require_once( AVCF_PLUGIN_DIR . 'third-party/wp-activity-log/class-avcf-wpal-detector.php' ); |
| 26 | require_once( AVCF_PLUGIN_DIR . 'third-party/wp-activity-log/class-avcf-wpal-stats.php' ); |
| 27 | require_once( AVCF_PLUGIN_DIR . 'third-party/wp-activity-log/class-avcf-wpal-rest.php' ); |
| 28 | |
| 29 | // WooCommerce integration — detector is safe to load eagerly (no abilities-base dependency). |
| 30 | // Ability classes themselves are loaded inside the MCP conditional block below. |
| 31 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-detector.php' ); |
| 32 | |
| 33 | // ACF integration — detector is safe to load eagerly (no abilities-base dependency). |
| 34 | // Ability classes themselves are loaded inside the MCP conditional block below. |
| 35 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acf/class-avcf-acf-detector.php' ); |
| 36 | |
| 37 | // SEO integrations (Yoast / Rank Math / AIOSEO) — detectors load eagerly. |
| 38 | require_once( AVCF_PLUGIN_DIR . 'third-party/seo/yoast/class-avcf-yoast-detector.php' ); |
| 39 | require_once( AVCF_PLUGIN_DIR . 'third-party/seo/rank-math/class-avcf-rankmath-detector.php' ); |
| 40 | require_once( AVCF_PLUGIN_DIR . 'third-party/seo/aioseo/class-avcf-aioseo-detector.php' ); |
| 41 | |
| 42 | // Elementor integration — detector loads eagerly. |
| 43 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/elementor/class-avcf-elementor-detector.php' ); |
| 44 | |
| 45 | // Field-framework integrations (Wave 3) — detectors load eagerly. |
| 46 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/metabox/class-avcf-metabox-detector.php' ); |
| 47 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/jetengine/class-avcf-jetengine-detector.php' ); |
| 48 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/pods/class-avcf-pods-detector.php' ); |
| 49 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acpt/class-avcf-acpt-detector.php' ); |
| 50 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/ase/class-avcf-ase-detector.php' ); |
| 51 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/bricks/class-avcf-bricks-detector.php' ); |
| 52 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/divi/class-avcf-divi-detector.php' ); |
| 53 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/wpbakery/class-avcf-wpbakery-detector.php' ); |
| 54 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/breakdance/class-avcf-breakdance-detector.php' ); |
| 55 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/etch/class-avcf-etch-detector.php' ); |
| 56 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/mosaic/class-avcf-mosaic-detector.php' ); |
| 57 | |
| 58 | // Forms detectors (standalone per-plugin clusters). |
| 59 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/gravity-forms/class-avcf-gravity-detector.php' ); |
| 60 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/wpforms/class-avcf-wpforms-detector.php' ); |
| 61 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/fluent-forms/class-avcf-fluent-detector.php' ); |
| 62 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/formidable/class-avcf-formidable-detector.php' ); |
| 63 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/forminator/class-avcf-forminator-detector.php' ); |
| 64 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/ninja-forms/class-avcf-ninja-detector.php' ); |
| 65 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/contact-form-7/class-avcf-cf7-detector.php' ); |
| 66 | require_once( AVCF_PLUGIN_DIR . 'third-party/flamingo/class-avcf-flamingo-detector.php' ); |
| 67 | |
| 68 | // --------------------------------------------------------------------------- |
| 69 | // Phase 2: ability classes + MCP bootstrap — only when the Abilities API + MCP |
| 70 | // Adapter exist. Base class loads first; everything else extends it. This is the |
| 71 | // single place the availability check is made. |
| 72 | // --------------------------------------------------------------------------- |
| 73 | if ( function_exists('wp_get_abilities') && class_exists('\WP\MCP\Core\McpAdapter') ) { |
| 74 | // Ability category base class + core categories. |
| 75 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-base.php' ); |
| 76 | |
| 77 | // WooCommerce ability classes — extend AVCF_Abilities_Base, must load AFTER the base. |
| 78 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-products.php' ); |
| 79 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-variations.php' ); |
| 80 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-product-relations.php' ); |
| 81 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-orders.php' ); |
| 82 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-customers.php' ); |
| 83 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-coupons.php' ); |
| 84 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-shipping.php' ); |
| 85 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-tax.php' ); |
| 86 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-checkout-email.php' ); |
| 87 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-attributes.php' ); |
| 88 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-catalog.php' ); |
| 89 | |
| 90 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-content.php' ); |
| 91 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-gutenberg.php' ); |
| 92 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-plugins.php' ); |
| 93 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-themes.php' ); |
| 94 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-theme-files.php' ); |
| 95 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-core.php' ); |
| 96 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-taxonomies.php' ); |
| 97 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-users.php' ); |
| 98 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-settings.php' ); |
| 99 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-media.php' ); |
| 100 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-metadata.php' ); |
| 101 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-navigation.php' ); |
| 102 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-templates.php' ); |
| 103 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-global-styles.php' ); |
| 104 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-patterns.php' ); |
| 105 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-block-navigation.php' ); |
| 106 | require_once( AVCF_PLUGIN_DIR . 'doit/abilities/class-avcf-abilities-cache.php' ); |
| 107 | |
| 108 | // Forms cluster — unified surface over WPForms / Gravity / Forminator / |
| 109 | // Ninja / Fluent / Formidable / CF7. Load order matters: interface → |
| 110 | // abstract → per-plugin detectors+adapters → registry → orchestrator. |
| 111 | // Forms: Gravity Forms (standalone cluster). |
| 112 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/gravity-forms/class-avcf-gravity-helpers.php' ); |
| 113 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/gravity-forms/class-avcf-abilities-gravity.php' ); |
| 114 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/gravity-forms/class-avcf-abilities-gravity-pro.php' ); |
| 115 | // Forms: WPForms (standalone cluster). |
| 116 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/wpforms/class-avcf-wpforms-helpers.php' ); |
| 117 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/wpforms/class-avcf-abilities-wpforms.php' ); |
| 118 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/wpforms/class-avcf-abilities-wpforms-pro.php' ); |
| 119 | // Forms: Fluent Forms (standalone cluster). |
| 120 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/fluent-forms/class-avcf-fluent-helpers.php' ); |
| 121 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/fluent-forms/class-avcf-abilities-fluent.php' ); |
| 122 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/fluent-forms/class-avcf-abilities-fluent-pro.php' ); |
| 123 | // Forms: Formidable Forms (standalone cluster). |
| 124 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/formidable/class-avcf-formidable-helpers.php' ); |
| 125 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/formidable/class-avcf-abilities-formidable.php' ); |
| 126 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/formidable/class-avcf-abilities-formidable-pro.php' ); |
| 127 | // Forms: Forminator (standalone cluster). |
| 128 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/forminator/class-avcf-forminator-helpers.php' ); |
| 129 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/forminator/class-avcf-abilities-forminator.php' ); |
| 130 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/forminator/class-avcf-abilities-forminator-pro.php' ); |
| 131 | // Forms: Ninja Forms (standalone cluster). |
| 132 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/ninja-forms/class-avcf-ninja-helpers.php' ); |
| 133 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/ninja-forms/class-avcf-abilities-ninja.php' ); |
| 134 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/ninja-forms/class-avcf-abilities-ninja-pro.php' ); |
| 135 | // Forms: Contact Form 7 (standalone cluster, config-only). |
| 136 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/contact-form-7/class-avcf-cf7-helpers.php' ); |
| 137 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/contact-form-7/class-avcf-abilities-cf7.php' ); |
| 138 | require_once( AVCF_PLUGIN_DIR . 'third-party/forms/contact-form-7/class-avcf-abilities-cf7-pro.php' ); |
| 139 | // Forms: Flamingo (standalone cluster — CF7's companion entry store). |
| 140 | require_once( AVCF_PLUGIN_DIR . 'third-party/flamingo/class-avcf-flamingo-helpers.php' ); |
| 141 | require_once( AVCF_PLUGIN_DIR . 'third-party/flamingo/class-avcf-abilities-flamingo.php' ); |
| 142 | require_once( AVCF_PLUGIN_DIR . 'third-party/flamingo/class-avcf-abilities-flamingo-pro.php' ); |
| 143 | |
| 144 | // Third-party ability categories. |
| 145 | require_once( AVCF_PLUGIN_DIR . 'third-party/ecommerce/woocommerce/class-avcf-wc-abilities.php' ); |
| 146 | require_once( AVCF_PLUGIN_DIR . 'third-party/wp-activity-log/class-avcf-wpal-abilities.php' ); |
| 147 | |
| 148 | // ACF ability classes — extend AVCF_Abilities_Base, must load AFTER the base. |
| 149 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acf/class-avcf-acf-helpers.php' ); |
| 150 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acf/class-avcf-acf-field-groups.php' ); |
| 151 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acf/class-avcf-acf-content-models.php' ); |
| 152 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acf/class-avcf-acf-abilities.php' ); |
| 153 | |
| 154 | // SEO ability classes — extend AVCF_Abilities_Base, must load AFTER the base. |
| 155 | require_once( AVCF_PLUGIN_DIR . 'third-party/seo/yoast/class-avcf-abilities-yoast.php' ); |
| 156 | require_once( AVCF_PLUGIN_DIR . 'third-party/seo/rank-math/class-avcf-abilities-rankmath.php' ); |
| 157 | require_once( AVCF_PLUGIN_DIR . 'third-party/seo/aioseo/class-avcf-abilities-aioseo.php' ); |
| 158 | |
| 159 | // Elementor ability classes — extend AVCF_Abilities_Base, must load AFTER the base. |
| 160 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/elementor/class-avcf-elementor-helpers.php' ); |
| 161 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/elementor/class-avcf-abilities-elementor.php' ); |
| 162 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/elementor/class-avcf-abilities-elementor-pro.php' ); |
| 163 | |
| 164 | // Field-framework ability classes (Wave 3) — extend AVCF_Abilities_Base, load AFTER the base. |
| 165 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/metabox/class-avcf-metabox-helpers.php' ); |
| 166 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/metabox/class-avcf-abilities-metabox.php' ); |
| 167 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/jetengine/class-avcf-jetengine-helpers.php' ); |
| 168 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/jetengine/class-avcf-abilities-jetengine.php' ); |
| 169 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/pods/class-avcf-pods-helpers.php' ); |
| 170 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/pods/class-avcf-abilities-pods.php' ); |
| 171 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acpt/class-avcf-acpt-helpers.php' ); |
| 172 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/acpt/class-avcf-abilities-acpt.php' ); |
| 173 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/ase/class-avcf-ase-helpers.php' ); |
| 174 | require_once( AVCF_PLUGIN_DIR . 'third-party/content-model/ase/class-avcf-abilities-ase.php' ); |
| 175 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/bricks/class-avcf-bricks-helpers.php' ); |
| 176 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/bricks/class-avcf-abilities-bricks.php' ); |
| 177 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/bricks/class-avcf-abilities-bricks-pro.php' ); |
| 178 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/divi/class-avcf-divi-helpers.php' ); |
| 179 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/divi/class-avcf-abilities-divi.php' ); |
| 180 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/divi/class-avcf-abilities-divi-pro.php' ); |
| 181 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/wpbakery/class-avcf-wpbakery-helpers.php' ); |
| 182 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/wpbakery/class-avcf-abilities-wpbakery.php' ); |
| 183 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/wpbakery/class-avcf-abilities-wpbakery-pro.php' ); |
| 184 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/breakdance/class-avcf-breakdance-helpers.php' ); |
| 185 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/breakdance/class-avcf-abilities-breakdance.php' ); |
| 186 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/breakdance/class-avcf-abilities-breakdance-pro.php' ); |
| 187 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/etch/class-avcf-etch-helpers.php' ); |
| 188 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/etch/class-avcf-abilities-etch.php' ); |
| 189 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/etch/class-avcf-abilities-etch-pro.php' ); |
| 190 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/mosaic/class-avcf-mosaic-helpers.php' ); |
| 191 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/mosaic/class-avcf-abilities-mosaic.php' ); |
| 192 | require_once( AVCF_PLUGIN_DIR . 'third-party/page-builder/mosaic/class-avcf-abilities-mosaic-pro.php' ); |
| 193 | |
| 194 | // ----------------------------------------------------------------------- |
| 195 | // MCP bootstrap — orchestrator + hooks. Runs at load time, inside the same |
| 196 | // guard, so the availability check lives in exactly one place. |
| 197 | // ----------------------------------------------------------------------- |
| 198 | require_once( AVCF_PLUGIN_DIR . 'doit/class-avcf-mcp.php' ); |
| 199 | |
| 200 | $avcf_mcp = new AVCF_MCP(); |
| 201 | |
| 202 | // Register ability category and abilities at file load time. |
| 203 | // wp_abilities_api_init fires between rest_api_init priority 3-6, |
| 204 | // so hooks must be registered before rest_api_init fires — i.e. at file load time. |
| 205 | add_action( 'wp_abilities_api_categories_init', function() { |
| 206 | wp_register_ability_category( 'atarim', [ |
| 207 | 'label' => 'Atarim', |
| 208 | 'description' => 'Atarim AI action layer abilities.', |
| 209 | ]); |
| 210 | }); |
| 211 | |
| 212 | add_action( 'wp_abilities_api_init', [ $avcf_mcp, 'avcf_mcp_register_abilities' ] ); |
| 213 | |
| 214 | // Initialize MCP Adapter — hooks rest_api_init internally to fire mcp_adapter_init. |
| 215 | \WP\MCP\Core\McpAdapter::instance(); |
| 216 | } |
| 217 |