File: //home/globfdxw/public_html/wp-content/themes/alone/plugin-install/plugin-required.php
<?php
/**
* This file represents an example of the code that themes would use to register
* the required plugins.
*
* It is expected that theme authors would copy and paste this code into their
* functions.php file, and amend to suit.
*
* @see http://tgmpluginactivation.com/configuration/ for detailed documentation.
*
* @package TGM-Plugin-Activation
* @subpackage Example
* @version 2.6.1
* @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
*/
/**
* Include the TGM_Plugin_Activation class.
*
* Depending on your implementation, you may want to change the include call:
*
* Parent Theme:
* require_once get_template_directory() . '/path/to/class-tgm-plugin-activation.php';
*
* Child Theme:
* require_once get_stylesheet_directory() . '/path/to/class-tgm-plugin-activation.php';
*/
require_once get_template_directory() . '/plugin-install/class-tgm-plugin-activation.php';
function alone_register_required_plugins() {
if ( isset( $_GET['page'] ) && $_GET['page'] === 'verifytheme_settings' ) {
return;
}
$pathfile = 'https://download.beplusthemes.com/';
$plugin_includes = array(
array(
'name' => __('Elementor Website Builder', 'alone'),
'slug' => 'elementor',
'required' => true,
),
array(
'name' => __('Alone Addons', 'alone'),
'slug' => 'alone-addons',
'source' => $pathfile . 'alone-addons.zip',
'required' => true,
),
array(
'name' => __('UberMenu 3 - The Ultimate WordPress Mega Menu', 'alone'),
'slug' => 'ubermenu',
'source' => $pathfile . 'ubermenu.zip',
'required' => false,
),
array(
'name' => __('Kirki Customizer Framework', 'alone'),
'slug' => 'kirki',
'required' => true,
),
array(
'name' => __('Advanced Custom Fields PRO', 'alone'),
'slug' => 'advanced-custom-fields-pro',
'source' => $pathfile . 'advanced-custom-fields-pro.zip',
'required' => true,
),
array(
'name' => __('GiveWP – Donation Plugin and Fundraising Platform', 'alone'),
'slug' => 'give',
'required' => true,
),
array(
'name' => __('The Events Calendar', 'alone'),
'slug' => 'the-events-calendar',
'required' => true,
),
array(
'name' => __('Sermon\'e - Sermons Management', 'alone'),
'slug' => 'sermone',
'source' => $pathfile . 'sermone.zip',
'required' => true,
),
array(
'name' => 'Yoast SEO',
'slug' => 'wordpress-seo',
'required' => true,
),
array(
'name' => __('AccessYes Accessibility Widget for ADA, EAA & WCAG Readiness', 'alone'),
'slug' => 'accessibility-widget',
'required' => false,
),
array(
'name' => __('WooCommerce', 'alone'),
'slug' => 'woocommerce',
'required' => false,
),
array(
'name' => __('WPML Multilingual CMS', 'alone'),
'slug' => 'sitepress-multilingual-cms',
'source' => $pathfile . 'sitepress-multilingual-cms.zip',
'required' => false,
),
array(
'name' => __('WPML String Translation', 'alone'),
'slug' => 'wpml-string-translation',
'source' => $pathfile . 'wpml-string-translation.zip',
'required' => false,
),
array(
'name' => __('WPML SEO', 'alone'),
'slug' => 'wp-seo-multilingual',
'source' => $pathfile . 'wp-seo-multilingual.zip',
'required' => false,
),
array(
'name' => __('Advanced Custom Fields Multilingual', 'alone'),
'slug' => 'acfml',
'source' => $pathfile . 'acfml.zip',
'required' => false,
),
array(
'name' => __('WooCommerce Multilingual & Multicurrency', 'alone'),
'slug' => 'woocommerce-multilingual',
'source' => $pathfile . 'woocommerce-multilingual.zip',
'required' => false,
),
array(
'name' => __( 'Worry Proof Backup', 'alone' ),
'slug' => 'worry-proof-backup',
'source' => $pathfile . 'worry-proof-backup.zip',
'required' => false,
),
);
$config = array(
'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'parent_slug' => 'themes.php', // Parent menu slug.
'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => true, // Automatically activate plugins after installation or not.
'message' => '<h2>' . __('WPML Plugins Used for Alone Multiple Languages', 'alone') . '</h2>', // Message to output right before the plugins table.
);
tgmpa( $plugin_includes, $config );
}
add_action( 'tgmpa_register', 'alone_register_required_plugins' );
/**
* Dummy Demo Data
*/
define('WORRPRBA_DUMMY_PACK_CENTER_SUPPORTED', true);
define('WORRPRBA_DUMMY_PACK_CENTER_ENDPOINT', 'https://wpb-dummy-pack-center-mocha.vercel.app/api/');
define('WORRPRBA_DUMMY_PACK_CENTER_THEME_SLUG', 'alone');
add_filter( 'worrprba_dummy_pack_center_license_key', function( $purchase_code ) {
$verifytheme = get_option('_verifytheme_settings');
if (empty($verifytheme)) {
$purchase_code = '';
}
if (is_array($verifytheme) && !empty($verifytheme['purchase_code'])) {
$purchase_code = $verifytheme['purchase_code'];
}
if (is_string($verifytheme)) {
$verifytheme_ob = json_decode($verifytheme);
if (!empty($verifytheme_ob->purchase_code)) {
$purchase_code = $verifytheme_ob->purchase_code;
}
}
return $purchase_code;
}, 50, 1 );
add_filter( 'worrprba_dummy_pack_center_submenu_args', function ($submenu_args) {
return $submenu_args = array(
'parent_slug' => 'themes.php',
'page_title' => __('Demo Import', 'alone'),
'menu_title' => __('Demo Import', 'alone'),
'capability' => 'manage_options',
'menu_slug' => 'dummy-pack-center',
'callback' => 'worrprba_dummy_pack_center_page'
);
} );
add_action('worry-proof-backup:after_install_dummy_pack_done', function($payload) {
if ( did_action( 'elementor/loaded' ) ) {
\Elementor\Plugin::$instance->files_manager->clear_cache();
}
if ( function_exists( 'wc_delete_product_transients' ) ) {
wc_delete_product_transients();
}
flush_rewrite_rules();
return $payload;
}, 10, 1 );
/**
* Verify purchase code
*/
require get_template_directory() . '/license-manager/VerifyTheme.php';
// Initialize the admin UI and AJAX handlers
add_action( 'after_setup_theme', function() {
if ( class_exists( 'VerifyTheme_Admin' ) ) {
VerifyTheme_Admin::init();
}
} );