HEX
Server: Apache
System: Linux cp4.skywebbox.com 5.14.0-503.15.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 28 07:25:19 EST 2024 x86_64
User: alfouzantranspor (1054)
PHP: 8.3.23
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/alfouzantranspor/www/wp-content/themes/transportation-agency-pro/theme-wizard/whizzie.php
<?php
/**
 * Wizard
 *
 * @package Whizzie
 * @author Titanthemes
 * @since 1.0.0
 */


class ThemeWhizzie {

	public static $is_valid_key = 'false';
	public static $theme_key 		= '';

	protected $version = '1.1.0';

	/** @var string Current theme name, used as namespace in actions. */
	protected $theme_name = '';
	protected $theme_title = '';

	/** @var string Wizard page slug and title. */
	protected $page_slug = '';
	protected $page_title = '';

	/** @var array Wizard steps set by user. */
	protected $config_steps = array();

	/**
	 * Relative plugin url for this plugin folder
	 * @since 1.0.0
	 * @var string
	 */
	protected $plugin_url = '';

	/**
	 * TGMPA instance storage
	 *
	 * @var object
	 */
	protected $tgmpa_instance;

	/**
	 * TGMPA Menu slug
	 *
	 * @var string
	 */
	protected $tgmpa_menu_slug = 'tgmpa-install-plugins';

	/**
	 * TGMPA Menu url
	 *
	 * @var string
	 */
	protected $tgmpa_url = 'themes.php?page=tgmpa-install-plugins';

	// Where to find the widget.wie file
	protected $widget_file_url = '';

	/**
	 * Constructor
	 *
	 * @param $transportation_agency_pro_config	Our config parameters
	 */
	public function __construct( $transportation_agency_pro_config ) {
		$this->set_vars( $transportation_agency_pro_config );
		$this->init();

		include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
	}

	public static function get_the_validation_status() {
		return get_option('transportation_agency_pro_theme_validation_status');
	}

	public static function set_the_validation_status($is_valid) {
		update_option('transportation_agency_pro_theme_validation_status', $is_valid);
	}

	public static function get_the_suspension_status() {
		return get_option( 'transportation_agency_pro_theme_suspension_status' );
	}

	public static function set_the_suspension_status( $is_suspended ) {
		update_option( 'transportation_agency_pro_theme_suspension_status' , $is_suspended );
	}

	public static function set_the_theme_key($the_key) {
		update_option('ice_pro_theme_key', $the_key);
	}

	public static function remove_the_theme_key() {
		delete_option('ice_pro_theme_key');
	}

	public static function get_the_theme_key() {
		return get_option('ice_pro_theme_key');
	}

