<?php
if (! defined('ABSPATH')) {
	exit; // Exit if accessed directly
}
/**
@package Insta Type Gallery
 * Plugin Name:       Instagram Type Profile Gallery
 * Plugin URI:        http://awplife.com/
 * Description:       Insta type gallery plugin with lightbox preview for WordPress
 * Version:           1.2.2
 * Requires at least: 5.0
 * Requires PHP:      7.0
 * Author:            A WP Life
 * Author URI:        https://profiles.wordpress.org/awordpresslife
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       insta-type-gallery
 * Domain Path:       /languages
 * License:           GPL2

Insta Type Gallery is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.

Insta Type Gallery is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Insta Type Gallery. If not, see https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
 */

if (! class_exists('Instagram_Type_Gallery')) {

	class Instagram_Type_Gallery
	{

		protected $protected_plugin_api;
		protected $ajax_plugin_nonce;

		public function __construct()
		{
			$this->_constants();
			$this->_hooks();
		}

		protected function _constants()
		{
			// Plugin Version
			define('ITG_PLUGIN_VER', '1.2.2');

			// Plugin Text Domain
			define('ITG_TXTDM', 'insta-type-gallery');

			// Plugin Name
			define('ITG_PLUGIN_NAME', 'Stylish Profile Gallery');

			// Plugin Slug
			define('ITG_PLUGIN_SLUG', 'insta_type_gallery');

			// Plugin Directory Path
			define('ITG_PLUGIN_DIR', plugin_dir_path(__FILE__));

			// Plugin Directory URL
			define('ITG_PLUGIN_URL', plugin_dir_url(__FILE__));

			/**
			 * Create a key for the .htaccess secure download link.
			 *
			 * @uses    NONCE_KEY     Defined in the WP root config.php
			 */
			define('ITG_SECURE_KEY', md5(NONCE_KEY));
		} // end of constructor function


		/**
		 * Setup the default filters and actions
		 */
		protected function _hooks()
		{

			// Load text domain
			add_action('init', array($this, '_load_textdomain'));

			// add insta type gallery menu item, change menu filter for multisite
			add_action('admin_menu', array($this, '_insta_menu'), 101);

			// Create Insta type Gallery Custom Post
			add_action('init', array($this, '_insta_Gallery'));

			// Add meta box to custom post
			add_action('add_meta_boxes', array($this, '_admin_add_meta_box'));

			// loaded during admin init
			add_action('admin_init', array($this, '_admin_add_meta_box'));

			add_action('wp_ajax_insta_gallery_js', array(&$this, '_ajax_insta_gallery'));
			add_action('wp_ajax_insta_gallery_js_batch', array(&$this, '_ajax_insta_gallery_batch'));

			// Register nonce for AJAX security
			add_action('admin_enqueue_scripts', array(&$this, '_localize_ajax_nonce'));

			add_action('save_post', array(&$this, '_itg_save_settings'));

			// Shortcode Compatibility in Text Widgets
			add_filter('widget_text', 'do_shortcode');

			// add pfg cpt shortcode column - manage_{$post_type}_posts_columns
			add_filter('manage_insta_type_gallery_posts_columns', array(&$this, 'set_insta_type_gallery_shortcode_column_name'));

			// add pfg cpt shortcode column data - manage_{$post_type}_posts_custom_column
			add_action('manage_insta_type_gallery_posts_custom_column', array(&$this, 'custom_insta_type_gallery_shodrcode_data'), 10, 2);

			add_action('wp_enqueue_scripts', array(&$this, 'insta_enqueue_scripts_in_header'));
		} // end of hook function

		/**
		 * Localize AJAX nonce for admin scripts
		 */
		public function _localize_ajax_nonce()
		{
			wp_localize_script('itg-uploader.js', 'itg_ajax', array(
				'nonce' => wp_create_nonce('itg_ajax_nonce'),
				'ajaxurl' => admin_url('admin-ajax.php')
			));
		}

		public function insta_enqueue_scripts_in_header()
		{
			wp_enqueue_script('jquery');
		}


		// Instagram type gallery cpt shortcode column before date columns
		public function set_insta_type_gallery_shortcode_column_name($defaults)
		{
			$new = array();
			unset($defaults['tags']);   // remove it from the columns list

			foreach ($defaults as $key => $value) {
				if ($key == 'date') {  // when we find the date column
					$new['insta_type_gallery_shortcode'] = __('Shortcode', 'insta-type-gallery');  // put the shortcode column before it
				}
				$new[$key] = $value;
			}
			return $new;
		}

		// Instagram type gallery cpt shortcode column data
		public function custom_insta_type_gallery_shodrcode_data($column, $post_id)
		{
			switch ($column) {
				case 'insta_type_gallery_shortcode':
					echo "<input type='text' class='button button-primary' id='insta-type-shortcode-" . esc_attr($post_id) . "' value='[ITG id=" . esc_attr($post_id) . "]' style='font-weight:bold; background-color:#32373C; color:#FFFFFF; text-align:center;' />";
					echo "<input type='button' class='button button-primary' onclick='return INSTACopyShortcode" . esc_attr($post_id) . "();' readonly value='Copy' style='margin-left:4px;' />";
					echo "<span id='copy-msg-" . esc_attr($post_id) . "' class='button button-primary' style='display:none; background-color:#32CD32; color:#FFFFFF; margin-left:4px; border-radius: 4px;'>copied</span>";
					echo '<script>
						function INSTACopyShortcode' . esc_attr($post_id) . "() {
							var copyText = document.getElementById('insta-type-shortcode-" . esc_attr($post_id) . "');
							copyText.select();
							document.execCommand('copy');
							
							//fade in and out copied message
							jQuery('#copy-msg-" . esc_attr($post_id) . "').fadeIn('1000', 'linear');
							jQuery('#copy-msg-" . esc_attr($post_id) . "').fadeOut(2500,'swing');
						}
						</script>
					";
					break;
			}
		}

		/**
		 * Loads the text domain.
		 */
		public function _load_textdomain()
		{
			load_plugin_textdomain('insta-type-gallery', false, dirname(plugin_basename(__FILE__)) . '/languages');
		}


		/**
		 * Adds the Insta type Gallery menu item
		 */
		public function _insta_menu()
		{
			$help_menu = add_submenu_page('edit.php?post_type=' . ITG_PLUGIN_SLUG, __('Docs', 'insta-type-gallery'), __('Docs', 'insta-type-gallery'), 'administrator', 'sr-doc-page', array($this, '_itg_doc_page'));
			$our_theme = add_submenu_page('edit.php?post_type=' . ITG_PLUGIN_SLUG, __('Our Theme', 'insta-type-gallery'), __('Our Theme', 'insta-type-gallery'), 'administrator', 'sr-theme-page', array($this, '_itg_theme_page'));
		}


		/**
		 * insta type Gallery Custom Post
		 * Create gallery post type in admin dashboard.
		 */
		public function _Insta_Gallery()
		{
			$labels = array(
				'name'               => _x('Insta Type Gallery', 'Post Type General Name', 'insta-type-gallery'),
				'singular_name'      => _x('Insta Type Gallery', 'Post Type Singular Name', 'insta-type-gallery'),
				'menu_name'          => __('Insta Type Gallery', 'insta-type-gallery'),
				'name_admin_bar'     => __('Insta Type Gallery', 'insta-type-gallery'),
				'parent_item_colon'  => __('Parent Item:', 'insta-type-gallery'),
				'all_items'          => __('All Insta Gallery', 'insta-type-gallery'),
				'add_new_item'       => __('Add New Insta Gallery', 'insta-type-gallery'),
				'add_new'            => __('Add Insta Gallery', 'insta-type-gallery'),
				'new_item'           => __('New Insta Gallery', 'insta-type-gallery'),
				'edit_item'          => __('Edit Insta Gallery', 'insta-type-gallery'),
				'update_item'        => __('Update Insta Gallery', 'insta-type-gallery'),
				'search_items'       => __('Search Insta Gallery', 'insta-type-gallery'),
				'not_found'          => __('Insta Gallery Not found', 'insta-type-gallery'),
				'not_found_in_trash' => __('Insta Gallery Not found in Trash', 'insta-type-gallery'),
			);
			$args   = array(
				'label'               => __('Insta Type GalleryInsta Type Gallery', 'insta-type-gallery'),
				'description'         => __('Custom Post Type For Insta Gallery', 'insta-type-gallery'),
				'labels'              => $labels,
				'supports'            => array('title'),
				'taxonomies'          => array(),
				'hierarchical'        => false,
				'public'              => true,
				'show_ui'             => true,
				'show_in_menu'        => true,
				'menu_position'       => 65,
				'menu_icon'           => 'dashicons-camera',
				'show_in_admin_bar'   => true,
				'show_in_nav_menus'   => true,
				'can_export'          => true,
				'has_archive'         => true,
				'exclude_from_search' => false,
				'publicly_queryable'  => true,
				'capability_type'     => 'page',
			);
			register_post_type('insta_type_gallery', $args);
		} // end of post type function

		/**
		 * Adds Meta Boxes
		 *
		 * @access    private
		 * @since     3.0
		 * @return    void
		 */
		public function _admin_add_meta_box()
		{
			// Syntax: add_meta_box( $id, $title, $callback, $screen, $context, $priority, $callback_args );
			add_meta_box('1', __('Copy Album Gallery Shortcode', 'insta-type-gallery'), array(&$this, '_itg_shortcode_left_metabox'), 'insta_type_gallery', 'side', 'default');
			add_meta_box(__('Add Image', 'insta-type-gallery'), __('Add Image', 'insta-type-gallery'), array(&$this, 'itg_upload_multiple_images'), 'insta_type_gallery', 'normal', 'default');
			add_meta_box(__('Rate Our Plugin', 'insta-type-gallery'), __('Rate Our Plugin', 'insta-type-gallery'), array(&$this, 'itg_rate_plugin'), 'insta_type_gallery', 'side', 'default');
		}
		// Insta Type gallery copy shortcode meta box under publish button
		public function _itg_shortcode_left_metabox($post)
		{ ?>
			<p class="input-text-wrap">
				<input type="text" name="insta-type-shortcode" id="insta-type-shortcode" value="<?php echo '[ITG id=' . esc_attr($post->ID) . ']'; ?>" readonly style="height: 60px; text-align: center; width:100%;  font-size: 24px; border: 2px dashed;">
			<p id="itg-copy-code"><?php esc_html_e('Shortcode copied to clipboard!', 'insta-type-gallery'); ?></p>
			<p style="margin-top: 10px"><?php esc_html_e('Copy & Embed shotcode into any Page/ Post to display gallery.', 'insta-type-gallery'); ?></p>
			</p>
			<span onclick="copyToClipboard('#insta-type-shortcode')" class="itg-copy dashicons dashicons-clipboard"></span>
			<style>
				.itg-copy {
					position: absolute;
					top: 9px;
					right: 24px;
					font-size: 26px;
					cursor: pointer;
				}
			</style>
			<script>
				jQuery("#itg-copy-code").hide();

				function copyToClipboard(element) {
					var $temp = jQuery("<input>");
					jQuery("body").append($temp);
					$temp.val(jQuery(element).val()).select();
					document.execCommand("copy");
					$temp.remove();
					jQuery("#insta-type-shortcode").select();
					jQuery("#itg-copy-code").fadeIn();
				}
			</script>
		<?php
		}

		// meta rate us
		public function itg_rate_plugin()
		{
		?>
			<div style="text-align:center">
				<p><?php esc_html_e('If you like our plugin then please', 'insta-type-gallery'); ?> <b><?php esc_html_e('Rate us', 'insta-type-gallery'); ?></b> <?php esc_html_e('on WordPress', 'insta-type-gallery'); ?></p>
			</div>
			<div style="text-align:center">
				<span class="dashicons dashicons-star-filled"></span>
				<span class="dashicons dashicons-star-filled"></span>
				<span class="dashicons dashicons-star-filled"></span>
				<span class="dashicons dashicons-star-filled"></span>
				<span class="dashicons dashicons-star-filled"></span>
			</div>
			<br>
			<div style="text-align:center">
				<a href="https://wordpress.org/support/plugin/insta-type-gallery/reviews/" target="_new" class="button button-primary button-large" style="background: #496481; text-shadow: none;"><span class="dashicons dashicons-heart" style="line-height:1.4;"></span> Please Rate Us</a>
			</div>
		<?php
		}

		public function itg_upload_multiple_images($post)
		{
			wp_enqueue_script('media-upload');
			wp_enqueue_script('itg-uploader.js', ITG_PLUGIN_URL . 'assets/js/awl-itg-uploader.js');
			wp_enqueue_style('itg-uploader-css', ITG_PLUGIN_URL . 'assets/css/awl-itg-uploader.css');
			wp_enqueue_media();
		?>
			<!--Add New Image Button-->
			<div class="row">
				<!--Add New Image Button-->
				<div class="file-upload">
					<div class="image-upload-wrap">
						<input class="add-new-slider file-upload-input" id="add-new-slider" name="add-new-slider" value="Upload Image" />
						<div class="drag-text">
							<h3><?php esc_html_e('ADD IMAGES', 'insta-type-gallery'); ?></h3>
						</div>
					</div>
				</div>
			</div>

		<?php
			require_once 'include/insta-setting.php';
		} // end of upload multiple image

		public function _itg_ajax_callback_function($id)
		{
			// thumb, thumbnail, medium, large, post-thumbnail
			$thumbnail  = wp_get_attachment_image_src($id, 'medium', true);
			$attachment = get_post($id); // $id = attachment id
		?>
			<li class="slide">
				<img class="new-slide" src="<?php echo esc_url($thumbnail[0]); ?>" alt="<?php echo esc_html(get_the_title($id)); ?>" style="height: 150px; width: 98%; border-radius: 8px;">
				<input type="hidden" id="slide-ids[]" name="slide-ids[]" value="<?php echo esc_attr($id); ?>" />
				<input type="text" name="slide-title[]" id="slide-title[]" style="width: 100%;" placeholder="Image Title" value="<?php echo esc_html(get_the_title($id)); ?>">
				<input type="button" name="remove-slide" id="remove-slide" style="width: 100%;" class="button" value="Delete">
			</li>
<?php
		}

		public function _ajax_insta_gallery()
		{
			// Security check - verify user capability
			if (!current_user_can('edit_posts')) {
				wp_die(-1, 403);
			}

			// Verify nonce if provided (backward compatibility)
			if (isset($_POST['nonce']) && !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'itg_ajax_nonce')) {
				wp_die(-1, 403);
			}

			$slide_id = isset($_POST['slideId']) ? absint($_POST['slideId']) : 0;
			if ($slide_id > 0) {
				echo $this->_itg_ajax_callback_function($slide_id);
			}
			die;
		}

		/**
		 * Batch AJAX handler for processing multiple images in a single request
		 * This significantly improves performance when adding multiple images
		 */
		public function _ajax_insta_gallery_batch()
		{
			// Security check - verify user capability
			if (!current_user_can('edit_posts')) {
				wp_send_json_error('Unauthorized', 403);
				return;
			}

			// Verify nonce if provided (backward compatibility)
			if (isset($_POST['nonce']) && !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'itg_ajax_nonce')) {
				wp_send_json_error('Invalid nonce', 403);
				return;
			}

			// Check if slideIds is set and is an array
			if (!isset($_POST['slideIds']) || !is_array($_POST['slideIds'])) {
				wp_send_json_error('Invalid request');
				return;
			}

			$slide_ids = array_map('absint', $_POST['slideIds']);
			$output = '';

			foreach ($slide_ids as $id) {
				if ($id > 0) {
					$output .= $this->_itg_get_thumbnail_html($id);
				}
			}

			wp_send_json_success($output);
		}

		/**
		 * Generate thumbnail HTML for a single image
		 * Used by both single and batch AJAX handlers
		 */
		private function _itg_get_thumbnail_html($id)
		{
			$thumbnail = wp_get_attachment_image_src($id, 'medium', true);
			$title = get_the_title($id);

			$html = '<li class="slide">';
			$html .= '<img class="new-slide" src="' . esc_url($thumbnail[0]) . '" alt="' . esc_attr($title) . '" style="height: 150px; width: 98%; border-radius: 8px;">';
			$html .= '<input type="hidden" id="slide-ids[]" name="slide-ids[]" value="' . esc_attr($id) . '" />';
			$html .= '<input type="text" name="slide-title[]" id="slide-title[]" style="width: 100%;" placeholder="Image Title" value="' . esc_attr($title) . '">';
			$html .= '<input type="button" name="remove-slide" id="remove-slide" style="width: 100%;" class="button" value="Delete">';
			$html .= '</li>';

			return $html;
		}

		public function _itg_save_settings($post_id)
		{
			// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified by WordPress save_post
			if (isset($_POST['itg-settings']) && $_POST['itg-settings'] === 'itg-save-settings') {

				$show_pro                = isset($_POST['show_pro']) ? sanitize_text_field(wp_unslash($_POST['show_pro'])) : '0';
				$upload_image            = isset($_POST['upload_image']) ? esc_url_raw(wp_unslash($_POST['upload_image'])) : '';
				$pro_title               = isset($_POST['pro_title']) ? sanitize_text_field(wp_unslash($_POST['pro_title'])) : '';
				$pro_dec                 = isset($_POST['pro_dec']) ? sanitize_textarea_field(wp_unslash($_POST['pro_dec'])) : '';
				$follow_btn_text         = isset($_POST['follow_btn_text']) ? sanitize_text_field(wp_unslash($_POST['follow_btn_text'])) : '';
				$insta_user              = isset($_POST['insta_user']) ? sanitize_text_field(wp_unslash($_POST['insta_user'])) : '';
				$num_post                = isset($_POST['num_post']) ? absint($_POST['num_post']) : 0;
				$num_folo                = isset($_POST['num_folo']) ? absint($_POST['num_folo']) : 0;
				$num_of_folo             = isset($_POST['num_of_folo']) ? absint($_POST['num_of_folo']) : 0;
				$gal_thumb_size          = isset($_POST['gal_thumb_size']) ? sanitize_text_field(wp_unslash($_POST['gal_thumb_size'])) : 'thumbnail';
				$col_large_desktops      = isset($_POST['col_large_desktops']) ? sanitize_text_field(wp_unslash($_POST['col_large_desktops'])) : 'col-lg-3';
				$col_desktops            = isset($_POST['col_desktops']) ? sanitize_text_field(wp_unslash($_POST['col_desktops'])) : 'col-md-4';
				$col_tablets             = isset($_POST['col_tablets']) ? sanitize_text_field(wp_unslash($_POST['col_tablets'])) : 'col-sm-4';
				$col_phones              = isset($_POST['col_phones']) ? sanitize_text_field(wp_unslash($_POST['col_phones'])) : 'col-xs-6';
				$light_box               = isset($_POST['light_box']) ? sanitize_text_field(wp_unslash($_POST['light_box'])) : '0';
				$image_hover_effect_type = isset($_POST['image_hover_effect_type']) ? sanitize_text_field(wp_unslash($_POST['image_hover_effect_type'])) : 'sg';
				$image_hover_effect_four = isset($_POST['image_hover_effect_four']) ? sanitize_text_field(wp_unslash($_POST['image_hover_effect_four'])) : 'hvr-box-shadow-outset';
				$animation_effect        = isset($_POST['animation_effect']) ? sanitize_text_field(wp_unslash($_POST['animation_effect'])) : 'none';
				$no_spacing              = isset($_POST['no_spacing']) ? sanitize_text_field(wp_unslash($_POST['no_spacing'])) : '0';
				$thumbnail_order         = isset($_POST['thumbnail_order']) ? sanitize_text_field(wp_unslash($_POST['thumbnail_order'])) : 'ASC';

				$image_ids    = array();
				$image_titles = array();

				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized in loop below
				if (isset($_POST['slide-ids']) && is_array($_POST['slide-ids'])) {
					$image_ids_val = array_map('absint', $_POST['slide-ids']);
					$slide_titles  = isset($_POST['slide-title']) && is_array($_POST['slide-title']) ? $_POST['slide-title'] : array();

					foreach ($image_ids_val as $i => $image_id) {
						if ($image_id > 0) {
							$image_ids[]      = $image_id;
							$title            = isset($slide_titles[$i]) ? sanitize_text_field(wp_unslash($slide_titles[$i])) : '';
							$image_titles[]   = $title;

							$single_image_update = array(
								'ID'         => $image_id,
								'post_title' => $title,
							);

							wp_update_post($single_image_update);
						}
					}
				}

				$insta_post_setting                       = array(
					'slide-ids'               => $image_ids,
					'slide-title'             => $image_titles,
					'show_pro'                => $show_pro,
					'upload_image'            => $upload_image,
					'pro_title'               => $pro_title,
					'pro_dec'                 => $pro_dec,
					'follow_btn_text'         => $follow_btn_text,
					'insta_user'              => $insta_user,
					'num_post'                => $num_post,
					'num_folo'                => $num_folo,
					'num_of_folo'             => $num_of_folo,
					'gal_thumb_size'          => $gal_thumb_size,
					'col_large_desktops'      => $col_large_desktops,
					'col_desktops'            => $col_desktops,
					'col_tablets'             => $col_tablets,
					'col_phones'              => $col_phones,
					'light_box'               => $light_box,
					'image_hover_effect_type' => $image_hover_effect_type,
					'image_hover_effect_four' => $image_hover_effect_four,
					'animation_effect'        => $animation_effect,
					'no_spacing'              => $no_spacing,
					'thumbnail_order'         => $thumbnail_order,
				);
				$awl_insta_type_gallery_shortcode_setting = 'awl_itg_settings_' . $post_id;
				update_post_meta($post_id, $awl_insta_type_gallery_shortcode_setting, $insta_post_setting);
			}
		}//end _itg_save_settings()

		/**
		 * Insta type Gallery Docs Page
		 * Create doc page to help user to setup plugin
		 *
		 * @access    private
		 * @since     3.0
		 * @return    void.
		 */
		public function _itg_doc_page()
		{
			require_once 'include/docs.php';
		}

		public function _itg_theme_page()
		{
			require_once 'our-theme/awp-theme.php';
		}
	} // end of class

	// register sf scripts
	function awplife_itg_register_scripts()
	{

		// css & JS
		wp_register_script('itg-bootstrap-js', plugin_dir_url(__FILE__) . 'assets/js/bootstrap.min.js', array('jquery'), '', true);
		wp_register_script('itg-jpages-js', plugin_dir_url(__FILE__) . 'assets/js/itg-jPages.js');
		wp_register_script('itg-imagesloaded-pkgd-js', plugin_dir_url(__FILE__) . 'assets/js/imagesloaded.pkgd.js', array('jquery'), '', true);
		wp_register_script('itg-isotope-js', plugin_dir_url(__FILE__) . 'assets/js/isotope.pkgd.js', array('jquery'), '', false);

		wp_register_style('itg-bootstrap-css', plugin_dir_url(__FILE__) . 'assets/css/bootstrap.css');
		wp_register_style('itg-jpages-css', plugin_dir_url(__FILE__) . 'assets/css/jPages.css');
		wp_register_style('itg-animate-css', plugin_dir_url(__FILE__) . 'assets/css/animate.css');
		wp_register_style('itg-font-awesome-css', plugin_dir_url(__FILE__) . 'assets/css/font-awesome.css');
		wp_register_style('itg-frontend-css', plugin_dir_url(__FILE__) . 'assets/css/itg-frontend.css', array('itg-bootstrap-css'), ITG_PLUGIN_VER);
		// css & JS
	}
	add_action('wp_enqueue_scripts', 'awplife_itg_register_scripts');

	// Plugin Recommend
	add_action('tgmpa_register', 'ITG_TXTDM_plugin_recommend');
	function ITG_TXTDM_plugin_recommend()
	{
		$plugins = array(
			array(
				'name'     => 'Pricing Table',
				'slug'     => 'abc-pricing-table',
				'required' => false,
			),
			array(
				'name'     => 'Image Gallery',
				'slug'     => 'new-image-gallery',
				'required' => false,
			),
			array(
				'name'     => 'Grid Gallery ',
				'slug'     => 'new-grid-gallery',
				'required' => false,
			),
		);
		tgmpa($plugins);
	}

	/**
	 * Instantiates the Class
	 *
	 * @since     3.0
	 * @global    object    $itg_gallery_object
	 */
	$itg_gallery_object = new Instagram_Type_Gallery();
	require_once 'include/shortcode.php';
	require_once 'class-tgm-plugin-activation.php';
} // end of class exists
?>