<?php

/**
 *
 * @link              https://envytheme.com
 * @since             1.0.0
 * @package           Envy_Chimp
 *
 * @wordpress-plugin
 * Plugin Name:       EnvyChimp
 * Plugin URI:        https://wordpress.org/plugins/envychimp
 * Description:       EnvyChimp is an email subscription WordPress plugin.
 * Version:           1.0.0
 * Author:            EnvyTheme
 * Author URI:        https://envytheme.com
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       envy-chimp
 * Domain Path:       /languages
 */

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

/**
 * Currently plugin version.
 * Start at version 1.0.0 and use SemVer - https://semver.org
 * Rename this for your plugin and update it as you release new versions.
 */
define( 'ENVY_CHIMP_VERSION', '1.0.0' );

/**
 * The code that runs during plugin activation.
 * This action is documented in includes/class-envy-chimp-activator.php
 */
function envy_chimp_activate() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/class-envy-chimp-activator.php';
	Envy_Chimp_Activator::activate();
}

/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/class-envy-chimp-deactivator.php
 */
function envy_chimp_deactivate() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/class-envy-chimp-deactivator.php';
	Envy_Chimp_Deactivator::deactivate();
}

register_activation_hook( __FILE__, 'envy_chimp_activate' );
register_deactivation_hook( __FILE__, 'envy_chimp_deactivate' );

/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
require plugin_dir_path( __FILE__ ) . 'includes/class-envy-chimp.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-envy-chimp-options.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-envy-chimp-widget.php';
if ( in_array( 'elementor/elementor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    require plugin_dir_path( __FILE__ ) . 'includes/elementor/class-envy-chimp-elementor.php';
}
require plugin_dir_path( __FILE__ ) . 'includes/vc/class-envy-chimp-vc-option.php';
require plugin_dir_path( __FILE__ ) . 'includes/vc/class-envy-chimp-vc-element.php';

/**
 * Begins execution of the plugin.
 *
 * Since everything within the plugin is registered via hooks,
 * then kicking off the plugin from this point in the file does
 * not affect the page life cycle.
 *
 * @since    1.0.0
 */
function envy_chimp_run() {

	$plugin = new Envy_Chimp();
	$plugin->run();

}
envy_chimp_run();