	/**
	 * Set some settings
	 * @since 1.0.0
	 * @param $transportation_agency_pro_config	Our config parameters
	 */
	public function set_vars( $transportation_agency_pro_config ) {

		require_once trailingslashit( WHIZZIE_DIR ) . 'tgm/tgm.php';
		require_once trailingslashit( WHIZZIE_DIR ) . 'widgets/class-transportation-agency-pro-widget-importer.php';

		if( isset( $transportation_agency_pro_config['page_slug'] ) ) {
			$this->page_slug = esc_attr( $transportation_agency_pro_config['page_slug'] );
		}
		if( isset( $transportation_agency_pro_config['page_title'] ) ) {
			$this->page_title = esc_attr( $transportation_agency_pro_config['page_title'] );
		}
		if( isset( $transportation_agency_pro_config['steps'] ) ) {
			$this->config_steps = $transportation_agency_pro_config['steps'];
		}

		$this->plugin_path = trailingslashit( dirname( __FILE__ ) );
		$relative_url = str_replace( get_template_directory(), '', $this->plugin_path );
		$this->plugin_url = trailingslashit( get_template_directory_uri() . $relative_url );
		$current_theme = wp_get_theme();
		$this->theme_title = $current_theme->get( 'Name' );
		$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );
		$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-wizard' );
		$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );

		$this->widget_file_url = trailingslashit( WHIZZIE_DIR ) . 'widgets/a-transportation-agency-pro-widgets.wie';

	}

	/**
	 * Hooks and filters
	 * @since 1.0.0
	 */
	public function init() {

		if ( class_exists( 'TGM_Plugin_Activation' ) && isset( $GLOBALS['tgmpa'] ) ) {
			add_action( 'init', array( $this, 'get_tgmpa_instance' ), 30 );
			add_action( 'init', array( $this, 'set_tgmpa_url' ), 40 );
		}

		add_action( 'after_switch_theme', array( $this, 'redirect_to_wizard' ) );

		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
		add_action( 'admin_menu', array( $this, 'menu_page' ) );
		add_action( 'admin_init', array( $this, 'get_plugins' ), 30 );
		add_filter( 'tgmpa_load', array( $this, 'tgmpa_load' ), 10, 1 );
		add_action( 'wp_ajax_setup_plugins', array( $this, 'setup_plugins' ) );
		add_action( 'wp_ajax_setup_widgets', array( $this, 'setup_widgets' ) );

		// add_action( 'wp_ajax_setup_builder', array( $this, 'setup_builder' ) );


		add_action( 'wp_ajax_wz_activate_transportation_agency_propro', array( $this, 'wz_activate_transportation_agency_propro' ) );

		add_action('admin_enqueue_scripts',  array( $this, 'transportation_agency_pro_admin_theme_style' ) );


	}

	public function redirect_to_wizard() {
		global $pagenow;
		if( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) && current_user_can( 'manage_options' ) ) {
			wp_redirect( admin_url( 'themes.php?page=' . esc_attr( $this->page_slug ) ) );
		}
	}

	public function enqueue_scripts() {
		wp_enqueue_style( 'theme-wizard-style', get_template_directory_uri() . '/theme-wizard/assets/css/theme-wizard-style.css');
		wp_register_script( 'theme-wizard-script', get_template_directory_uri() . '/theme-wizard/assets/js/theme-wizard-script.js', array( 'jquery' ), time() );
		wp_localize_script(
			'theme-wizard-script',
			'transportation_agency_pro_whizzie_params',
			array(
				'ajaxurl' 		=> admin_url( 'admin-ajax.php' ),
				'wpnonce' 		=> wp_create_nonce( 'whizzie_nonce' ),
				'verify_text'	=> esc_html( 'verifying', 'a-transportation-agency-pro' ),
				'TITANTHEMES_THEME_LICENCE_ENDPOINT' => TITANTHEMES_THEME_LICENCE_ENDPOINT
			)
		);
		wp_enqueue_script( 'theme-wizard-script' );
		wp_enqueue_script('tabs', get_template_directory_uri() . '/theme-wizard/getstarted/js/tab.js');
		wp_enqueue_script( 'transportation-agency-pro-notify-popup', get_template_directory_uri() . '/assets/js/notify.min.js');
	}

	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self;
		}
		return self::$instance;
	}

	public function tgmpa_load( $status ) {
		return is_admin() || current_user_can( 'install_themes' );
	}

	/**
	 * Get configured TGMPA instance
	 *
	 * @access public
	 * @since 1.1.2
	 */
	public function get_tgmpa_instance() {
		$this->tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
	}

	/**
	 * Update $tgmpa_menu_slug and $tgmpa_parent_slug from TGMPA instance
	 *
	 * @access public
	 * @since 1.1.2
	 */
	public function set_tgmpa_url() {
		$this->tgmpa_menu_slug = ( property_exists( $this->tgmpa_instance, 'menu' ) ) ? $this->tgmpa_instance->menu : $this->tgmpa_menu_slug;
		$this->tgmpa_menu_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_tgmpa_menu_slug', $this->tgmpa_menu_slug );
		$tgmpa_parent_slug = ( property_exists( $this->tgmpa_instance, 'parent_slug' ) && $this->tgmpa_instance->parent_slug !== 'themes.php' ) ? 'admin.php' : 'themes.php';
		$this->tgmpa_url = apply_filters( $this->theme_name . '_theme_setup_wizard_tgmpa_url', $tgmpa_parent_slug . '?page=' . $this->tgmpa_menu_slug );
	}

	/**
	 * Make a modal screen for the wizard
	 */
	public function menu_page() {
		add_menu_page( esc_html( $this->page_title ), esc_html( $this->page_title ), 'manage_options', $this->page_slug, array( $this, 'transportation_agency_pro_mostrar_guide' ) ,get_template_directory_uri().'/theme-wizard/assets/images/admin-menu.svg',40);
	}

	public function activation_page() {
		$theme_key 						= ThemeWhizzie::get_the_theme_key();
		$validation_status 		= ThemeWhizzie::get_the_validation_status();
		?>
		<div class="wrap">
			<label><?php esc_html_e('Enter Your Theme License Key:','a-transportation-agency-pro'); ?></label>
			<form id="transportation_agency_pro_license_form">
				<input type="text" name="transportation_agency_pro_license_key" value="<?php echo $theme_key ?>" <?php if($validation_status === 'true') { echo "disabled"; } ?> required placeholder="License Key" />
				<div class="licence-key-button-wrap">
					<button class="button" type="submit" name="button" <?php if($validation_status === 'true') { echo "disabled"; } ?>>
						<?php if ($validation_status === 'true') {
						?>
							Activated
						<?php
						} else { ?>
							Activate
						<?php
						}
						?>
					</button>

					<?php if ($validation_status === 'true') { ?>
						<button id="change--key" class="button" type="button" name="button">
							Change Key
						</button>
						<div class="next-button">
						<button id="start-now-next" class="button" type="button" name="button" onclick="openCity(event, 'demo_offer')">
							Next
						</button>
					</div>
					<?php } ?>
				</div>
			</form>
		</div>
		<?php
	}

	/**
	 * Make an interface for the wizard
	 */
	public function wizard_page() {

		tgmpa_load_bulk_installer();

		// install plugins with TGM.
		if ( ! class_exists( 'TGM_Plugin_Activation' ) || ! isset( $GLOBALS['tgmpa'] ) ) {
			die( 'Failed to find TGM' );
		}
		$url = wp_nonce_url( add_query_arg( array( 'plugins' => 'go' ) ), 'whizzie-setup' );

		// copied from TGM
		$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
		$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
		if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
			return true; // Stop the normal page form from displaying, credential request form will be shown.
		}
		// Now we have some credentials, setup WP_Filesystem.
		if ( ! WP_Filesystem( $creds ) ) {
			// Our credentials were no good, ask the user for them again.
			request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
			return true;
		}


		/* If we arrive here, we have the filesystem */ ?>
		<div class="wrap">
			<?php echo '<div class="card whizzie-wrap">';
				// The wizard is a list with only one item visible at a time
				$steps = $this->get_steps();

				echo '<ul class="whizzie-menu transportation-agency-pro-wizard-menu-page">';
				foreach( $steps as $step ) {
					$class = 'step step-' . esc_attr( $step['id'] );
					echo '<li data-step="' . esc_attr( $step['id'] ) . '" class="' . esc_attr( $class ) . '"  id="welcome">';
						printf( '<span class="wizard-main-title">%s</span>',
							esc_html( $step['title'] )
							);
						// $content is split into summary and detail
						$content = call_user_func( array( $this, $step['view'] ) );
						if( isset( $content['summary'] ) ) {
							printf(
								'<div class="summary">%s</div>',
								wp_kses_post( $content['summary'] )
							);
						}
						if( isset( $content['detail'] ) ) {
							// Add a link to see more detail
							printf( '<div class="wz-require-plugins">');
							printf(
								'<div class="detail">%s</div>',
								$content['detail'] // Need to escape this
							);
							printf('</div>');
						}

						printf('<div class="wizard-button-wrapper">');
						  if (ThemeWhizzie::get_the_validation_status() === 'true') {
							// The next button
							if( isset( $step['button_text'] ) && $step['button_text'] ) {
								printf(
									'<div class="button-wrap"><a href="#" class="button button-primary do-it" data-callback="%s" data-step="%s">%s</a></div>',
									esc_attr( $step['callback'] ),
									esc_attr( $step['id'] ),
									esc_html( $step['button_text'] )
								);
							}

							if( isset( $step['button_text_one'] )) {
								printf(
									'<div class="button-wrap button-wrap-one">
										<a href="#" class="button button-primary do-it" data-callback="install_widgets" data-step="widgets"><img src="'.get_template_directory_uri().'/theme-wizard/assets/images/Gutenberg-Icon.png"></a>
										<p class="demo-type-text">%s</p>
									</div>',
									esc_html( $step['button_text_one'] )
								);
							}
						} else {
							printf(
								'<div class="button-wrap"><a href="#" class="button button-primary key-activation-tab-click">%s</a></div>',
								esc_html( __( 'Activate Your License', 'a-transportation-agency-pro' ) )
							);
						}
						printf('</div>');

					echo '</li>';
				}
				echo '</ul>';
				?>
				<div class="step-loading">
					<div class="spinner">
						<!-- <img src="< ?php echo esc_url(get_template_directory_uri().'/theme-wizard/assets/images/Spinner-Animaion.gif'); ?>"> -->
					</div>
			</div>
			<?php echo '</div>';?>

		</div>
	<?php }
	/**
	 * Set options for the steps
	 * Incorporate any options set by the theme dev
	 * Return the array for the steps
	 * @return Array
	 */
	public function get_steps() {
		$dev_steps = $this->config_steps;
		$steps = array(
			'intro' => array(
				'id'			=> 'intro',
				'title'			=> __( '', 'a-transportation-agency-pro' ),
				'icon'			=> 'dashboard',
				'view'			=> 'get_step_intro', // Callback for content
				'callback'		=> 'do_next_step', // Callback for JS
				'button_text'	=> __( 'Start Now', 'a-transportation-agency-pro' ),
				'can_skip'		=> false, // Show a skip button?
				'icon_url'      => get_template_directory_uri().'/theme-wizard/assets/images/Icons-01.svg'
			),
			'plugins' => array(
				'id'			=> 'plugins',
				'title'			=> __( 'Plugins', 'a-transportation-agency-pro' ),
				'icon'			=> 'admin-plugins',
				'view'			=> 'get_step_plugins',
				'callback'		=> 'install_plugins',
				'button_text'	=> __( 'Install Plugins', 'a-transportation-agency-pro' ),
				'can_skip'		=> true,
				'icon_url'      => get_template_directory_uri().'/theme-wizard/assets/images/Icons-02.svg'
			),
			'widgets' => array(
				'id'			=> 'widgets',
				'title'			=> __( 'Customizer', 'a-transportation-agency-pro' ),
				'icon'			=> 'welcome-widgets-menus',
				'view'			=> 'get_step_widgets',
				'callback'		=> 'install_widgets',
				'button_text_one'	=> __( 'Click On The Image To Import Gutenberg Block Demo', 'a-transportation-agency-pro' ),
				'button_text_two'	=> __( 'Click On The Image To Import Gutenberg Block Demo', 'a-transportation-agency-pro' ),
				'can_skip'		=> true,
				'icon_url'      => get_template_directory_uri().'/theme-wizard/assets/images/Icons-03.svg'
			),

			'done' => array(
				'id'			=> 'done',
				'title'			=> __( 'All Done', 'a-transportation-agency-pro' ),
				'icon'			=> 'yes',
				'view'			=> 'get_step_done',
				'callback'		=> '',
				'icon_url'      => get_template_directory_uri().'/theme-wizard/assets/images/Icons-04.svg'
			)
		);

		// Iterate through each step and replace with dev config values
		if( $dev_steps ) {
			// Configurable elements - these are the only ones the dev can update from config.php
			$can_config = array( 'title', 'icon', 'button_text', 'can_skip','button_text_two' );
			foreach( $dev_steps as $dev_step ) {
				// We can only proceed if an ID exists and matches one of our IDs
				if( isset( $dev_step['id'] ) ) {
					$id = $dev_step['id'];
					if( isset( $steps[$id] ) ) {
						foreach( $can_config as $element ) {
							if( isset( $dev_step[$element] ) ) {
								$steps[$id][$element] = $dev_step[$element];
							}
						}
					}
				}
			}
		}
		return $steps;
	}

	/**
	 * Print the content for the intro step
	 */
	public function get_step_intro() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('Thank you for choosing this','a-transportation-agency-pro').$this->theme_title.esc_html_e(' Theme. Using this quick setup wizard, you will be able to configure your new website and get it running in just a few minutes. Just follow these simple steps mentioned in the wizard and get started with your website.','a-transportation-agency-pro'); ?>
			</p>
			<p>
				<?php esc_html_e('You may even skip the steps and get back to the dashboard if you have no time at the present moment. You can come back any time if you change your mind.','a-transportation-agency-pro'); ?>
			</p>
		</div>
	<?php }

	public function get_step_importer() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('Thank you for choosing this ','a-transportation-agency-pro').$this->theme_title.esc_html_e(' Theme. Using this quick setup wizard, you will be able to configure your new website and get it running in just a few minutes. Just follow these simple steps mentioned in the wizard and get started with your website.','a-transportation-agency-pro'); ?>
			</p>
		</div>
	<?php }
	/**
	 * Get the content for the plugins step
	 * @return $content Array
	 */
	public function get_step_plugins() {
		$plugins = $this->get_plugins();
		$content = array(); ?>
			<div class="summary">
				<p>
					<?php esc_html_e('Additional plugins always make your website exceptional. Install these plugins by clicking the install button. You may also deactivate them from the dashboard.','a-transportation-agency-pro') ?>
				</p>
			</div>
		<?php // The detail element is initially hidden from the user
		$content['detail'] = '<span class="wizard-plugin-count">'.count($plugins['all']).'</span><ul class="whizzie-do-plugins">';
		// Add each plugin into a list
		foreach( $plugins['all'] as $slug=>$plugin ) {
			$content['detail'] .= '<li data-slug="' . esc_attr( $slug ) . '">' . esc_html( $plugin['name'] ) . '<div class="wizard-plugin-title">';

			$content['detail'] .= '<span class="wizard-plugin-status">Installation Required</span><i class="spinner"></i></div></li>';

		}
		$content['detail'] .= '</ul>';

		return $content;
	}


	/**
	 * Print the content for the widgets step
	 * @since 1.1.0
	 */
	public function get_step_widgets() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('This theme supports importing the demo content and adding widgets. Get them installed with the below button. Using the Customizer, it is possible to update or even deactivate them','a-transportation-agency-pro'); ?>
			</p>
		</div>
	<?php }


	/**
	 * Print the content for the Design choices for the user
	 */

	public function get_step_design() { ?>

		<div class="transportation-agency-pro-design-product-row">
		</div>
		<div class="wizard-design-button-wrapper">
			<a href="#" class="button button-primary do-it" data-step="design" id="TransportationAgencyProImportButton" data-callback="inner_page_builder">Import</a>
		</div>

	<?php }
	/**
	 * Print the content for the final step
	 */
	public function get_step_done() {

	 ?>

		<div class="a-transportation-agency-pro-finish">
			<p>
				<?php echo esc_html('Your demo content has been imported successfully . Click on the finish button for more information.'); ?>
			</p>
			<div class="finish-buttons">
				<a href="<?php echo esc_url(admin_url('/site-editor.php')); ?>" class="wz-btn-customizer" target="_blank"><?php esc_html_e('Edit Your Site','a-transportation-agency-pro') ?></a>
				<a href="" class="wz-btn-builder" target="_blank"><?php esc_html_e('Customize Your Demo','a-transportation-agency-pro'); ?></a>
				<a href="<?php echo esc_url(site_url()); ?>" class="wz-btn-visit-site" target="_blank"><?php esc_html_e('Visit Your Site','a-transportation-agency-pro'); ?></a>
			</div>
			<div class="transportation-agency-pro-finish-btn">
				<a href="javascript:void(0);" class="button button-primary" onclick="openCity(event, 'theme_info')" data-tab="theme_info">Finish</a>
			</div>
		</div>

	<?php }

	/**
	 * Get the plugins registered with TGMPA
	 */
	public function get_plugins() {

		$instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
		$plugins = array(
			'all' 		=> array(),
			'install'	=> array(),
			'update'	=> array(),
			'activate'	=> array()
		);
		foreach( $instance->plugins as $slug=>$plugin ) {
			if( $instance->is_plugin_active( $slug ) && false === $instance->does_plugin_have_update( $slug ) ) {
				// Plugin is installed and up to date
				continue;
			} else {
				$plugins['all'][$slug] = $plugin;
				if( ! $instance->is_plugin_installed( $slug ) ) {
					$plugins['install'][$slug] = $plugin;
				} else {
					if( false !== $instance->does_plugin_have_update( $slug ) ) {
						$plugins['update'][$slug] = $plugin;
					}
					if( $instance->can_plugin_activate( $slug ) ) {
						$plugins['activate'][$slug] = $plugin;
					}
				}
			}
		}
		return $plugins;
	}

	public function setup_plugins() {

		if ( ! check_ajax_referer( 'whizzie_nonce', 'wpnonce' ) || empty( $_POST['slug'] ) ) {
			wp_send_json_error( array( 'error' => 1, 'message' => esc_html__( 'No Slug Found','a-transportation-agency-pro' ) ) );
		}
		$json = array();
		// send back some json we use to hit up TGM
		$plugins = $this->get_plugins();

		// what are we doing with this plugin?
		foreach ( $plugins['activate'] as $slug => $plugin ) {
			if ( $_POST['slug'] == $slug ) {
				$json = array(
					'url'           => admin_url( $this->tgmpa_url ),
					'plugin'        => array( $slug ),
					'tgmpa-page'    => $this->tgmpa_menu_slug,
					'plugin_status' => 'all',
					'_wpnonce'      => wp_create_nonce( 'bulk-plugins' ),
					'action'        => 'tgmpa-bulk-activate',
					'action2'       => - 1,
					'message'       => esc_html__( 'Activating Plugin','a-transportation-agency-pro' ),
				);
				break;
			}
		}
		foreach ( $plugins['update'] as $slug => $plugin ) {
			if ( $_POST['slug'] == $slug ) {
				$json = array(
					'url'           => admin_url( $this->tgmpa_url ),
					'plugin'        => array( $slug ),
					'tgmpa-page'    => $this->tgmpa_menu_slug,
					'plugin_status' => 'all',
					'_wpnonce'      => wp_create_nonce( 'bulk-plugins' ),
					'action'        => 'tgmpa-bulk-update',
					'action2'       => - 1,
					'message'       => esc_html__( 'Updating Plugin','a-transportation-agency-pro' ),
				);
				break;
			}
		}
		foreach ( $plugins['install'] as $slug => $plugin ) {
			if ( $_POST['slug'] == $slug ) {
				$json = array(
					'url'           => admin_url( $this->tgmpa_url ),
					'plugin'        => array( $slug ),
					'tgmpa-page'    => $this->tgmpa_menu_slug,
					'plugin_status' => 'all',
					'_wpnonce'      => wp_create_nonce( 'bulk-plugins' ),
					'action'        => 'tgmpa-bulk-install',
					'action2'       => - 1,
					'message'       => esc_html__( 'Installing Plugin','a-transportation-agency-pro' ),
				);
				break;
			}
		}
		if ( $json ) {
			$json['hash'] = md5( serialize( $json ) ); // used for checking if duplicates happen, move to next plugin
			wp_send_json( $json );
		} else {
			wp_send_json( array( 'done' => 1, 'message' => esc_html__( 'Success','a-transportation-agency-pro' ) ) );
		}
		exit;
	}

	// ------- Create Primary Nav Menu --------

		public function theme_create_customizer_primary_nav_menu() {}

	// ------- Create Footer Account Menu --------
	public function theme_create_customizer_footer_account_menu(){}

			// ------- Create Footer Information Menu --------
			public function theme_create_customizer_footer_information_menu() {}
			// ------- Create become seller page Menu --------
			public function theme_create_customizer_become_seller_page_menu() {}

	public function custom_posttype_option(){}


	function isAssoc( array $arr ) {
		if (array() === $arr) return false;
		return array_keys($arr) !== range(0, count($arr) - 1);
	}

	public function create_variable_product() {}


	/**
	 * Imports the Demo Content
	 * @since 1.1.0
	 */
