/* translators: %s: Plugin name and version. */
$title =
sprintf( __( 'Installing Plugin: %s'
),
$api->name . ' ' .
$api->version
);
$nonce = 'install-plugin_' .
$plugin;
$url = 'update.php?action=install-plugin&plugin=' .
urlencode( $plugin );
if ( isset( $_GET['from'
] ) ) { $url .= '&from=' .
urlencode( stripslashes( $_GET['from'
] ) );
} $type = 'web'; // Install plugin type, From Web or an Upload.
$upgrader =
new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api'
) ) );
$upgrader->
install( $api->download_link
);
require_once ABSPATH . 'wp-admin/admin-footer.php';
} elseif ( 'upload-plugin' ===
$action ) { if ( !
current_user_can( 'upload_plugins'
) ) { wp_die( __( 'Sorry, you are not allowed to install plugins on this site.'
) );
} check_admin_referer( 'plugin-upload'
);