<?php
/*
 * Plugin Name: Ignition Widgets for Elementor
 * Plugin URI: https://www.cssigniter.com/plugins/ignition-elementor-widgets/
 * Description: Elementor Widgets for the Ignition Framework
 * Author: The CSSIgniter Team
 * Author URI: https://www.cssigniter.com
 * Version: 1.5.2
 * Elementor tested up to: 3.15.2
 * Text Domain: ignition-elementor-widgets
 * Domain Path: languages
 *
 * Ignition Widgets for Elementor is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * any later version.
 *
 * Ignition Widgets for Elementor is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Ignition Widgets for Elementor. If not, see <http://www.gnu.org/licenses/>.
 */
namespace CSSIgniter\Ignition\Elementor;

use Ignition_Widgets_Settings;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! defined( 'IGNITION_ELEMENTOR_WIDGETS_VERSION' ) ) {
	if ( ! function_exists( 'get_plugin_data' ) ) {
		include_once ABSPATH . 'wp-admin/includes/plugin.php';
	}
	$plugin_data = get_plugin_data( __FILE__ );
	/**
	 * Current Ignition plugin version.
	 *
	 * @since 1.0.0
	 */
	define( 'IGNITION_ELEMENTOR_WIDGETS_VERSION', $plugin_data['Version'] );
}


class Ignition_Elementor_Widgets {

	/**
	 * Instance of this class.
	 *
	 * @var Ignition_Elementor_Widgets
	 * @since 1.0.0
	 */
	protected static $instance = null;

	/**
	 * The URL directory path (with trailing slash) of the main plugin file.
	 *
	 * @var string
	 * @since 1.0.0
	 */
	protected static $plugin_url = '';

	/**
	 * The filesystem directory path (with trailing slash) of the main plugin file.
	 *
	 * @var string
	 * @since 1.0.0
	 */
	protected static $plugin_path = '';

	/**
	 * @var \Elementor\Plugin
	 */
	public $elementor;

