Is it possible, somehow to programmatically install plugins? So I can send my client one file they unpack, go to some installplugins.php file and that installs + activates them? Only way I found for doing that is really rancid lowlevel; I’m hoping someone here knows better methods.
Leave a Reply
You must be logged in to post a comment.
Update
Today I use a shell loop with wp-cli to install and activate the plugins
Original Answer
For activating, I use some variant of this. suppose I had three plugins i wanted to activate (“cforms”, “w3-total-cache”, “wordpress-seo”). The convention is that their directory and plugin .php file are the same name:
/wp-content/plugins/
(root dir if the plugin is just one file, otherwise a subdir).activate_plugin('/full/path/to/your/plugin/php');
Here’s a complete script; put in wp-admin, give it a .php suffix, and hit it via curl.
Looks like you can toggle plugins in the database: table wp_options -> field option_name -> active_plugins.