<?php
/*
Plugin Name: Meditest Extra
Plugin URI: https://codeindeed.com/meditest-extra
Description: This is a helper plugin for Meditest Theme.
Author: Codeindeed
Version: 1.0.2
Author URI: https://codeindeed.com
*/

/**  Related Theme Type */

global $related_theme_type;
$related_theme_type = array('Meditest', 'Meditest Child');
//define current theme name
$current_theme = !empty(wp_get_theme()) ? wp_get_theme()->get('Name') : '';
define('CURRENT_THEME_NAME', $current_theme);


/*
 * Define Plugin Dir Path
 * @since 1.0.0
 * */
define('MEDITEST_EXTRA_SELF_PATH', 'meditest-extra/meditest-extra.php');
define('MEDITEST_EXTRA_ROOT_PATH', plugin_dir_path(__FILE__));
define('MEDITEST_EXTRA_ROOT_URL', plugin_dir_url(__FILE__));
define('MEDITEST_EXTRA_LIB', MEDITEST_EXTRA_ROOT_PATH . '/lib');
define('MEDITEST_EXTRA_INC', MEDITEST_EXTRA_ROOT_PATH . '/inc');
define('MEDITEST_EXTRA_ADMIN', MEDITEST_EXTRA_INC . '/admin');
define('MEDITEST_EXTRA_ADMIN_ASSETS', MEDITEST_EXTRA_ROOT_URL . 'inc/admin/assets');
define('MEDITEST_EXTRA_CSS', MEDITEST_EXTRA_ROOT_URL . 'assets/css');
define('MEDITEST_EXTRA_JS', MEDITEST_EXTRA_ROOT_URL . 'assets/js');
define('MEDITEST_EXTRA_ELEMENTOR', MEDITEST_EXTRA_INC . '/elementor');
define('MEDITEST_EXTRA_SHORTCODES', MEDITEST_EXTRA_INC . '/shortcodes');
define('MEDITEST_EXTRA_WIDGETS', MEDITEST_EXTRA_INC . '/widgets');

/** Plugin version **/
define('MEDITEST_CORE_VERSION', '1.0.0');

//initial file
include_once ABSPATH . 'wp-admin/includes/plugin.php';

if (is_plugin_active(MEDITEST_EXTRA_SELF_PATH)) {

	if (!in_array(CURRENT_THEME_NAME, $GLOBALS['related_theme_type']) && file_exists(MEDITEST_EXTRA_INC . '/cs-framework-functions.php')) {

		require_once MEDITEST_EXTRA_INC . '/cs-framework-functions.php';
	}

	//plugin core file include

	if (file_exists(MEDITEST_EXTRA_INC . '/class-meditest-extra-init.php')) {
		require_once MEDITEST_EXTRA_INC . '/class-meditest-extra-init.php';
	}

	// Plugin extra functions
	if (file_exists(MEDITEST_EXTRA_INC . '/meditest-extra-functions.php')) {
		require_once MEDITEST_EXTRA_INC . '/meditest-extra-functions.php';
	}

	//Demo data import 

	if (file_exists(MEDITEST_EXTRA_INC . '/demo-import.php')) {
		require_once MEDITEST_EXTRA_INC . '/demo-import.php';
	}
}
