X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/256a3b381f63716209b3527d0a14442ae570c283..9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f:/wp-admin/plugins.php diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 776a2b54..988cfa93 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -60,7 +60,7 @@ if ( $action ) { wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above } exit; - break; + case 'activate-selected': if ( ! current_user_can('activate_plugins') ) wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); @@ -69,16 +69,19 @@ if ( $action ) { $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); - // Only activate plugins which are not already active. if ( is_network_admin() ) { foreach ( $plugins as $i => $plugin ) { - if ( is_plugin_active_for_network( $plugin ) ) + // Only activate plugins which are not already network activated. + if ( is_plugin_active_for_network( $plugin ) ) { unset( $plugins[ $i ] ); + } } } else { foreach ( $plugins as $i => $plugin ) { - if ( is_plugin_active( $plugin ) || is_network_only_plugin( $plugin ) ) + // Only activate plugins which are not already active and are not network-only when on Multisite. + if ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) { unset( $plugins[ $i ] ); + } } } @@ -98,7 +101,7 @@ if ( $action ) { wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") ); exit; - break; + case 'update-selected' : check_admin_referer( 'bulk-plugins' ); @@ -113,6 +116,7 @@ if ( $action ) { $title = __( 'Update Plugins' ); $parent_file = 'plugins.php'; + wp_enqueue_script( 'updates' ); require_once(ABSPATH . 'wp-admin/admin-header.php'); echo '
'; @@ -125,7 +129,7 @@ if ( $action ) { echo '
'; require_once(ABSPATH . 'wp-admin/admin-footer.php'); exit; - break; + case 'error_scrape': if ( ! current_user_can('activate_plugins') ) wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); @@ -143,13 +147,14 @@ if ( $action ) { @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. // Go back to "sandbox" scope so we get the same errors as before function plugin_sandbox_scrape( $plugin ) { + wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); include( WP_PLUGIN_DIR . '/' . $plugin ); } plugin_sandbox_scrape( $plugin ); /** This action is documented in wp-admin/includes/plugins.php */ do_action( "activate_{$plugin}" ); exit; - break; + case 'deactivate': if ( ! current_user_can('activate_plugins') ) wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.')); @@ -169,7 +174,7 @@ if ( $action ) { else wp_redirect( self_admin_url("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s") ); exit; - break; + case 'deactivate-selected': if ( ! current_user_can('activate_plugins') ) wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.')); @@ -200,7 +205,7 @@ if ( $action ) { wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") ); exit; - break; + case 'delete-selected': if ( ! current_user_can('delete_plugins') ) wp_die(__('You do not have sufficient permissions to delete plugins for this site.')); @@ -319,7 +324,7 @@ if ( $action ) { set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length wp_redirect( self_admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") ); exit; - break; + case 'clear-recent-list': if ( ! is_network_admin() ) update_option( 'recently_activated', array() ); @@ -339,7 +344,7 @@ get_current_screen()->add_help_tab( array( 'title' => __('Overview'), 'content' => '

' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '

' . - '

' . sprintf(__('You can find additional plugins for your site by using the Plugin Browser/Installer functionality or by browsing the WordPress Plugin Directory directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your /wp-content/plugins directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/plugins/') . '

' + '

' . sprintf(__('You can find additional plugins for your site by using the Plugin Browser/Installer functionality or by browsing the WordPress Plugin Directory directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your /wp-content/plugins directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'https://wordpress.org/plugins/') . '

' ) ); get_current_screen()->add_help_tab( array( 'id' => 'compatibility-problems', @@ -352,7 +357,7 @@ get_current_screen()->add_help_tab( array( get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Managing Plugins') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Support Forums') . '

' ); $title = __('Plugins'); @@ -375,7 +380,7 @@ if ( !empty($invalid) ) else $errmsg = __('Plugin could not be activated because it triggered a fatal error.'); ?> -

+

@@ -389,7 +394,7 @@ if ( !empty($invalid) ) delete_transient( 'plugins_delete_result_' . $user_ID ); if ( is_wp_error($delete_result) ) : ?> -

get_error_message() ); ?>

+

get_error_message() ); ?>

deleted.'); ?>