<?php
/**
 * Plugin Name: Divi Integration Addon
 * Plugin URI:
 * Description: Integrates JetEngine and JetSmartFilters features into the Divi 5
 * Version:     0.9.0
 * Author:      wpsite.pro
 * Author URI: https://wpsite.pro
 * Text Domain: jet-engine-divi-views
 * License:     GPL-3.0+
 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
 * Domain Path: /languages
 *
 * @package JetProductTables
 */

// Prevent direct access to the file, ensuring the file is only accessed through WordPress mechanisms.
if ( ! defined( 'WPINC' ) ) {
	die(); // Exit if accessed directly.
}

// Define the current version of the plugin.
define( 'JET_ENGINE_DIVI_VIEWS_VERSION', '0.9.0' );

// Define a constant for the plugin file path.
define( 'JET_ENGINE_DIVI_VIEWS__FILE__', __FILE__ );

// Define a base for the plugin, used for generating links to the plugin's pages.
define( 'JET_ENGINE_DIVI_VIEWS_PLUGIN_BASE', plugin_basename( JET_ENGINE_DIVI_VIEWS__FILE__ ) );

// Define the absolute path to the plugin's directory.
define( 'JET_ENGINE_DIVI_VIEWS_PATH', plugin_dir_path( JET_ENGINE_DIVI_VIEWS__FILE__ ) );

// Define the absolute path to the plugin's directory.
define( 'JET_ENGINE_DIVI_VIEWS_MODULES_JSON_PATH', JET_ENGINE_DIVI_VIEWS_PATH . 'modules-json/' );

// Define the URL to the plugin's directory, useful for loading assets like JavaScript and CSS files.
define( 'JET_ENGINE_DIVI_VIEWS_URL', plugins_url( '/', JET_ENGINE_DIVI_VIEWS__FILE__ ) );

register_activation_hook( __FILE__, function() {
	add_option( 'jedv_wizard_activation_redirect', 1 );
} );

// Register an action with WordPress to initialize the plugin once all plugins are loaded.
add_action( 'plugins_loaded', 'jet_engine_divi_views_init', 99 );

/**
 * Initializes the Jet WooCommerce Product Table plugin.
 * This function defines several constants for use throughout the plugin and requires the main plugin class file.
 */
function jet_engine_divi_views_init() {
	// Include the main plugin file that initializes the plugin's classes and functionality.
	require JET_ENGINE_DIVI_VIEWS_PATH . 'includes/plugin.php';
}
