| @@ -291,8 +291,19 @@ | ||
| 291 | 291 | add_action( 'admin_notices', array('WPFunnels\Admin\Notices\Notice', 'woocommerce_dependency_notice') ); |
| 292 | 292 | return; |
| 293 | 293 | }*/ |
| 294 | 294 | |
| 295 | + /** | |
| 296 | + * Store Checkout needs WooCommerce. While it is missing, keep the | |
| 297 | + * activation endpoint registered so the Store Checkout screen can | |
| 298 | + * install/activate WooCommerce without leaving the page. | |
| 299 | + * | |
| 300 | + * @since 3.13.1 | |
| 301 | + */ | |
| 302 | + if ( ! Wpfnl_functions::is_wc_active() ) { | |
| 303 | + add_action( 'wp_ajax_plugin_install_success', array( $this, 'plugin_install_success' ) ); | |
| 304 | + } | |
| 305 | + | |
| 295 | 306 | // load core modules |
| 296 | 307 | add_action( 'admin_footer', array($this, 'admin_footer_style') ); |
| 297 | 308 | add_action( 'wpfunnels/pro_init', array( $this, 'after_pro_plugin_init' ) ); |
| 298 | 309 | add_action( 'plugins_loaded', array($this, 'load_plugin'), 9 ); |
| @@ -429,9 +440,9 @@ | ||
| 429 | 440 | |
| 430 | 441 | $this->widget_manager = Widget_Manager::getInstance()->init(); |
| 431 | 442 | $this->page_templates = new PageTemplates\Manager(); |
| 432 | 443 | $this->admin_notice = new Notice(); |
| 433 | - $this->admin_banner = new SpecialOccasionBanner('ugcity', '2026-03-16 00:00:01', '2026-03-24 23:59:59', 'https://rextheme.com/ugc-for-woocommerce-ugcify/?utm_source=plugin&utm_medium=dashboard-banner-wpf&utm_campaign=ugcify-early-access'); | |
| 444 | + $this->admin_banner = new SpecialOccasionBanner('4thjuly', '2026-07-02 00:00:01', '2026-07-07 23:59:59', 'https://getwpfunnels.com/pricing/?utm_source=plugin&utm_medium=dashboard-banner-wpf&utm_campaign=4THJULY2026'); | |
| 434 | 445 | $this->setup_reminder_banner = new SetupReminderBanner(); |
| 435 | 446 | $this->order_bump_actions = new Wpfnl_Order_Bump_Action(); |
| 436 | 447 | $this->testimonial_actions = new Wpfnl_Testimonial_Action(); |
| 437 | 448 | $this->meta = new Wpfnl_Default_Meta(); |
| @@ -464,8 +475,23 @@ | ||
| 464 | 475 | $this->import_funnel = new Wpfnl_Import(); |
| 465 | 476 | |
| 466 | 477 | $this->reporting = Reporting::get_instance(); |
| 467 | 478 | $this->reporting->init(); |
| 479 | + | |
| 480 | + // AI copilot module: settings migration + conversation tables. | |
| 481 | + \WPFunnels\AI\AIInit::init(); | |
| 482 | + | |
| 483 | + // Tool layer: WordPress Abilities (always, when available) + the MCP | |
| 484 | + // server for external agents (gated on the `_wpfnl_mcp_enabled` option). | |
| 485 | + // Ability registration must NOT depend on that option — the in-plugin | |
| 486 | + // AI copilot resolves its own tools through the same registry | |
| 487 | + // (ToolGateway -> wp_get_abilities()), so turning off the external | |
| 488 | + // MCP endpoint would otherwise silently leave the copilot with zero | |
| 489 | + // tools to call. | |
| 490 | + if ( \WPFunnels\MCP\MCPInit::abilitiesApiAvailable() ) { | |
| 491 | + $expose_mcp_server = 'no' !== get_option( '_wpfnl_mcp_enabled', 'yes' ); | |
| 492 | + ( new \WPFunnels\MCP\MCPInit() )->init( $expose_mcp_server ); | |
| 493 | + } | |
| 468 | 494 | |
| 469 | 495 | Wpfnl_Activator::init(); |
| 470 | 496 | } |
| 471 | 497 | |