I’m trying to install an additional plugin, and all I have is the slug name of the plugin under api.wordpress.org.
I’ve figured out that one could get the zip file’s path (download_link) when going to http://api.wordpress.org/plugins/info/1.0/plugin-slug
What would be the rest? I wouldn’t want to do the entire unzipping if there’s a built-in function in WP that does that…?
This solution should do the job for you.
http://tgmpluginactivation.com/
The solution is meant for theme developers to package to download, automatically install and activate multiple plugins that are either packaged with a theme, downloaded from the WordPress Plugin Repository or downloaded elsewhere on the internet (perhaps a private repository.
The code of the solution can be used to accomplish what you are trying to achieve. The code is also available on github athttps://github.com/TGMPA/TGM-Plugin-Activation.
Best of luck.