<?php

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Plugin installation and activation for WordPress themes
 *
 * @package InsightFramework
 * @since   0.9.7
 */
class Insight_Register_Plugins {

	/**
	 * Insight_Register_Plugins constructor.
	 */
	public function __construct() {
		add_filter( 'insight_core_tgm_plugins', array( $this, 'register_required_plugins' ) );
	}

	public function register_required_plugins() {
		/*
		 * Array of plugin arrays. Required keys are name and slug.
		 * If the source is NOT from the .org repo, then source is also required.
		 */
		$plugins = array(
			array(
				'name'     => esc_html__( 'Insight Core', 'tm-9studio' ),
				'slug'     => 'insight-core',
				'source'   => 'https://api.thememove.com/download/insight-core-2.1.1-wiJecDKvrh.zip',
				'version'  => '2.1.1',
				'required' => true,
			),
			array(
				'name'     => esc_html__( 'WPBakery Page Builder', 'tm-9studio' ),
				'slug'     => 'js_composer',
				'source'   => 'https://api.thememove.com/download/js_composer-6.6.0-GTz1qxX6Xb.zip',
				'version'  => '6.6.0',
				'required' => true,
			),
			array(
				'name'    => esc_html__( 'WPBakery Page Builder (Visual Composer) Clipboard', 'tm-9studio' ),
				'slug'    => 'vc_clipboard',
				'source'  => 'https://api.thememove.com/download/vc_clipboard-4.5.8-6x4EjSaacf.zip',
				'version' => '4.5.8',
			),
			array(
				'name'     => esc_html__( 'Revolution Slider', 'tm-9studio' ),
				'slug'     => 'revslider',
				'source'   => 'https://api.thememove.com/download/revslider-6.4.8-pNFXKY1djN.zip',
				'version'  => '6.4.8',
				'required' => true,
			),
			array(
				'name'     => esc_html__( 'Vafpress Post Formats UI', 'tm-9studio' ),
				'slug'     => 'vafpress-post-formats-ui',
				'source'   => 'https://bitbucket.org/digitalcreative/thememove-plugins/raw/6d99bde830efc40439c56def18eca09706017e8a/vafpress-post-formats-ui-199.zip',
				'version'  => '1.99',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'WooCommerce', 'tm-9studio' ),
				'slug'     => 'woocommerce',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'WPC Product Bundles', 'tm-9studio' ),
				'slug'     => 'woo-product-bundle',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'WPC Smart Quick View', 'tm-9studio' ),
				'slug'     => 'woo-smart-quick-view',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'WPC Smart Compare', 'tm-9studio' ),
				'slug'     => 'woo-smart-compare',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'WPC Smart Wishlist', 'tm-9studio' ),
				'slug'     => 'woo-smart-wishlist',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'MailChimp for WordPress', 'tm-9studio' ),
				'slug'     => 'mailchimp-for-wp',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'Contact Form 7', 'tm-9studio' ),
				'slug'     => 'contact-form-7',
				'required' => false,
			),
			array(
				'name'     => esc_html__( 'Enable jQuery Migrate Helper', 'tm-9studio' ),
				'slug'     => 'enable-jquery-migrate-helper',
				'required' => true,
			),
		);

		return $plugins;
	}

}
