insights()->init(); // The legacy procedural inc/* code has been fully removed — the new React + REST architecture // (bootstrap.php) now provides every feature: settings, the AI Assistant + editor integrations // (Classic/Gutenberg/Elementor), generation, templates, WooCommerce, bulk and white-label. // Signal readiness — the Pro plugin waits on this (did_action('wpwand_init')) before booting. do_action('wpwand_init'); } add_action('plugins_loaded', 'wpwand_init', 10); function wpwand_pro_version_check() { if (!is_admin()) { return; } if (isset($_GET['force-check']) && check_admin_referer('wpwand_pro_force_update_check')) { wp_clean_plugins_cache(); wp_update_plugins(); wp_safe_redirect(admin_url('plugins.php')); exit; } // Determine the installed Pro version straight from its header (works even when the // legacy Pro build never defined a version constant), and require a 2.0.0+ match. $pro_file = WP_PLUGIN_DIR . '/wp-wand-pro/wp-wand-pro.php'; if (!file_exists($pro_file)) { return; } if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $pro_version = get_plugin_data($pro_file, false, false)['Version']; if ($pro_version && version_compare($pro_version, '2.0.0', '<')) { add_action('admin_notices', function () { $force_update_url = wp_nonce_url(admin_url('admin.php?page=wpwand&force-check=1'), 'wpwand_pro_force_update_check'); echo '
'; printf( /* translators: %s: URL to trigger a plugin update check */ wp_kses(__('Action required: WP Wand Pro must be updated to version 2.0.0 or higher to match WP Wand 2.0.0. Your Pro features are paused until the update completes. Update now', 'wp-wand'), ['a' => ['href' => []], 'strong' => []]), esc_url($force_update_url) ); echo '
' . esc_html__('WP Wand requires PHP 7.4 or higher. Please upgrade your PHP version.', 'wp-wand') . '