base = 'bigshop'; $this->path = get_template_directory() . '/plugin-bundle/'; add_action( 'tgmpa_register', [ $this, 'register_required_plugins' ] ); } public function register_required_plugins() { $plugins = [ // Repository [ 'name' => 'ShopBuilder Elementor WooCommerce Builder', 'slug' => 'shopbuilder', 'required' => true, ], [ 'name' => 'Variation Images Gallery for WooCommerce', 'slug' => 'woo-product-variation-gallery', 'required' => false, ], [ 'name' => 'Variation Swatches for WooCommerce', 'slug' => 'woo-product-variation-swatches', 'required' => false, ], [ 'name' => esc_html__('Elementor Page Builder','bigshop'), 'slug' => 'elementor', 'required' => false, ], [ 'name' => 'WooCommerce', 'slug' => 'woocommerce', 'required' => false, ], ]; $config = [ 'id' => $this->base, // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => $this->path, // Default absolute path to bundled plugins. 'menu' => $this->base . '-install-plugins', // Menu slug. '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' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ]; tgmpa( $plugins, $config ); } }