essential-addons-for-elementor-lite
Last commit date
assets
1 year ago
includes
1 year ago
languages
1 year ago
vendor
2 years ago
autoload.php
7 years ago
config.php
1 year ago
essential_adons_elementor.php
1 year ago
index.php
3 years ago
readme.txt
1 year ago
wpml-config.xml
1 year ago
essential_adons_elementor.php
120 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Essential Addons for Elementor |
| 4 | * Description: The Essential plugin you install after Elementor! Packed with 100+ stunning elements like Data Table, Event Calendar, Filterable Gallery, WooCommerce. |
| 5 | * Plugin URI: https://essential-addons.com/ |
| 6 | * Author: WPDeveloper |
| 7 | * Version: 6.1.15 |
| 8 | * Author URI: https://wpdeveloper.com/ |
| 9 | * Text Domain: essential-addons-for-elementor-lite |
| 10 | * Domain Path: /languages |
| 11 | * |
| 12 | * WC tested up to: 9.8 |
| 13 | * Elementor tested up to: 3.29 |
| 14 | * Elementor Pro tested up to: 3.29 |
| 15 | */ |
| 16 | |
| 17 | if (!defined('ABSPATH')) { |
| 18 | exit; |
| 19 | } // Exit if accessed directly |
| 20 | |
| 21 | /** |
| 22 | * Defining plugin constants. |
| 23 | * |
| 24 | * @since 3.0.0 |
| 25 | */ |
| 26 | define('EAEL_PLUGIN_FILE', __FILE__); |
| 27 | define('EAEL_PLUGIN_BASENAME', plugin_basename(__FILE__)); |
| 28 | define('EAEL_PLUGIN_PATH', trailingslashit(plugin_dir_path(__FILE__))); |
| 29 | define('EAEL_PLUGIN_URL', trailingslashit(plugins_url('/', __FILE__))); |
| 30 | define('EAEL_PLUGIN_VERSION', '6.1.15'); |
| 31 | define('EAEL_ASSET_PATH', wp_upload_dir()['basedir'] . '/essential-addons-elementor'); |
| 32 | define('EAEL_ASSET_URL', wp_upload_dir()['baseurl'] . '/essential-addons-elementor'); |
| 33 | /** |
| 34 | * Including composer autoloader globally. |
| 35 | * |
| 36 | * @since 3.0.0 |
| 37 | */ |
| 38 | require_once EAEL_PLUGIN_PATH . 'autoload.php'; |
| 39 | |
| 40 | /** |
| 41 | * Including plugin config. |
| 42 | * |
| 43 | * @since 3.0.0 |
| 44 | */ |
| 45 | $GLOBALS['eael_config'] = require_once EAEL_PLUGIN_PATH . 'config.php'; |
| 46 | |
| 47 | /** |
| 48 | * Run plugin after all others plugins |
| 49 | * |
| 50 | * @since 3.0.0 |
| 51 | */ |
| 52 | add_action( 'plugins_loaded', function () { |
| 53 | if ( class_exists( '\Essential_Addons_Elementor\Classes\Bootstrap' ) ) { |
| 54 | \Essential_Addons_Elementor\Classes\Bootstrap::instance(); |
| 55 | } |
| 56 | } ); |
| 57 | |
| 58 | /** |
| 59 | * Plugin migrator |
| 60 | * |
| 61 | * @since v3.0.0 |
| 62 | */ |
| 63 | add_action('wp_loaded', function () { |
| 64 | $migration = new \Essential_Addons_Elementor\Classes\Migration; |
| 65 | $migration->migrator(); |
| 66 | }); |
| 67 | |
| 68 | /** |
| 69 | * Activation hook |
| 70 | * |
| 71 | * @since v3.0.0 |
| 72 | */ |
| 73 | register_activation_hook(__FILE__, function () { |
| 74 | $migration = new \Essential_Addons_Elementor\Classes\Migration; |
| 75 | $migration->plugin_activation_hook(); |
| 76 | }); |
| 77 | |
| 78 | /** |
| 79 | * Deactivation hook |
| 80 | * |
| 81 | * @since v3.0.0 |
| 82 | */ |
| 83 | register_deactivation_hook(__FILE__, function () { |
| 84 | $migration = new \Essential_Addons_Elementor\Classes\Migration; |
| 85 | $migration->plugin_deactivation_hook(); |
| 86 | }); |
| 87 | |
| 88 | /** |
| 89 | * Upgrade hook |
| 90 | * |
| 91 | * @since v3.0.0 |
| 92 | */ |
| 93 | add_action( 'upgrader_process_complete', function ( $upgrader_object, $options ) { |
| 94 | if ( class_exists( '\Essential_Addons_Elementor\Classes\Migration' ) ) { |
| 95 | $migration = new \Essential_Addons_Elementor\Classes\Migration; |
| 96 | $migration->plugin_upgrade_hook( $upgrader_object, $options ); |
| 97 | } |
| 98 | }, 10, 2 ); |
| 99 | |
| 100 | add_action( 'wp_loaded', function () { |
| 101 | $setup_wizard = get_option( 'eael_setup_wizard' ); |
| 102 | if ( $setup_wizard == 'redirect' ) { |
| 103 | \Essential_Addons_Elementor\Classes\WPDeveloper_Setup_Wizard::redirect(); |
| 104 | } |
| 105 | |
| 106 | if ( $setup_wizard == 'init' ) { |
| 107 | new \Essential_Addons_Elementor\Classes\WPDeveloper_Setup_Wizard(); |
| 108 | } |
| 109 | } ); |
| 110 | |
| 111 | /** |
| 112 | * WooCommerce HPOS Support |
| 113 | * |
| 114 | * @since v5.8.2 |
| 115 | */ |
| 116 | add_action( 'before_woocommerce_init', function() { |
| 117 | if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 118 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 119 | } |
| 120 | } ); |