Please consider that I am not a Wordpress plugin developer, but I am maintaining a lot of Wordpress websites. In case I have to perform a change to all of them, I will have to log in each site and this is consuming a lot of time.
To resolve the problem, I devlop my own PHP scripts, which get use of the functions defined in Wordpress. This way I only need to run the script to resolve the particular issue.
Lets assume that I want to install a plugin. I will use the following code:
function install_plugin($Plugin_name) {
get_downloadurl_from_api($Plugin_name); /* A function defined by me to get the download URL of the desired plugin by using the Wordpress API. */
download_extract_plugin($Plugin_name); /* A function defined by me to download the plugin archive and extract it in the wp-content/plugins directory */
activate_plugin($Plugin_name); /* Activate the plugin. This function is defined in wp-admin/includes/plugin.php */ }
My code works seamlessly, but I was wondering if there is a Wordpress defined function that does the same as get_downloadurl_from_api() and download_extract_plugin()?