Below you’ll find a function that generates a plugin install link for WordPress. You can use this in the dashboard. This link acts the same way as the “Install plugin” buttons when searching for plugins within WordPress.
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin={plugin_slug}' ), 'install-plugin_{plugin_slug}' );
Replace {plugin_slug}
with the actual plugin slug, like ‘sympose’, ‘akismet’, or ‘wordpress-seo’.
Luciano Reis says
Very helpful tip. Thank you!