<?php

use EDPW\Core\Helpers\Plugin;
use ESCT\App\Router;

defined( 'ABSPATH' ) || exit;
if ( Plugin::isActive( 'woocommerce-subscriptions/woocommerce-subscriptions.php' ) ) {
	defined( 'ESCT_PLUGIN_NAME' ) or define( 'ESCT_PLUGIN_NAME',  'WooCommerce Subscription' );
	defined( 'ESCT_PLUGIN_SLUG' ) or define( 'ESCT_PLUGIN_SLUG', 'esct-subscription-compatibility' );
	defined( 'ESCT_PLUGIN_URL' ) or define( 'ESCT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
	defined( 'ESCT_PLUGIN_FILE' ) or define( 'ESCT_PLUGIN_FILE', __FILE__ );
	defined( 'ESCT_PLUGIN_DIR' ) or define( 'ESCT_PLUGIN_DIR', str_replace( '\\', '/', __DIR__ ) );
	defined( 'ESCT_PLUGIN_PREFIX' ) or define( 'ESCT_PLUGIN_PREFIX', 'esc' );
	defined( 'ESCT_PLUGIN_PATH' ) or define( 'ESCT_PLUGIN_PATH', __DIR__ . '/' );
	if ( class_exists( Router::class ) ) {
		Router::init();
	}
}
