<?php
/**
 * Tattoopress recommended plugins
 *
 * @package WordPress
 * @subpackage Tattoopress
 * @since Tattoopress 3.0.0
 */

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

// delete_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_tgmpa' );

/**
 * Add tattoopress updater plugins
 */
add_filter(
	'tattoopress_recommended_plugins',
	function( $plugins ) {

		if ( get_option( 'wolf_theme_options_tattoopro' ) ) {

			$plugins[] = array(
				'name'         => esc_html__( 'Wolf Tattoopress Version 3 Updater', 'tattoopress' ),
				'slug'         => 'wolf-tattoopress-v3-updater',
				'source'       => 'http://plugins.wolfthemes.com/wolf-tattoopress-v3-updater/wolf-tattoopress-v3-updater.zip',
				'external_url' => 'http://plugins.wolfthemes.com/wolf-tattoopress-v3-updater/wolf-tattoopress-v3-updater.zip',
			);

			$plugins[] = array(
				'name' => esc_html__( 'Force Regenerate Thumbnails', 'tattoopress' ),
				'slug' => 'force-regenerate-thumbnails',
			);

		}

		return $plugins;
	}
);

/* Require TGM Plugin Activation class */
require_once get_template_directory() . '/inc/admin/lib/class-tgm-plugin-activation.php';

function wolf_theme_register_required_plugins() {

	$plugins = apply_filters(
		'tattoopress_recommended_plugins',
		array(

			array(
				'name'     => esc_html__( 'WPBakery Page Builder', 'tattoopress' ),
				'slug'     => 'js_composer',
				'source'   => 'js_composer.zip',
				'required' => true,
			),

			array(
				'name'    => esc_html__( 'Slider Revolution', 'tattoopress' ),
				'slug'    => 'revslider',
				'source'  => 'revslider.zip',
				'version' => '6.2',
			),

			array(
				'name'         => esc_html__( 'WPBakery Page Builder Extension', 'tattoopress' ),
				'slug'         => 'wolf-visual-composer',
				'source'       => 'https://github.com/wolfthemes/wolf-visual-composer/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-visual-composer/archive/master.zip',
				'required'     => true,
			),

			array(
				'name'         => esc_html__( 'WPBakery Page Builder Content Blocks', 'tattoopress' ),
				'slug'         => 'wolf-vc-content-block',
				'source'       => 'https://github.com/wolfthemes/wolf-vc-content-block/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-vc-content-block/archive/master.zip',
			),

			array(
				'name'         => esc_html__( 'Photo Albums', 'tattoopress' ),
				'slug'         => 'wolf-albums',
				'source'       => 'https://github.com/wolfthemes/wolf-albums/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-albums/archive/master.zip',
			),

			array(
				'name'         => esc_html__( 'Videos', 'tattoopress' ),
				'slug'         => 'wolf-videos',
				'source'       => 'https://github.com/wolfthemes/wolf-videos/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-videos/archive/master.zip',
			),

			array(
				'name'         => esc_html__( 'Share Icons', 'tattoopress' ),
				'slug'         => 'wolf-share',
				'source'       => 'https://github.com/wolfthemes/wolf-share/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-share/archive/master.zip',
			),

			array(
				'name'         => esc_html__( 'Metaboxes', 'tattoopress' ),
				'slug'         => 'wolf-metaboxes',
				'source'       => 'https://github.com/wolfthemes/wolf-metaboxes/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-metaboxes/archive/master.zip',
			),

			array(
				'name'         => esc_html__( 'Twitter Feed', 'tattoopress' ),
				'slug'         => 'wolf-twitter',
				'source'       => 'https://github.com/wolfthemes/wolf-twitter/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-twitter/archive/master.zip',
			),

			array(
				'name' => esc_html__( 'Instagram Feed (Smash Balloon)', 'tattoopress' ),
				'slug' => 'instagram-feed',
			),

			array(
				'name'         => esc_html__( 'Video Thumbnail Generator', 'tattoopress' ),
				'slug'         => 'wolf-video-thumbnail-generator',
				'source'       => 'https://github.com/wolfthemes/wolf-video-thumbnail-generator/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-video-thumbnail-generator/archive/master.zip',
			),

			array(
				'name' => esc_html__( 'WooCommerce', 'tattoopress' ),
				'slug' => 'woocommerce',
			),

			array(
				'name' => esc_html__( 'WooCommerce Currency Switcher', 'tattoopress' ),
				'slug' => 'woocommerce-currency-switcher',
			),

			array(
				'name'         => esc_html__( 'WooCommerce Quickview', 'tattoopress' ),
				'slug'         => 'wolf-woocommerce-quickview',
				'source'       => 'https://github.com/wolfthemes/wolf-woocommerce-quickview/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-woocommerce-quickview/archive/master.zip',
			),

			array(
				'name' => esc_html__( 'WooCommerce Variation Swatches', 'tattoopress' ),
				'slug' => 'variation-swatches-for-woocommerce',
			),

			array(
				'name'         => esc_html__( 'WooCommerce Wishlist', 'tattoopress' ),
				'slug'         => 'wolf-woocommerce-wishlist',
				'source'       => 'https://github.com/wolfthemes/wolf-woocommerce-wishlist/archive/master.zip',
				'external_url' => 'https://github.com/wolfthemes/wolf-woocommerce-wishlist/archive/master.zip',
			),

			array(
				'name' => esc_html__( 'Contact Form 7', 'tattoopress' ),
				'slug' => 'contact-form-7',
			),

			array(
				'name' => esc_html__( 'Widgets in Menu for WordPress', 'tattoopress' ),
				'slug' => 'widgets-in-menu',
			),
			array(
				'name'         => esc_html__( 'Envato Market Items Updater', 'tattoopress' ),
				'slug'         => 'envato-market',
				'source'       => 'https://github.com/envato/wp-envato-market/archive/master.zip',
				'external_url' => 'https://github.com/envato/wp-envato-market/archive/master.zip',
			),

			array(
				'name' => esc_html__( 'Disable Gutenberg', 'tattoopress' ),
				'slug' => 'disable-gutenberg',
			),

			array(
				'name' => esc_html__( 'One Click Demo Import', 'tattoopress' ),
				'slug' => 'one-click-demo-import',
			),
		)
	);

	// Change this to your theme text domain, used for internationalising strings
	$theme_text_domain = 'tattoopress';

	/*
	 * Array of configuration settings. Amend each line as needed.
	 *
	 * TGMPA will start providing localized text strings soon. If you already have translations of our standard
	 * strings available, please help us make TGMPA even better by giving us access to these translations or by
	 * sending in a pull-request with .po file(s) with the translations.
	 *
	 * Only uncomment the strings in the config array if you want to customize the strings.
	 */
	$config = array(
		'id'           => 'tgmpa',
		'default_path' => get_template_directory() . '/config/plugins/',
		'menu'         => 'tgmpa-install-plugins',
		'parent_slug'  => 'themes.php',
		'capability'   => 'edit_theme_options',
		'has_notices'  => true,
		'dismissable'  => true,
		'dismiss_msg'  => '',
		'is_automatic' => false,
		'message'      => '',
	);
	tgmpa( $plugins, $config );
}
add_action( 'tgmpa_register', 'wolf_theme_register_required_plugins' );