public function setup_widgets() {

	$this->transportation_agency_propro_install_plugin_hook();

		// Create a about us page and assigned the template
		$ice_about_title = 'About us';
		$about         = array(
			'post_type' => 'page',
			'post_title' => $ice_about_title,
			'post_status' => 'publish',
			'post_author' => 1,
			'post_slug' => 'about-us'
		);
		$ice_about_id    = wp_insert_post($about);

		//Set the about page template
		update_post_meta($ice_about_id, '_wp_page_template', 'about-us');

		// Create a service page and assigned the template
		  $ice_service_title = 'Service';
		  $service         = array(
		    'post_type' => 'page',
		    'post_title' => $ice_service_title,
		    'post_status' => 'publish',
		    'post_author' => 1,
		    'post_slug' => 'service'
		  );
		  $ice_service_id    = wp_insert_post($service);

		  //Set the service page template
		  update_post_meta($ice_service_id, '_wp_page_template', 'service');

				// *-*-*-*-*-*-*
				// Create a Places page and assigned the template
			  $ice_place_title = 'Places';
			  $place         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_place_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'places-page'
			  );
			  $ice_place_id    = wp_insert_post($place);

			  //Set the place page template
			  update_post_meta($ice_place_id, '_wp_page_template', 'places-page');
				// *-*-*-*-*-*-*

			  // Create a Pages page and assigned the template
			  $ice_pages_title = 'Pages';
			  $pages         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_pages_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'pages'
			  );
			  $ice_pages_id    = wp_insert_post($pages);

			  //Set the pages page template
			  update_post_meta($ice_pages_id, '_wp_page_template', 'pages');

			  // Create a FAQ page and assigned the template
			  $ice_faq_title = 'Faq\'s';
			  $faq         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_faq_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'faq'
			  );
			  $ice_faq_id    = wp_insert_post($faq);

			  //Set the faq page template
			  update_post_meta($ice_faq_id, '_wp_page_template', 'faq');

			  // Create a Contact Us page and assigned the template
			  $ice_contact_us_title = 'Contact Us';
			  $contact_us         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_contact_us_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'contact-us'
			  );
			  $ice_contact_us_id    = wp_insert_post($contact_us);

			  //Set the contact_us page template
			  update_post_meta($ice_contact_us_id, '_wp_page_template', 'contact-us');

			  // Create a 404 page and assigned the template
			  $ice_404_page_title = '404 Page';
			  $page_404         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_404_page_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => '404-page'
			  );
			  $ice_404_page_id    = wp_insert_post($page_404);

			  //Set the 404_page page template
			  update_post_meta($ice_404_page_id, '_wp_page_template', '404-page');

			  // Create a blog page and assigned the template
			  $ice_blog_title = 'Blogs';
			  $blog         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_blog_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'blogs'
			  );
			  $ice_blog_id    = wp_insert_post($blog);

			  //Set the blog page template
			  update_post_meta($ice_blog_id, '_wp_page_template', 'blog-page');

			  // Create a blog page and assigned the template
			  $ice_blog_with_sidebar_title = 'Blog With Sidebar';
			  $blog_with_sidebar         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_blog_with_sidebar_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'blog_with_sidebar-with-sidebar'
			  );
			  $ice_blog_with_sidebar_id    = wp_insert_post($blog_with_sidebar);

			  //Set the blog_with_sidebar page template
			  update_post_meta($ice_blog_with_sidebar_id, '_wp_page_template', 'blog-with-sidebar');

			  // Create a Booking page and assigned the template
			  $ice_booking_title = 'Booking';
			  $booking         = array(
			    'post_type' => 'page',
			    'post_title' => $ice_booking_title,
			    'post_status' => 'publish',
			    'post_author' => 1,
			    'post_slug' => 'booking'
			  );
			  $ice_booking_id    = wp_insert_post($booking);

			  //Set the booking page template
			  update_post_meta($ice_booking_id, '_wp_page_template', 'booking');

	// ============================= Services section START =====================
					$service_title	 = array(
						'Rail Freight',
						'Air Freight',
						'Ocean Freight',
						'Air Freight',
						'Road Freight',
						'Distribution',
						'Road Freight',
						'Rail Freight',
						'Ware Housing'
					);
					for($i=0; $i<count($service_title); $i++){
						$content = '
						<div class="front_text">
							<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry It is a the long-established fact that a reader</p>
						</div>

						<div class="service_description">
							<div class="row">
								<div class="col-lg-6 col-md-6 col-sm-12 left">
									<div class="service_inner_img">
										<img src="'.get_template_directory_uri().'/assets/images/services/service-inner.png" />
									</div>
								</div>
								<div class="col-lg-6 col-md-6 col-sm-12 right">
									<div class="service_inner_info">
										<div class="info_img">
											<img src="'.get_template_directory_uri().'/assets/images/services/service1.png" />
										</div>
										<div class="">
											<h2>Rail Freight</h2>
											<p class="info_para">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the The 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
											<h3>Meeting Professionals</h3>
											<p class="info_para">When it comes to great experiences, our team of trusted experts plan, anticipate and deliver every component of your experience, no matter the size or the complexity.</p>
										</div>
									</div>
								</div>
							</div>
							<div class="service_benefit">
								<h3>Benefits</h3>
								<p class="benefit_para">Embrace the power of in-person with Marriott Bonvoy Events.</p>
								<ul class="benefit_points">
									<li>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</li>
									<li>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</li>
									<li>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</li>
								</ul>
							</div>
						</div>';
						$short_description = '';

						$service_post = array(
							 'post_title'    => wp_strip_all_tags( $service_title[$i] ),
							 'post_content'  => $content,
							 'post_excerpt' => $short_description,
							 'post_status'   => 'publish',
							 'post_type'     => 'services',
						);
						 // Insert the post into the database
						$service_post_id = wp_insert_post( $service_post );

						$image_url = get_template_directory_uri().'/assets/images/services/service'.$i.'.png';

						$image_name= 'service'.$i.'.png';
						$upload_dir       = wp_upload_dir();
						// Set upload folder
						$image_data       = file_get_contents($image_url);
						// Get image data
						$unique_file_name = wp_unique_filename( $upload_dir['path'], $image_name );
						// Generate unique name
						$filename= basename( $unique_file_name );
						// Create image file name
						// Check folder permission and define file location
						if( wp_mkdir_p( $upload_dir['path'] ) ) {
							 $file = $upload_dir['path'] . '/' . $filename;
						} else {
							 $file = $upload_dir['basedir'] . '/' . $filename;
						}
						// Create the image  file on the server
						file_put_contents( $file, $image_data );
						// Check image file type
						$wp_filetype = wp_check_filetype( $filename, null );
						// Set attachment data
						$attachment = array(
							 'post_mime_type' => $wp_filetype['type'],
							 'post_title'     => sanitize_file_name( $filename ),
							 'post_content'   => '',
							 'post_type'     => 'services',
							 'post_status'    => 'inherit'
						);
						// Create the attachment
						$attach_id = wp_insert_attachment( $attachment, $file, $service_post_id );
						// Include image.php
						require_once(ABSPATH . 'wp-admin/includes/image.php');
						// Define attachment metadata
						$attach_data = wp_generate_attachment_metadata( $attach_id, $file );
						// Assign metadata to attachment
						 wp_update_attachment_metadata( $attach_id, $attach_data );
						// And finally assign featured image to post
						set_post_thumbnail( $service_post_id, $attach_id );
					}
	// ============================= Services section END =======================
	// ======================== Blog Section START =========================

          $blog_post_title = array('Transport Lane Pairing Analysis',
									'Know our Ambiance',
									'Warehouse On-Hand Inventory',
									'Minimize Cost of Manufacturing',
									'Free Complimentary Shipping',
									'Safety Lounge Standards',
									);

          for($i=1; $i<=count($blog_post_title); $i++){

            $content = '<div class="blog-content">
						  <div class="blog-main-content">
						    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
						  </div>
						  <div class="more-info">
						    <div class="blog-sub-title">
						      <h3>Why do we use it?</h3>
						    </div>
						    <p class="img-before-content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
						    <div class="blog-inner-image row">
						      <div class="col-lg-6 col-md-6 col-sm-12 blog-left-img">
						        <img src="'.get_template_directory_uri().'/assets/images/blog/blog-inner1.png" />
						      </div>
						      <div class="col-lg-6 col-md-6 col-sm-12 blog-right-img">
						        <img src="'.get_template_directory_uri().'/assets/images/blog/blog-inner2.png" />
						      </div>
						    </div>
						    <p class="img-after-content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
						  </div>
						</div>';

            // Create post object
            $blog_post = array(
               'post_title'    => wp_strip_all_tags( $blog_post_title[$i - 1] ),
               'post_content'  => $content,
               'post_status'   => 'publish',
               'post_type'     => 'post'
            );
             // Insert the post into the database
            $blog_post_id = wp_insert_post( $blog_post );

            update_post_meta( $blog_post_id, 'meta-blog-que', 'Why do we use it?');
            update_post_meta( $blog_post_id, 'meta-blog-para', "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.");

            update_post_meta( $blog_post_id, 'meta-blog-text', "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.");

            update_post_meta( $blog_post_id,'meta-image1',get_template_directory_uri().'/assets/images/blog/blog-inner1.png');
            update_post_meta( $blog_post_id,'meta-image2',get_template_directory_uri().'/assets/images/blog/blog-inner2.png');

						// wp_set_object_terms( $blog_post_id, 'Blog Category', 'category', true );

            $image_url = get_template_directory_uri().'/assets/images/blog/blog'.$i.'.png';

            $image_name= 'blog'.$i.'.png';
            $upload_dir       = wp_upload_dir();
            // Set upload folder
            $image_data       = file_get_contents($image_url);
            // Get image data
            $unique_file_name = wp_unique_filename( $upload_dir['path'], $image_name );
            // Generate unique name
            $filename= basename( $unique_file_name );
            // Create image file name
            // Check folder permission and define file location
            if( wp_mkdir_p( $upload_dir['path'] ) ) {
               $file = $upload_dir['path'] . '/' . $filename;
            } else {
               $file = $upload_dir['basedir'] . '/' . $filename;
            }
            // Create the image  file on the server
            file_put_contents( $file, $image_data );
            // Check image file type
            $wp_filetype = wp_check_filetype( $filename, null );
            // Set attachment data
            $attachment = array(
               'post_mime_type' => $wp_filetype['type'],
               'post_title'     => sanitize_file_name( $filename ),
               'post_content'   => '',
               'post_type'     => 'post',
               'post_status'    => 'inherit'
            );
            // Create the attachment
            $attach_id = wp_insert_attachment( $attachment, $file, $blog_post_id );
            // Include image.php
            require_once(ABSPATH . 'wp-admin/includes/image.php');
            // Define attachment metadata
            $attach_data = wp_generate_attachment_metadata( $attach_id, $file );
            // Assign metadata to attachment
             wp_update_attachment_metadata( $attach_id, $attach_data );
            // And finally assign featured image to post
            set_post_thumbnail( $blog_post_id, $attach_id );
          }

    // ======================== Blog Section END ===========================
		// ============================= places section START =====================
						$place_title	 = array(
															'Air plain Reliable Shipment',
															'Special Cargo',
															'World wide Delivery',
															'Air plain Reliable Shipment',
															'Special Cargo',
															'World wide Delivery',
														);
						$content = '<div class="place-content">
						  <div class="blog-main-content">
						    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
						  </div>
						  <div class="row">
						    <div class="col-lg-7 col-md-7 col-sm-12 info">
						      <div class="place-about-info">
						        <h3>Air plain Reliable Shipment</h3>
						        <p>Lorem Ipsum is simply dummy text of the designing.</p>
						        <ul class="feature">
						          <li>Break-Out Areas</li>
						          <li>City/Town Centre</li>
						          <li>Major transport links</li>
						          <li>Meeting Rooms</li>
						        </ul>
						      </div>
						      <div class="place-location">
						        <h3 class="location-title">Explore other locations in the area</h3>
						        <p class="location">Houston Taxes USA</p>
						      </div>
						    </div>
						    <div class="col-lg-5 col-md-5 col-sm-12 form-col">
						    </div>
						  </div>
						</div>';

						for($i=0; $i<count($place_title); $i++){

						$place_post = array(
						   'post_title'    => wp_strip_all_tags( $place_title[$i] ),
						   'post_content'  => $content,
						   'post_status'   => 'publish',
						   'post_type'     => 'places',
						);
						 // Insert the post into the database
						$place_post_id = wp_insert_post( $place_post );

						update_post_meta( $place_post_id, 'meta-place-content', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.');
						update_post_meta( $place_post_id, 'meta-place-feature-content', 'Lorem Ipsum is simply dummy text of the designing.');
						update_post_meta( $place_post_id, 'meta-place-feature-one', 'Break-Out Areas');
						update_post_meta( $place_post_id, 'meta-place-feature-two', 'City/Town Centre');
						update_post_meta( $place_post_id, 'meta-place-feature-three', 'Major transport links');
						update_post_meta( $place_post_id, 'meta-place-feature-four', 'Meeting Rooms');
						update_post_meta( $place_post_id, 'meta-place-other-location', 'Houston Taxes USA');

						$image_url = get_template_directory_uri().'/assets/images/places/place'.$i.'.png';

						$image_name= 'place'.$i.'.png';
						$upload_dir       = wp_upload_dir();
						// Set upload folder
						$image_data       = file_get_contents($image_url);
						// Get image data
						$unique_file_name = wp_unique_filename( $upload_dir['path'], $image_name );
						// Generate unique name
						$filename= basename( $unique_file_name );
						// Create image file name
						// Check folder permission and define file location
						if( wp_mkdir_p( $upload_dir['path'] ) ) {
						   $file = $upload_dir['path'] . '/' . $filename;
						} else {
						   $file = $upload_dir['basedir'] . '/' . $filename;
						}
						// Create the image  file on the server
						file_put_contents( $file, $image_data );
						// Check image file type
						$wp_filetype = wp_check_filetype( $filename, null );
						// Set attachment data
						$attachment = array(
						   'post_mime_type' => $wp_filetype['type'],
						   'post_title'     => sanitize_file_name( $filename ),
						   'post_content'   => '',
						   'post_type'     => 'places',
						   'post_status'    => 'inherit'
						);
						// Create the attachment
						$attach_id = wp_insert_attachment( $attachment, $file, $place_post_id );
						// Include image.php
						require_once(ABSPATH . 'wp-admin/includes/image.php');
						// Define attachment metadata
						$attach_data = wp_generate_attachment_metadata( $attach_id, $file );
						// Assign metadata to attachment
						 wp_update_attachment_metadata( $attach_id, $attach_data );
						// And finally assign featured image to post
						set_post_thumbnail( $place_post_id, $attach_id );
						}
		// ============================= places section END =======================
    //==================== Contact Forms Start  ============================
            $contact_forms_title = array('Contact Page Form','Newsletter Form','Home Page Form','Booking Form','Checking Form');
            $form_content = array(
                                  ' <label>
                                    Name
                                    </label>
                                    [text* Your-Name placeholder "Enter Your Name"]
                                    <label>
                                    E-mail
                                    </label>
                                    [email* Your-Email placeholder "Enter Your E-mail"]
                                    <label>
                                    Message
                                    </label>
                                    [textarea* Your-Messsage placeholder "Enter Your Message"]
                                    [submit "Submit"]',
                                    '[email* YourEmailAddress placeholder "Your Email Address"][submit "&#xf1d8;"]',
																		'<div class="row row-one">
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 select_item aa">
																		  [text* item "Item"]
																		</div>
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 select_pickup aa">
																		  [text* pickup_location "Pick up location"]
																		</div>
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 select_drop aa">
																		  [text* drop_location "Drop location"]
																		</div>
																		
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 btn d-flex flex-column justify-content-center">
																		  [submit "$__:__
Total Amount"]
																		</div>
																		
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 select_value aa">
																		  [select* select_value "Select Value" "Value1" "Value2" "Value3"]
																		</div>
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 select_distance aa">
																		  [text* distance "Distance"]
																		</div>
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12 select_weight aa">
																		  [text* weight "Weight"]
																		</div>
																		<!-- Empty div to maintain the grid structure -->
																		<div class="col-lg-3 col-md-3 col-sm-6 col-12"></div>
																	  </div>',
																		'<div class="booking_page">
																		  <div class="form">
																		      <div class="row">
																		      <div class="col-lg-6 col-md-6 col-sm-12 fname">
																		        [text* FistName placeholder "Fist Name"]
																		      </div>
																		      <div class="col-lg-6 col-md-6 col-sm-12 lname">
																		        [text* LastName placeholder "Last Name"]
																		      </div>
																		      <div class="col-lg-6 col-md-6 col-sm-12 number">
																		        [number* MobileNo placeholder "Mobile No"]
																		      </div>
																		      <div class="col-lg-6 col-md-6 col-sm-12 email">
																		        [email* EmailAddress placeholder "Email Address"]
																		      </div>
																		      <div class="col-lg-6 col-md-6 col-sm-12 time">
																		        [select* TimeOfArrival "Time Of Arrival" "1:00 PM" "2:00 PM" "3:00 PM"]
																		      </div>
																		      <div class="col-lg-6 col-md-6 col-sm-12 select">
																		        [select* AdultChild "Adult / Child" "Adult " "Child" "Family"]
																		      </div>
																		      </div>
																		      <div class="comment">
																		        [textarea SpecialRequests placeholder "Special Requests"]
																		      </div>
																		      <div class="acceptance">
																		        [acceptance acceptance optional] I’ve read and accept the terms & conditions * [/acceptance]
																		      </div>
																		      <div class="submit">
																		        [submit "Book Now"]
																		      </div>
																		  </div>
																			</div>',
																			'<div class="row form">
																			  <div class="col-lg-6 col-md-6 col-sm-12 checkin">
																			    <label class="check-in">Check in</label>
																			    [date* Checkin "Check in"]
																			  </div>
																			  <div class="col-lg-6 col-md-6 col-sm-12 checkout">
																			    <label class="check-out">Check Out</label>
																			    [date* Checkout "Check out"]
																			  </div>
																			  <div class="col-lg-12 col-md-12 col-sm-12 select-btn">
																			    <label class="choose-service">Choose Service</label>
																			    [select* ChooseService "Basic" "Standard" "Premium"]
																			    [submit "Check Availability"]
																			  </div>
																			</div>'
                                );
           for ($i=0; $i <count($contact_forms_title) ; $i++) {
            $ice_title07 = $contact_forms_title[$i];
            $ice07content1 = $form_content[$i] . '
            [_site_title] "[your-subject]"
            [_site_title] <blog@gmail.com>
            From: [your-name] <[your-email]>
            Subject: [your-subject]
            Message Body:
            [your-message]
            --
            This e-mail was sent from a contact form on [_site_title] ([_site_url])
            [_site_admin_email]
            Reply-To: [your-email]
            0
            0
            [_site_title] "[your-subject]"
            [_site_title] <blog@gmail.com>
            Message Body:
            [your-message]
            --
            This e-mail was sent from a contact form on [_site_title] ([_site_url])
            [your-email]
            Reply-To: [_site_admin_email]
            0
            0
            Thank you for your message. It has been sent.
            There was an error trying to send your message. Please try again later.
            One or more fields have an error. Please check and try again.
            There was an error trying to send your message. Please try again later.
            You must accept the terms and conditions before sending your message.
            The field is required.
            The field is too long.
            The field is too short.
            There was an unknown error uploading the file.
            You are not allowed to upload files of this type.
            The file is too big.
            There was an error uploading the file.';
            $ice07_post1 = array(
            'post_title'    => wp_strip_all_tags( $ice_title07 ),
            'post_content'  => $ice07content1,
            'post_status'   => 'publish',
            'post_type'     => 'wpcf7_contact_form',
            );
            // Insert the post into the database
            $ice_post07 = wp_insert_post( $ice07_post1 );
            add_post_meta($ice_post07, "_form", $form_content[$i] );
            $ice07mail_data1  = array('subject' => '[_site_title] "[your-subject]"',
                'sender' => '[_site_title] <blog@gmail.com>',
                'body' => 'From: [your-name] <[your-email]>
                Subject: [your-subject]
                Message Body:
                [your-message]
            --
            This e-mail was sent from a contact form on [_site_title] ([_site_url])',
                'recipient' => '[_site_admin_email]',
                'additional_headers' => 'Reply-To: [your-email]',
                'attachments' => '',
                'use_html' => 0,
                'exclude_blank' => 0 );
            add_post_meta($ice_post07, "_mail", $ice07mail_data1);
            // Gets term object from Tree in the database.
            $ice07shortcode1 = '[contact-form-7 id="'.$ice_post07.'" title="'.$ice_title07.'"]';

            if ( $i == 0) {
              set_theme_mod('transportation_agency_pro_contact_page_form_shortcode', $ice07shortcode1);
            }if ( $i == 1) {
              set_theme_mod('transportation_agency_pro_newsletter_form_shortcode', $ice07shortcode1);
            }if ( $i == 2) {
              set_theme_mod('transportation_agency_pro_home_page_form_shortcode', $ice07shortcode1);
            }if ( $i == 3) {
              set_theme_mod('transportation_agency_pro_booking_page_form_shortcode', $ice07shortcode1);
            }if ( $i == 4) {
              set_theme_mod('transportation_agency_pro_check_form_shortcode', $ice07shortcode1);
            }
            }

      //==================== Contact Forms End  ============================

      //==================== Nav Menus Start  ============================
				$this->theme_create_customizer_nav_menu();
			  $Ice_Widget_Importer = new Transportation_Agency_Pro_Widget_Importer;
			  $Ice_Widget_Importer->import_widgets( $this->widget_file_url );
      //==================== Nav Menus End  ============================

	}
	public function theme_create_customizer_nav_menu(){

			 // ------- Create Nav Menu --------
	    $menuname = $lblg_themename . 'Primary Menu';
			$bpmenulocation = 'primary';
			$menu_exists = wp_get_nav_menu_object( $menuname );

			if( !$menu_exists){
			    $menu_id = wp_create_nav_menu($menuname);
			    wp_update_nav_menu_item($menu_id, 0, array(
			        'menu-item-title' =>  __('Home','a-transportation-agency-pro'),
			        'menu-item-classes' => 'home',
			        'menu-item-url' => home_url( '/' ),
			        'menu-item-status' => 'publish'));

			    wp_update_nav_menu_item($menu_id, 0, array(
			        'menu-item-title' =>  __('About','a-transportation-agency-pro'),
			        'menu-item-classes' => 'about',
			        'menu-item-url' => get_permalink(get_page_by_title('About us')),
			        'menu-item-status' => 'publish'));

			    wp_update_nav_menu_item($menu_id, 0, array(
			        'menu-item-title' =>  __('Service','a-transportation-agency-pro'),
			        'menu-item-classes' => 'service',
			        'menu-item-url' => get_permalink(get_page_by_title('Service')),
			        'menu-item-status' => 'publish'));

			    wp_update_nav_menu_item($menu_id, 0, array(
			        'menu-item-title' =>  __('Places','a-transportation-agency-pro'),
			        'menu-item-classes' => 'places',
			        'menu-item-url' => get_permalink(get_page_by_title('Places')),
			        'menu-item-status' => 'publish'));

					$pageparent_item  = wp_update_nav_menu_item($menu_id, 0, array(
						'menu-item-title' =>  __('Pages','a-transportation-agency-pro'),
						'menu-item-classes' => 'pages',
						'menu-item-url' => ('#'),
						'menu-item-status' => 'publish'));

						wp_update_nav_menu_item($menu_id, 0, array(
							'menu-item-title' =>  __('Faq\'s','a-transportation-agency-pro'),
							'menu-item-classes' => 'faq',
							'menu-item-url' => get_permalink(get_page_by_title('Faq\'s')),
							'menu-item-status' => 'publish',
							'menu-item-parent-id' => $pageparent_item
						));

					   wp_update_nav_menu_item($menu_id, 0, array(
						'menu-item-title' =>  __('404 Page','a-transportation-agency-pro'),
						'menu-item-classes' => 'page-404',
						'menu-item-url' => get_permalink(get_page_by_title('404 Page')),
						'menu-item-status' => 'publish',
						'menu-item-parent-id' => $pageparent_item
						));

					  wp_update_nav_menu_item($menu_id, 0, array(
						'menu-item-title' =>  __('Contact Us','a-transportation-agency-pro'),
						'menu-item-classes' => 'contact-us',
						'menu-item-url' => get_permalink(get_page_by_title('Contact Us')),
						'menu-item-status' => 'publish',
						'menu-item-parent-id' => $pageparent_item
					));

			   	wp_update_nav_menu_item($menu_id, 0, array(
			        'menu-item-title' =>  __('Blog','a-transportation-agency-pro'),
			        'menu-item-classes' => 'blog',
			        'menu-item-url' => get_permalink(get_page_by_title('Blogs')),
			        'menu-item-status' => 'publish'));

	             if( !has_nav_menu( $bpmenulocation ) ){
			        $locations = get_theme_mod('nav_menu_locations');
			        $locations[$bpmenulocation] = $menu_id;
			        set_theme_mod( 'nav_menu_locations', $locations );
			    }
			}
	}


		public function wz_activate_transportation_agency_propro() {
			$transportation_agency_pro_license_key = $_POST['transportation_agency_pro_license_key'];

			$endpoint = TITANTHEMES_THEME_LICENCE_ENDPOINT.'verifyTheme';

			$body = [
				'theme_license_key'  => $transportation_agency_pro_license_key,
				'site_url'					 => site_url(),
				'theme_text_domain'	 => wp_get_theme()->get( 'TextDomain' )
			];
			$body = wp_json_encode( $body );
			$options = [
				'body'        => $body,
				'headers'     => [
					'Content-Type' => 'application/json',
				]
			];
			$response = wp_remote_post( $endpoint, $options );
			if ( is_wp_error( $response ) ) {
				ThemeWhizzie::remove_the_theme_key();
				ThemeWhizzie::set_the_validation_status('false');
				$response = array('status' => false, 'msg' => 'Something Went Wrong!');
				wp_send_json($response);
				exit;
			} else {
				$response_body = wp_remote_retrieve_body( $response );
				$response_body = json_decode($response_body);

				if ( $response_body->is_suspended == 1 ) {
					ThemeWhizzie::set_the_suspension_status( 'true' );
				} else {
					ThemeWhizzie::set_the_suspension_status( 'false' );
				}

				if ($response_body->status === false) {
					ThemeWhizzie::remove_the_theme_key();
					ThemeWhizzie::set_the_validation_status('false');
					$response = array('status' => false, 'msg' => $response_body->msg);
					wp_send_json($response);
					exit;
				} else {
					ThemeWhizzie::set_the_validation_status('true');
					ThemeWhizzie::set_the_theme_key($transportation_agency_pro_license_key);
					$response = array('status' => true, 'msg' => 'Theme Activated Successfully!');
					wp_send_json($response);
					exit;
				}
			}
		}



	// public function setup_builder() {	}


		// ------------ Transportation Agency Pro Activation Close -----------
		//guidline for about theme
		public function transportation_agency_pro_mostrar_guide() {

			$display_string = '';

			// Check the validation Start
			$transportation_agency_pro_license_key = ThemeWhizzie::get_the_theme_key();
			$endpoint = TITANTHEMES_THEME_LICENCE_ENDPOINT.'status';
			$body = [
				'theme_license_key'  => $transportation_agency_pro_license_key,
				'site_url'					 => site_url(),
				'theme_text_domain'	 => wp_get_theme()->get( 'TextDomain' )
			];
			$body = wp_json_encode( $body );
			$options = [
				'body'        => $body,
				'headers'     => [
					'Content-Type' => 'application/json',
				]
			];
			$response = wp_remote_post( $endpoint, $options );
			if ( is_wp_error( $response ) ) {
				// ThemeWhizzie::set_the_validation_status('false');
			} else {
				$response_body = wp_remote_retrieve_body( $response );
				$response_body = json_decode($response_body);

				if ( $response_body->is_suspended == 1 ) {
					ThemeWhizzie::set_the_suspension_status( 'true' );
				} else {
					ThemeWhizzie::set_the_suspension_status( 'false' );
				}

				$display_string = isset($response_body->display_string) ? $response_body->display_string : '';

				if ($display_string != '') {
					if (strpos($display_string, '[THEME_NAME]') !== false) {
						$display_string = str_replace("[THEME_NAME]", "Transportation Agency Pro", $display_string);
					}
					if (strpos($display_string, '[THEME_PERMALINK]') !== false) {
						$display_string = str_replace("[THEME_PERMALINK]", "https://www.test.com/", $display_string);
					}
				}

				echo '<div class="notice is-dismissible error thb_admin_notices">' . $display_string . '</div>';

				if ($response_body->status === false) {
					ThemeWhizzie::set_the_validation_status('false');
				} else {
					ThemeWhizzie::set_the_validation_status('true');
				}
			}
			// Check the validation END

			$theme_validation_status = ThemeWhizzie::get_the_validation_status();

			//custom function about theme customizer
			$return = add_query_arg( array()) ;
			$theme = wp_get_theme( 'a-transportation-agency-pro' );

			?>

			<div class="wrapper-info get-stared-page-wrap">

				<div class="tab-sec theme-option-tab">

					<div class="col-xxl-8 col-xl-9 col-lg-11 col-md-12 mx-auto">
						<div class="wrapper-logo">
							<img src="<?php echo get_template_directory_uri().'/theme-wizard/assets/images/logo.png' ?>" alt="">
						</div>
						<div class="row">
							<div class="col-lg-3 col-md-3 col-sm-12">
								<div class="tab">
									<button class="tablinks active" onclick="openCity(event, 'theme_activation')" data-tab="theme_activation"><?php _e( 'Key Activation', 'a-transportation-agency-pro' ); ?></button>
									<button class="tablinks wizard-tab" onclick="openCity(event, 'demo_offer')" data-tab="demo_offer"><?php _e( 'Setup Wizard', 'a-transportation-agency-pro' ); ?></button>
									<button class="tablinks wizard-tab" onclick="openTab(event, 'demo_offer', 'plugins')" data-tab="demo_offer"><?php _e( 'Required Plugins', 'a-transportation-agency-pro' ); ?></button>
									<button class="tablinks wizard-tab" onclick="openTab(event, 'demo_offer', 'widgets')" data-tab="demo_offer"><?php _e( 'Import Content', 'a-transportation-agency-pro' ); ?></button>
									<button class="tablinks wizard-tab" onclick="openTab(event, 'demo_offer', 'done')" data-tab="demo_offer"><?php _e( 'Finish', 'a-transportation-agency-pro' ); ?></button>
								</div>
							</div>
							<div class="col-lg-9 col-md-9 col-sm-12">
								
								<!-- -*-*-*-*-*-*-*-*-*-*-*- -->
								<div id="theme_activation" class="tabcontent open">

									<div class="theme_activation-wrapper">
										<div class="theme_activation_spinner">
											<svg version="1.1" id="L7" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
												  viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
												 <path fill="#3366ca" d="M31.6,3.5C5.9,13.6-6.6,42.7,3.5,68.4c10.1,25.7,39.2,38.3,64.9,28.1l-3.1-7.9c-21.3,8.4-45.4-2-53.8-23.3
												  c-8.4-21.3,2-45.4,23.3-53.8L31.6,3.5z">
												      <animateTransform
												         attributeName="transform"
												         attributeType="XML"
												         type="rotate"
												         dur="2s"
												         from="0 50 50"
												         to="360 50 50"
												         repeatCount="indefinite" />
												  </path>
												 <path fill="#3366ca" d="M42.3,39.6c5.7-4.3,13.9-3.1,18.1,2.7c4.3,5.7,3.1,13.9-2.7,18.1l4.1,5.5c8.8-6.5,10.6-19,4.1-27.7
												  c-6.5-8.8-19-10.6-27.7-4.1L42.3,39.6z">
												      <animateTransform
												         attributeName="transform"
												         attributeType="XML"
												         type="rotate"
												         dur="1s"
												         from="0 50 50"
												         to="-360 50 50"
												         repeatCount="indefinite" />
												  </path>
												 <path fill="#3366ca" d="M82,35.7C74.1,18,53.4,10.1,35.7,18S10.1,46.6,18,64.3l7.6-3.4c-6-13.5,0-29.3,13.5-35.3s29.3,0,35.3,13.5
												  L82,35.7z">
												      <animateTransform
												         attributeName="transform"
												         attributeType="XML"
												         type="rotate"
												         dur="2s"
												         from="0 50 50"
												         to="360 50 50"
												         repeatCount="indefinite" />
												  </path>
												</svg>
										</div>
										<div class="theme-wizard-key-status">
											<?php
											if ( $theme_validation_status === 'false' ) {
												esc_html_e('Theme License Key is not activated!','a-transportation-agency-pro');
											} else {
												esc_html_e('Theme License is Activated!','a-transportation-agency-pro');
											}
											?>
										</div>
										<?php $this->activation_page(); ?>
									</div>
								</div>
								<!-- -*-*-*-*-*-*-*-*-*-*-*- -->
								<div id="demo_offer" class="tabcontent">
									<?php $this->wizard_page(); ?>
								</div>


<!-- Tab content End -->
							</div>
						</div>
					</div>

					</div>
					<div class="wz-video-model">
						<span class="dashicons dashicons-no"></span>
						<iframe width="100%" src="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
					</div>
				</div>
			</div>

		<?php }


		// Add a Custom CSS file to WP Admin Area
		public function transportation_agency_pro_admin_theme_style() {
			wp_enqueue_style( 'a-transportation-agency-pro-font', $this->transportation_agency_pro_admin_font_url(), array() );
			wp_enqueue_style('custom-admin-style', get_template_directory_uri() . '/theme-wizard/getstarted/getstart.css');

			wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/css/bootstrap.min.css' );
			wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array( 'jquery' ) );

			//( 'tab', get_template_directory_uri() . '/theme-wizard/getstarted/js/tab.js' );
		}

		// Theme Font URL
		public function transportation_agency_pro_admin_font_url() {
			$font_url = '';
			$font_family = array();
			$font_family[] = 'Muli:300,400,600,700,800,900';

			$query_args = array(
				'family'	=> urlencode(implode('|',$font_family)),
			);
			$font_url = add_query_arg($query_args,'//fonts.googleapis.com/css');
			return $font_url;
		}

		function transportation_agency_propro_install_plugin_hook(){

					if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) {
						exit;
					}

					$plugins = array(
						array('name' => 'Stackable – Page Builder Gutenberg Blocks', 'path' => 'https://downloads.wordpress.org/plugin/stackable-ultimate-gutenberg-blocks.zip', 'install' => 'stackable-ultimate-gutenberg-blocks/plugin.php'),
						array('name' => 'Spectra – WordPress Gutenberg Blocks', 'path' => 'https://downloads.wordpress.org/plugin/ultimate-addons-for-gutenberg.zip', 'install' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php')
					);

					$args = array(
						'path' => ABSPATH.'wp-content/plugins/',
						'preserve_zip' => false
					);

					foreach($plugins as $plugin){

						if (!file_exists( WP_PLUGIN_DIR . $plugin['install'] )) {

							$this->transportation_agency_propro_plugin_download($plugin['path'], $args['path'].$plugin['name'].'.zip');
							$this->transportation_agency_propro_plugin_unpack($args, $args['path'].$plugin['name'].'.zip');
							$this->transportation_agency_propro_plugin_activate($plugin['install']);

						} else {

							$this->transportation_agency_propro_plugin_activate($plugin['install']);
						}
					}
				}

				function transportation_agency_propro_plugin_download($url, $path) {
					$response	=	wp_remote_get( $url );
					if ( !is_wp_error( $response ) ) {
						$data	=	wp_remote_retrieve_body( $response );
						if( file_put_contents( $path, $data ) ) {
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
				}

				function transportation_agency_propro_plugin_unpack($args, $target){

					global $wp_filesystem;
					require_once ABSPATH . '/wp-admin/includes/file.php';
					WP_Filesystem();

					// $plugin_path = str_replace( ABSPATH, $wp_filesystem->abspath(), TS_DEMO_IMPOTER_DIR ); /* get remote system absolute path */

					//$plugin_path = str_replace( "ts-demo-importer/", "", $plugin_path );
					$plugin_path = WP_PLUGIN_DIR;

					/* Acceptable way to use the function */
					$file	=	$target;
					$to		=	$plugin_path;

					$result = unzip_file( $file, $to );

					if( $result !== true ) {
						return false;
					} else {
						wp_delete_file( $file );
						return true;
					}
				}

				function transportation_agency_propro_plugin_activate($installer){

					wp_cache_flush();
					$plugin = plugin_basename( trim( $installer ) );
					$activate_plugin = activate_plugin( $plugin );

					return true;
				}
	}