<?php

/**
 * The plugin bootstrap file
 *
 * This file is read by WordPress to generate the plugin information in the plugin
 * admin area. This file also includes all of the dependencies used by the plugin,
 * registers the activation and deactivation functions, and defines a function
 * that starts the plugin.
 *
 * @link              http://example.com
 * @since             1.0.0
 * @package           Agile-Ticketing
 *
 * @wordpress-plugin
 * Plugin Name:       Agile-Ticketing
 * Description:       Connect with your AgileTix shows and automatically create, cull, and customize posts.
 * Version:           1.2.2
 * Author:            AgileTix
 * Text Domain:       agile-ticketing
 * Domain Path:       /languages

 */

// No required plugins yet, if there are, just add them as a comma seperated list of the plugin slugs
// Requires Plugins:
// index-wp-mysql-for-speed

// 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( 'agile_tix_VERSION', '1.2.2' );

/**
 * The code that runs during plugin activation.
 * This action is documented in includes/agile-ticketing-activator.php
 */
function activate_agile_tix() {


	require_once plugin_dir_path( __FILE__ ) . 'includes/agile-ticketing-activator.php';
	agile_tix_Activator::activate();
}

/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/agile-ticketing-deactivator.php
 */
function deactivate_agile_tix() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/agile-ticketing-deactivator.php';
	agile_tix_Deactivator::deactivate();
}

register_activation_hook( __FILE__, 'activate_agile_tix' );
register_deactivation_hook( __FILE__, 'deactivate_agile_tix' );

/**
 * Load Action Scheduler only if not already loaded (e.g., by WooCommerce)
 * This must be loaded early to participate in Action Scheduler's version management system
 */
if (!function_exists('as_schedule_single_action') && !class_exists('ActionScheduler', false)) {
	require_once plugin_dir_path( __FILE__ ) . 'libraries/action-scheduler-trunk/action-scheduler-trunk/action-scheduler.php';
}

/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
require plugin_dir_path( __FILE__ ) . 'includes/agile-ticketing.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 run_agile_tix() {

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

}

add_action('plugins_loaded', 'run_agile_tix', 1);
//run_agile_tix();
