<?php
/**
* Update/Install Plugin/Theme administration panel.
*
* @package WordPress
* @subpackage Administration
*/
if ( ! defined( 'IFRAME_REQUEST' )
&& isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ), true )
) {
define( 'IFRAME_REQUEST', true );
}
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
wp_enqueue_script( 'wp-a11y' );
if ( isset( $_GET['action'] ) ) {
$plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : '';
$theme = isset( $_REQUEST['theme'] ) ? urldecode( $_REQUEST['theme'] ) : '';
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
if ( 'update-selected' === $action ) {
if ( ! current_user_can( 'update_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
}
check_admin_referer( 'bulk-update-plugins' );
if ( isset( $_GET['plugins'] ) ) {
$plugins = explode( ',', stripslashes( $_GET['plugins'] ) );
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) $_POST['checked'];
} else {
$plugins = array();
}
$plugins = array_map( 'urldecode', $plugins );
$url = 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) );
$nonce = 'bulk-update-plugins';