<?php
/**
 *
 * @since               1.0
 * @package             SiteEase_Smart_Product_Filtering_Engine
 *
 * Plugin Name:         SiteEase Smart AJAX Product Filter
 * Plugin URI:          https://profiles.wordpress.org/iflairwebtechnologies
 * Description:         Following plugin is used to apply filter on WooCommerce products.
 * Version:             1.1
 * Author:              iFlair Web Technologies Pvt. Ltd.
 * Author URI:          https://www.iflair.com/
 * Text Domain:         siteease-smart-product-filtering-engine
 * License:             GPLv2 or later
 * License URI:         https://www.gnu.org/licenses/gpl-2.0.html
 * Requires Plugins:    woocommerce
 */

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

/**
 * Defined all constant variables
 *
 * @since 1.0
 * 
 */
define( 'IFQPF_FILE', __FILE__);

define( 'IFQPF_PLUGIN_NAME', 'SiteEase Smart AJAX Product Filter');

define( 'IFQPF_PREFIX', 'ifqpf');

define( 'IFQPF_VERSION', '1.1' );

define( 'IFQPF_DIR_PATH', plugin_dir_path( __FILE__ ));

define( 'IFQPF_DIR_URL', plugin_dir_url( __FILE__ ));

define( 'IFQPF_ASSETS_DIR_PATH', IFQPF_DIR_PATH.'assets/');

define( 'IFQPF_ASSETS_DIR_URL', IFQPF_DIR_URL.'assets/');

define( 'IFQPF_ADMIN_DIR_PATH', IFQPF_DIR_PATH.'admin/');

define( 'IFQPF_ADMIN_DIR_URL', IFQPF_DIR_URL.'admin/');

define( 'IFQPF_PUBLIC_DIR_PATH', IFQPF_DIR_PATH.'public/');

define( 'IFQPF_PUBLIC_DIR_URL', IFQPF_DIR_URL.'public/');

define( 'IFQPF_INC_DIR_PATH', IFQPF_DIR_PATH.'includes/');

/**
 * This code runs on plugin activation
 *
 * @since 1.0
 */
function ifqpf_activate_plugin(){
	require_once( IFQPF_INC_DIR_PATH.'ifqpf-class-activator.php' );
	IFQPF_SiteEase_Smart_Product_Filtering_Engine_Activator::ifqpf_activate();
}
register_activation_hook( __FILE__, 'ifqpf_activate_plugin' );

/**
 * This code runs od plugin deactivation
 *
 * @since 1.0
 */
function ifqpf_deactivate_plugin(){
	require_once( IFQPF_INC_DIR_PATH.'ifqpf-class-deactivator.php' );
	IFQPF_SiteEase_Smart_Product_Filtering_Engine_Deactivator::ifqpf_deactivate();
}
register_deactivation_hook( __FILE__, 'ifqpf_deactivate_plugin' );

/**
 * This code require the main file of plugin
 */
require( IFQPF_INC_DIR_PATH.'ifqpf-class.php' );

/**
 * This code execution whole plugin's code 
 * 
 * @since 1.0
 * 
 * @return instance of core class
 */
function ifqpf(){
	return IFQPF_SiteEase_Smart_Product_Filtering_Engine::instance();
}

/**
 * The code will runs on plugins loaded
 * 
 * @since 1.0
 */
function ifqpf_run(){
	if ( class_exists('WooCommerce') ){
		ifqpf()->run();
	}else{
		ifqpf()->ifqpf_deactivate();
	}
}
add_action('plugins_loaded', 'ifqpf_run', 11);