<?php
/**
 * This file represents an example of the code that themes would use to register
 * the required plugins.
 *
 * @see http://tgmpluginactivation.com/configuration/ for detailed documentation.
 *
 * @package    TGM-Plugin-Activation
 * @subpackage Strakture
 * @version    2.6.1 for parent theme Strakture for publication on WordPress.org
 * @author     Thomas Griffin, Gary Jones, Juliette Reinders Folmer
 * @copyright  Copyright (c) 2011, Thomas Griffin
 * @license    http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
 * @link       https://github.com/TGMPA/TGM-Plugin-Activation
 */


require_once STRAKTURE_DIR . '/includes/tgmpa/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'strakture_tgmpa_register_required_plugins' );


/**
 * TGMPA Plugins
 */
function strakture_tgmpa_register_required_plugins() {
	$plugins = array(
		array(
			'name'      => esc_html__( 'WooCommerce', 'strakture' ),
			'slug'      => 'woocommerce',
			'required'  => false,
		),
		array(
			'name'      => esc_html__( 'Contact Form 7', 'strakture' ),
			'slug'      => 'contact-form-7',
			'required'  => false,
		)
	);

	if ( ! strakture_theme_fs()->can_use_premium_code__premium_only() && ! is_dir( WP_PLUGIN_DIR . '/strakture-pro' ) ) {
		$plugins[] = array(
			'name'      => esc_html__( 'Strakture', 'strakture' ),
			'slug'      => 'strakture',
			'required'  => false,
		);
	}


	$config = array(
		'id'           => 'tgmpa',
		'default_path' => '',
		'menu'         => 'tgmpa-install-plugins',
		'capability'   => 'edit_theme_options',
		'has_notices'  => true,
		'dismissable'  => true,
		'dismiss_msg'  => '',
		'is_automatic' => true,
		'message'      => '',
		'strings'      => array(
			'page_title'                      => esc_html__( 'Install Required Plugins', 'strakture' ),
			'menu_title'                      => esc_html__( 'Install Plugins', 'strakture' ),
			'installing'                      => esc_html__( 'Installing Plugin: %s', 'strakture' ),
			'updating'                        => esc_html__( 'Updating Plugin: %s', 'strakture' ),
			'oops'                            => esc_html__( 'Something went wrong with the plugin API.', 'strakture' ),
			'return'                          => esc_html__( 'Return to Required Plugins Installer', 'strakture' ),
			'plugin_activated'                => esc_html__( 'Plugin activated successfully.', 'strakture' ),
			'activated_successfully'          => esc_html__( 'The following plugin was activated successfully:', 'strakture' ),
			'plugin_already_active'           => esc_html__( 'No action taken. Plugin %1$s was already active.', 'strakture' ),
			'plugin_needs_higher_version'     => esc_html__( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'strakture' ),
			'complete'                        => esc_html__( 'All plugins installed and activated successfully. %1$s', 'strakture' ),
			'dismiss'                         => esc_html__( 'Dismiss this notice', 'strakture' ),
			'notice_cannot_install_activate'  => esc_html__( 'There are one or more required or recommended plugins to install, update or activate.', 'strakture' ),
			'contact_admin'                   => esc_html__( 'Please contact the administrator of this site for help.', 'strakture' ),
			'nag_type'                        => 'updated',
		),

	);

	tgmpa( $plugins, $config );
}