Install a plugin
wp_install_pluginInstall a plugin from the WordPress.org directory by slug, optionally activating it. Needs install_plugins, and activate_plugins for activate (without it the plugin is installed and activated stays false); refused when DISALLOW_FILE_MODS is set. Returns installed, plugin (its file, e.g. akismet/akismet.php), activated and version, plus what the activation check reports; no undo point is recorded. Where its folder exists already, nothing is changed and the answer names the version installed; an installed plugin is brought to a newer version with wp_update_plugin. With activate, the activation is checked as with wp_activate_plugin and wp_activate_theme: where the site does worse with it active, it is taken back in the same call, and the answer, an error, names the error with file and line; what was installed stays installed. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | wordpress.org plugin slug, e.g. "akismet". | |
| activate | No | true activates the plugin after install (needs activate_plugins). Default false. |