TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.76k stars 429 forks source link

One click install plugins with TGM? #493

Closed dingo-d closed 8 years ago

dingo-d commented 8 years ago

Is it possible to create a 'one click' plugin install with TGM plugin? Does it have some kind of hook I can use to automatically execute the activation of required plugins for my theme?

Can I use tgmpa_load_bulk_installer() for this?

jrfnl commented 8 years ago

Not sure I understand what you're asking. You can use the 'is_automatic' or 'force_activation' configuration settings to auto activate plugins once installed. See http://tgmpluginactivation.com/configuration/

dingo-d commented 8 years ago

is_automatic only makes the pop up: the theme requires this plugin appear. I haven't tried setting force_activation to true. Will try that.

I am asking because I'd like to automate the plugin activation process in less steps.

EDIT

I've set the force_activation => true, but it also just makes the pop up appear.

CLARIFICATION

I'd like to execute automatic plugin install say on after_setup_theme hook.

jrfnl commented 8 years ago

@dingo-d Both the options I pointed to do more than that.

Your original question was about auto-activation, which can be done with the options I mentioned.

Your current question seems to be about auto-installing. This is not supported by TGMPA by design. See #242 #279.

Also realize that if you adjust something in TGMPA, this may affect other plugins/themes too. WP will use the first instance of the TGMPA class it encounters and bundle the input from various plugins/themes using it into one installation page, so you may end up inadvertently installing plugins for other plugins/themes using TGMPA, not just your own.

dingo-d commented 8 years ago

Yeah, that would be kind of problematic :\ I guess I'll have to find another way of achieving this. Well thanks for the answers :)