admin管理员组

文章数量:1124030

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.

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 edited Mar 18, 2024 at 11:02 Jesse Nickles 7357 silver badges19 bronze badges asked Oct 11, 2013 at 3:39 Aaron LeeAaron Lee 4233 silver badges7 bronze badges 3
  • 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 Commented Oct 11, 2013 at 3:55
  • yes, as long as the user that the web server runs under has permissions to write to plugins dir. – gwillie Commented Oct 11, 2013 at 3:58
  • Yes the latter sort of. I want a plugin like plugpress.com – Aaron Lee Commented Oct 11, 2013 at 9:21
Add a comment  | 

4 Answers 4

Reset to default 2

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.

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.

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

A useful tool to do this is: WP-CLI - WordPress Command Line Interface. You can list all plugins, activate, deactive, install, uninstall, and/or update one or more plugins using a script. A huge timesaver.

本文标签: Plugin that supports the purchase and installation of other plugins