insights()->init(); // Include required files require_once WPWAND_PLUGIN_DIR . 'inc/config.php'; require_once WPWAND_PLUGIN_DIR . 'inc/editor.php'; require_once WPWAND_PLUGIN_DIR . 'inc/admin.php'; require_once WPWAND_PLUGIN_DIR . 'inc/data.php'; require_once WPWAND_PLUGIN_DIR . 'inc/helper-functions.php'; require_once WPWAND_PLUGIN_DIR . 'inc/frontend.php'; require_once WPWAND_PLUGIN_DIR . 'inc/api.php'; require_once WPWAND_PLUGIN_DIR . 'inc/WooCommerce.php'; if (!function_exists('wpwand_pro_init')) { require_once WPWAND_PLUGIN_DIR . 'inc/post-generator.php'; } $is_agency = wpwand_get_option('wpwand_pro_tala_agency'); if (!$is_agency) { require_once WPWAND_PLUGIN_DIR . 'inc/white-label.php'; } require_once WPWAND_PLUGIN_DIR . 'inc/gutenberg.php'; // Add Elementor initialization hook add_action('elementor/init', function() { require_once WPWAND_PLUGIN_DIR . 'inc/modules/elementor/wp-wand-elementor.php'; WDELMTR_Extension::instance(); }); do_action('wpwand_init'); } add_action('plugins_loaded', 'wpwand_init', 100); function wpwand_pro_version_check() { if (!defined('WPWAND_PRO_VERSION')) { return; } if (isset($_GET['force-check']) && check_admin_referer('wpwand_pro_force_update_check')) { wp_clean_plugins_cache(); wp_update_plugins(); wp_redirect(admin_url('plugins.php')); exit; } // Get pro version $pro_file = WP_PLUGIN_DIR . '/wp-wand-pro/wp-wand-pro.php'; if (file_exists($pro_file)) { $pro_data = get_plugin_data($pro_file); $pro_version = $pro_data['Version']; if (version_compare($pro_version, '1.2.3', '<')) { add_action('admin_notices', function() { $force_update_url = wp_nonce_url(admin_url('admin.php?page=wpwand-settings&force-check=1'), 'wpwand_pro_force_update_check'); echo '
' . sprintf( __('Please update WP Wand Pro to version 1.2.3 or higher for full compatibility. Update now', 'wp-wand'), $force_update_url ) . '
' . esc_html__('WP Wand requires PHP 7.4 or higher. Please upgrade your PHP version.', 'wp-wand') . '