Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm wondering if there is a way for a plugin to install other plugins directly. That means, I provide an interface for the user to click multiple plugins and download and install them directly to wp-content/plugins.

Basically imagine a marketplace plugin within wordpress where users can purchase plugins FROM a plugin and install directly into their site.

I would like to find out the API or any ideas on how to achieve the installation/upgrade.

share|improve this question
    
Do you mean you want to promote your other plugins in a plugin of yours the user downloaded and installed into there site, so that the user can purchase it and install it in a couple clicks without leaving the site/page? Or do you mean you want to have a marketplace website that a user can purchase the plugin and have it install into there site directly? –  user1632018 Oct 11 '13 at 3:55
    
yes, as long as the user that the web server runs under has permissions to write to plugins dir. –  gwillie Oct 11 '13 at 3:58
    
Yes the latter sort of. I want a plugin like plugpress.com –  Aaron Lee Oct 11 '13 at 9:21

3 Answers 3

up vote 2 down vote accepted

You can take a look at TGM-Plugin-Activation plugin. It should give you good starting point. As written in the documentation:

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 and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference pre-packaged plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.

share|improve this answer
    
AWESOME! didn't know this was here. thanks @Euguene –  Aaron Lee Oct 11 '13 at 9:19

Yes, this is possible, but there isn't really any magic API for it. Because WordPress scans the plugins folder for plugins, installing a new plugin is simply a matter of writing the files to the plugins folder, and uninstalling is just deleting the files from the folder.

If you want to be able to activate or deactivate plugins programmatically, you can use the activate_plugins and deactivate_plugins functions.

share|improve this answer

Take a look to http://wpfavs.com . With that plugin you can create list of favorites plugins and then do bulk installs

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.