	/**
	 * Ignition_Elementor_Widgets Instance.
	 *
	 * Instantiates or reuses an instance of Ignition_Elementor_Widgets.
	 *
	 * @since 1.0.0
	 * @static
	 * @see Ignition_Elementor_Widgets()
	 * @return Ignition_Elementor_Widgets - Single instance.
	 */
	public static function instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}
		return self::$instance;
	}


	/**
	 * Ignition_Elementor_Widgets constructor. Intentionally left empty so that instances can be created without
	 * re-loading of resources (e.g. scripts/styles), or re-registering hooks.
	 * http://wordpress.stackexchange.com/questions/70055/best-way-to-initiate-a-class-in-a-wp-plugin
	 * https://gist.github.com/toscho/3804204
	 *
	 * @since 1.0.0
	 */
	public function __construct() {}

	/**
	 * Kickstarts plugin loading.
	 *
	 * @since 1.0.0
	 */
	public function plugin_setup() {
		self::$plugin_url  = plugin_dir_url( __FILE__ );
		self::$plugin_path = plugin_dir_path( __FILE__ );

		load_plugin_textdomain( 'ignition-elementor-widgets', false, dirname( self::plugin_basename() ) . '/languages' );

		if ( ! $this->dependency_check( true ) ) {
			add_action( 'admin_notices', array( $this, 'dependency_check' ) );

			return;
		}

		$this->elementor = \Elementor\Plugin::instance();

		// Initialization needed in every request.
		$this->init();

		// Initialization needed in frontend requests.
		if ( ! is_admin() ) {
			$this->frontend_init();
		}

		do_action( 'ignition_elementor_widgets_loaded' );
	}

	/**
	 * Registers actions that need to be run on both admin and frontend
	 *
	 * @since 1.0.0
	 */
	protected function init() {

		add_action( 'init', array( $this, 'register_scripts' ) );

		add_action( 'init', array( $this, 'load_settings' ) );

		add_action( 'elementor/init', array( $this, 'load_includes' ) );

		add_action( 'elementor/init', array( $this, 'load_library' ) );

		add_action( 'elementor/init', array( $this, 'create_widget_section' ) );

		add_action( 'elementor/init', array( $this, 'register_global_tools' ) );

		add_action( 'elementor/controls/register', array( $this, 'register_controls' ) );
		add_action( 'elementor/widgets/register', array( $this, 'add_widget' ) );

		add_action( 'elementor/preview/enqueue_scripts', array( $this, 'editor_scripts' ) );

		add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'editor_enqueue' ) );

		add_action( 'elementor/preview/enqueue_styles', array( $this, 'enqueue_preview_styles' ) );

		add_action( 'wp_enqueue_styles', 'ignition_elementor_styles' );

		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );

		do_action( 'ignition_elementor_widgets_init' );
	}

	/**
	 * Registers actions that need to be run on frontend only.
	 *
	 * @since 1.0.0
	 */
	protected function frontend_init() {
		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );

		do_action( 'ignition_elementor_widgets_frontend_init' );
	}

	public function editor_scripts() {
		wp_enqueue_script( 'ignition-elementor-widgets-scripts', $this->plugin_url() . 'assets/js/scripts.min.js', array( 'slick' ), IGNITION_ELEMENTOR_WIDGETS_VERSION, true );
	}

	public function editor_enqueue() {
		Library_Manager::enqueue_assets();
	}


	/**
	 * Enqueue stylesheets only for preview window
	 *
	 * @return void
	 */
	public function enqueue_preview_styles() {
		wp_enqueue_style( 'ignition-elementor-template-style', $this->plugin_url() . 'assets/css/admin/templates.min.css', array(), IGNITION_ELEMENTOR_WIDGETS_VERSION );
	}

	/**
	 * Load plugin settings page.
	 *
	 * @since 1.4.0
	 */
	public function load_settings() {
		require_once untrailingslashit( $this->plugin_path() ) . '/includes/settings-page.php';
	}

	/**
	 * Register (but not enqueue) all scripts and styles to be used throughout the plugin.
	 *
	 * @since 1.0.0
	 */
	public function register_scripts() {
		wp_register_style( 'ignition-elementor-widgets-styles', $this->plugin_url() . 'assets/css/styles.min.css', array(), IGNITION_ELEMENTOR_WIDGETS_VERSION );

		wp_register_style( 'ignition-elementor-instagram-filters', $this->plugin_url() . 'assets/css/instagram-filters.min.css', array(), IGNITION_ELEMENTOR_WIDGETS_VERSION );

		wp_register_style( 'ignition-elementor-sticky-video', $this->plugin_url() . 'assets/css/sticky-video.min.css', array(), IGNITION_ELEMENTOR_WIDGETS_VERSION );

		wp_register_script( 'ignition-elementor-sticky-video', $this->plugin_url() . 'assets/js/sticky-video.min.js', array( 'jquery' ), IGNITION_ELEMENTOR_WIDGETS_VERSION, true );

		wp_register_script( 'vanilla-tilt', $this->plugin_url() . 'assets/vendor/vanillaTilt/vanilla-tilt.min.js', array(), IGNITION_ELEMENTOR_WIDGETS_VERSION, true );
	}

	/**
	 * Enqueues frontend scripts and styles.
	 *
	 * @since 1.0.0
	 */
	public function enqueue_scripts() {
		wp_enqueue_style( 'ignition-elementor-widgets-styles' );

		$options = $this->get_sanitized_options();

		if ( 1 === $options['instagram_filters'] ) {
			wp_enqueue_style( 'ignition-elementor-instagram-filters' );
		}

		if ( 1 === $options['sticky_videos'] ) {
			wp_enqueue_style( 'ignition-elementor-sticky-video' );
			wp_enqueue_script( 'ignition-elementor-sticky-video' );
		}

		if ( 1 === $options['tilt'] ) {
			wp_enqueue_script( 'vanilla-tilt' );
		}
	}

	/**
	 * Enqueues settings page styles.
	 *
	 * @since 1.4.0
	 */
	public function enqueue_admin_styles( $hook ) {
		if ( 'elementor_page_ignition_widgets' !== $hook ) {
			return;
		}

		wp_enqueue_style( 'ignition-elementor-settings', $this->plugin_url() . 'assets/css/admin/settings.min.css', array(), IGNITION_ELEMENTOR_WIDGETS_VERSION );
	}

	/**
	 * Loads common and helper functions for the Post Types Element.
	 *
	 * @since 1.0.0
	 */
	public function load_includes() {
		require_once untrailingslashit( $this->plugin_path() ) . '/includes/class-widgets-helper.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/includes/trait-common-functions.php';
	}

	/**
	 * Loads common and helper functions for the Post Types Element.
	 *
	 * @since 1.0.0
	 */
	public function load_library() {
		require_once untrailingslashit( $this->plugin_path() ) . '/includes/class-library-source.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/includes/class-library-manager.php';
	}

	/**
	 * Registers the post query options control.
	 *
	 * @since 1.0.0
	 */
	public function register_controls() {
		require_once untrailingslashit( $this->plugin_path() ) . '/includes/class-posts-group-control.php';
		$this->elementor->controls_manager->add_group_control( 'posts_group', new \CSSIgniter\Ignition\Elementor\Posts_Group_Control() );
	}

	/**
	 * Creates the Elementor widget section.
	 *
	 * @since 1.0.0
	 */
	public function create_widget_section() {
		$this->elementor->elements_manager->add_category(
			'ignition-elementor-widgets',
			array(
				'title' => __( 'Ignition Widgets', 'ignition-elementor-widgets' ),
				'icon'  => 'font',
			)
		);
	}

	/**
	 * Registers tools for all elements.
	 *
	 * @since 1.4.0
	 */
	public function register_global_tools() {
		$options = $this->get_sanitized_options();

		if ( isset( $options['tilt'] ) && 1 === $options['tilt'] ) {
			require_once untrailingslashit( $this->plugin_path() ) . '/widgets/tilt.php';
		}

		if ( isset( $options['scheduled'] ) && 1 === $options['scheduled'] ) {
			require_once untrailingslashit( $this->plugin_path() ) . '/widgets/scheduled.php';
		}
	}

	/**
	 * Sanitizes and returns element options.
	 *
	 * @since 1.4.0
	 */
	public function get_sanitized_options() {
		$defaults = '';

		if ( class_exists( '\Ignition_Widgets_Settings' ) ) {
			$defaults = \Ignition_Widgets_Settings::get_default_settings();
		}

		$options = wp_parse_args( get_option( 'ignition_widgets_settings' ), $defaults );

		foreach ( $options as $option => $value ) {
			$options[ $option ] = intval( $value );
		}

		return $options;
	}

	public function ignition_elementor_get_available_elements() {
		$available_elements = array(
			'cf7'                       => array(
				'title'   => __( 'Contact Form 7', 'ignition-elementor-widgets' ),
				'label'   => __( 'Embed and style Contact Form 7 forms in Elementor.', 'ignition-elementor-widgets' ),
				'class'   => 'Contact_Form_7',
				'plugin'  => 'WPCF7',
				'file'    => 'class-contact-form-7',
				/* translators: %s is a URL. */
				'warning' => sprintf( __( '<a href="%s" target="_blank">Contact Form 7</a> is not active. Install and activate the plugin to use this module.', 'ignition-elementor-widgets' ), 'https://wordpress.org/plugins/contact-form-7/' ),
			),
			'countdown'                 => array(
				'title' => __( 'Countdown', 'ignition-elementor-widgets' ),
				'label' => __( 'A simple yet versatile countdown widget.', 'ignition-elementor-widgets' ),
				'class' => 'Countdown',
			),
			'featured_product_category' => array(
				'title'   => __( 'Featured Product Category', 'ignition-elementor-widgets' ),
				'label'   => __( 'Feature a WooCommerce category in a grid or slider layout.', 'ignition-elementor-widgets' ),
				'class'   => 'Featured_Product_Category',
				'file'    => 'class-featured-product-category',
				/* translators: %s is a URL. */
				'warning' => sprintf( __( '<a href="%s" target="_blank">WooCommerce</a> is not active. Install and activate the plugin to use this module.', 'ignition-elementor-widgets' ), 'https://wordpress.org/plugins/woocommerce/' ),
				'plugin'  => 'WooCommerce',
			),
			'flipclock'                 => array(
				'title' => __( 'FlipClock', 'ignition-elementor-widgets' ),
				'label' => __( 'A versatile flipclock timer to add to your projects.', 'ignition-elementor-widgets' ),
				'class' => 'Flipclock',
			),
			'food_menu'                 => array(
				'title' => __( 'Food Menu', 'ignition-elementor-widgets' ),
				'label' => __( 'Create food menus or other price lists.', 'ignition-elementor-widgets' ),
				'class' => 'Food_Menu',
			),
			'justified'                 => array(
				'title' => __( 'Gallery', 'ignition-elementor-widgets' ),
				'label' => __( 'Gallery widget using the popular JustifiedGallery jQuery library to help you create beautiful justified galleries.', 'ignition-elementor-widgets' ),
				'class' => 'Gallery',
			),
			'maps'                      => array(
				'title' => __( 'Google Maps', 'ignition-elementor-widgets' ),
				'label' => __( 'Maps widget which allows you to use a curated list of custom styles from snazzymaps.', 'ignition-elementor-widgets' ),
				'class' => 'Google_Maps',
			),
			'heading'                   => array(
				'title' => __( 'Heading', 'ignition-elementor-widgets' ),
				'label' => __( 'Create flexible headings.', 'ignition-elementor-widgets' ),
				'class' => 'Heading',
			),
			'hotspots'                  => array(
				'title' => __( 'Hotspots', 'ignition-elementor-widgets' ),
				'label' => __( 'Add hotspots with tooltips on images. ', 'ignition-elementor-widgets' ),
				'class' => 'Hotspots',
			),
			'icon_box'                  => array(
				'title' => __( 'Icon Box', 'ignition-elementor-widgets' ),
				'label' => __( 'An icon box element similar to the one bundled with Elementor, with custom icon sets.', 'ignition-elementor-widgets' ),
				'class' => 'Icon_Box',
			),
			'image_accordion'           => array(
				'title' => __( 'Image Accordion', 'ignition-elementor-widgets' ),
				'label' => __( 'A responsive image accordion widget.', 'ignition-elementor-widgets' ),
				'class' => 'Image_Accordion',
			),
			'image_comparison'          => array(
				'title' => __( 'Image Comparison', 'ignition-elementor-widgets' ),
				'label' => __( 'An element which allows you to highlight the differences between two images.', 'ignition-elementor-widgets' ),
				'class' => 'Image_Comparison',
			),
			'image_hover_effects'       => array(
				'title' => __( 'Image Hover Effects', 'ignition-elementor-widgets' ),
				'label' => __( 'An element which allows you to switch between two images on hover with beautiful effects. Caution: These effects are WebGL based and may hurt the performance of your pages. Do not use more than 4 - 5 instances of this widget in any given page. ', 'ignition-elementor-widgets' ),
				'class' => 'Image_Hover_Effects',
			),
			'instagram_filters'         => array(
				'title' => __( 'Instagram Filters', 'ignition-elementor-widgets' ),
				'label' => __( 'This option will enable an Instagram Filters drop-down in the default Elementor Image widget.', 'ignition-elementor-widgets' ),
			),
			'post_types'                => array(
				'title' => __( 'Post types', 'ignition-elementor-widgets' ),
				'label' => __( 'Create flexible grids with any Ignition Framework custom post type.', 'ignition-elementor-widgets' ),
				'class' => 'Post_Types',
			),
			'pricing_list'              => array(
				'title' => __( 'Pricing List', 'ignition-elementor-widgets' ),
				'label' => __( 'Create flexible pricing lists.', 'ignition-elementor-widgets' ),
				'class' => 'Pricing_List',

			),
			'product_category_list'     => array(
				'title'   => __( 'Product Category List', 'ignition-elementor-widgets' ),
				'label'   => __( 'Display WooCommerce categories in a grid or slider layout.', 'ignition-elementor-widgets' ),
				'class'   => 'Product_Category_List',
				'file'    => 'class-product-category-list',
				/* translators: %s is a URL. */
				'warning' => sprintf( __( '<a href="%s" target="_blank">WooCommerce</a> is not active. Install and activate the plugin to use this module.', 'ignition-elementor-widgets' ), 'https://wordpress.org/plugins/woocommerce/' ),
				'plugin'  => 'WooCommerce',
			),
			'product_tabs'              => array(
				'title'   => __( 'Product Tabs', 'ignition-elementor-widgets' ),
				'label'   => __( 'Display WooCommerce products in a tabbed layout.', 'ignition-elementor-widgets' ),
				'class'   => 'Product_Tabs',
				'file'    => 'class-product-tabs',
				/* translators: %s is a URL. */
				'warning' => sprintf( __( '<a href="%s" target="_blank">WooCommerce</a> is not active. Install and activate the plugin to use this module.', 'ignition-elementor-widgets' ), 'https://wordpress.org/plugins/woocommerce/' ),
				'plugin'  => 'WooCommerce',
			),
			'scheduled'                 => array(
				'title' => __( 'Scheduled', 'ignition-elementor-widgets' ),
				'label' => __( 'With this module you can set date/time-based display restrictions on every module available. Check the "Schedule" section in the "Advanced" tab of your modules.', 'ignition-elementor-widgets' ),
			),
			'sticky_videos'             => array(
				'title' => __( 'Sticky Videos', 'ignition-elementor-widgets' ),
				'label' => __( 'Make videos stick to the bottom of the screen when scrolling.', 'ignition-elementor-widgets' ),
			),
			'tables'                    => array(
				'title' => __( 'Tables', 'ignition-elementor-widgets' ),
				'label' => __( 'This option will enable the tables element.', 'ignition-elementor-widgets' ),
				'class' => 'Tables',
			),
			'taxonomy_terms'            => array(
				'title' => __( 'Taxonomy Terms', 'ignition-elementor-widgets' ),
				'label' => __( 'Present terms of custom taxonomies in a grid layout.', 'ignition-elementor-widgets' ),
				'class' => 'Taxonomy_Terms',
			),
			'tilt'                      => array(
				'title' => __( 'Tilt Effect', 'ignition-elementor-widgets' ),
				'label' => __( 'This option will enable the tilt effect.', 'ignition-elementor-widgets' ),
			),
			'wpforms'                   => array(
				'title'   => __( 'WPForms', 'ignition-elementor-widgets' ),
				'label'   => __( 'Embed WPForms.', 'ignition-elementor-widgets' ),
				'plugin'  => 'WPForms',
				'file'    => 'class-wpforms',
				/* translators: %s is a URL. */
				'warning' => sprintf( __( '<a href="%s" target="_blank">WPForms</a> is not active. Install and activate the plugin to use this module.', 'ignition-elementor-widgets' ), 'https://wordpress.org/plugins/wpforms-lite/' ),
				'class'   => 'WPForms',
			),
		);

		return $available_elements;
	}

	/**
	 * Registers the Posts Type widget.
	 *
	 * @since 1.0.0
	 */
	public function add_widget() {
		$available_elements = $this->ignition_elementor_get_available_elements();

		$options = $this->get_sanitized_options();

		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-post-types.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-icon-box.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-food-menu.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-taxonomy-terms.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-countdown.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-gallery.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-google-maps.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-heading.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-hotspots.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-image-accordion.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-image-comparison.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-image-hover-effects.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-pricing-list.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-tables.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-flipclock.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-product-tabs.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-product-category-list.php';
		require_once untrailingslashit( $this->plugin_path() ) . '/widgets/class-featured-product-category.php';

		foreach ( $available_elements as $element => $values ) {
			if ( isset( $values['class'] ) ) {
				if ( isset( $values['plugin'] ) ) {
					if ( class_exists( $values['plugin'] ) && 1 === intval( $options[ $element ] ) ) {
						require_once untrailingslashit( $this->plugin_path() ) . '/widgets/' . $values['file'] . '.php';
						$class = '\CSSIgniter\Ignition\Elementor\Widget\\' . $values['class'];
						$this->elementor->widgets_manager->register( new $class() );
					}
				} else {
					if ( 1 === intval( $options[ $element ] ) ) {
						$class = '\CSSIgniter\Ignition\Elementor\Widget\\' . $values['class'];
						$this->elementor->widgets_manager->register( new $class() );
					}
				}
			}
		}

		if ( 1 === $options['instagram_filters'] ) {
			require_once untrailingslashit( $this->plugin_path() ) . '/widgets/instagram-filters.php';
		}

		if ( 1 === $options['sticky_videos'] ) {
			require_once untrailingslashit( $this->plugin_path() ) . '/widgets/sticky-video.php';
		}
	}

	/**
	 * Checks if all the necessary plugins are activated.
	 *
	 * @since 1.0.0
	 */
	public function dependency_check( $return = false ) {

		$messages = array();

		if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
			$messages[] = __( '<strong>Ignition Widgets for Elementor</strong> requires the <strong>Elementor page builder</strong> plugin to be active. Please activate it to continue.', 'ignition-elementor-widgets' );

		}

		if ( ! defined( 'IGNITION_VERSION' ) || ! version_compare( IGNITION_VERSION, '3.0', '>=' ) ) {
			$messages[] = __( '<strong>Ignition Widgets for Elementor</strong> requires the at least version 3.0 of the Ignition Framework</strong> plugin to be active. Please install or update it to continue.', 'ignition-elementor-widgets' );
		}

		if ( ! empty( $messages ) ) {
			$html_message = sprintf( '<div class="error">%s</div>', wpautop( implode( '<br />', $messages ) ) );

			if ( ! $return ) {
				echo wp_kses_post( $html_message );
			}

			return false;
		}

		return true;
	}

	/**
	 * Runs on plugin activation.
	 *
	 * @since 1.0.0
	 */
	public function plugin_activated() {
		if ( ! current_user_can( 'activate_plugins' ) ) {
			return;
		}

		do_action( 'ignition_elementor_widgets_activated' );

		flush_rewrite_rules();
	}

	/**
	 * Runs on plugin deactivation.
	 *
	 * @since 1.0.0
	 */
	public function plugin_deactivated() {
		if ( ! current_user_can( 'activate_plugins' ) ) {
			return;
		}

		do_action( 'ignition_elementor_widgets_deactivated' );

		flush_rewrite_rules();
	}

	public static function plugin_basename() {
		return plugin_basename( __FILE__ );
	}

	public function plugin_url() {
		return self::$plugin_url;
	}

	public function plugin_path() {
		return self::$plugin_path;
	}
}


/**
 * Main instance of Ignition_Elementor_Widgets.
 *
 * Returns the working instance of Ignition_Elementor_Widgets. No need for globals.
 *
 * @since  1.0.0
 * @return Ignition_Elementor_Widgets
 */
function Ignition_Elementor_Widgets() {
	return Ignition_Elementor_Widgets::instance();
}

add_action( 'plugins_loaded', array( Ignition_Elementor_Widgets(), 'plugin_setup' ) );
register_activation_hook( __FILE__, array( Ignition_Elementor_Widgets(), 'plugin_activated' ) );
register_deactivation_hook( __FILE__, array( Ignition_Elementor_Widgets(), 'plugin_deactivated' ) );
