X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/849f15aeed7a5e39314057bdc0064d8edd60dd7d..c81aba3d563f7459dc79140e4c5be67bcf506b92:/wp-admin/plugins.php diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index afc83bb4..93aec79d 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -23,6 +23,8 @@ $s = isset($_REQUEST['s']) ? urlencode($_REQUEST['s']) : ''; // Clean up request URI from temporary args for screen options/paging uri's to work as expected. $_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']); +wp_enqueue_script( 'updates' ); + if ( $action ) { switch ( $action ) { @@ -52,6 +54,10 @@ if ( $action ) { $recent = (array) get_option( 'recently_activated' ); unset( $recent[ $plugin ] ); update_option( 'recently_activated', $recent ); + } else { + $recent = (array) get_site_option( 'recently_activated' ); + unset( $recent[ $plugin ] ); + update_site_option( 'recently_activated', $recent ); } if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { @@ -94,9 +100,18 @@ if ( $action ) { if ( ! is_network_admin() ) { $recent = (array) get_option('recently_activated' ); - foreach ( $plugins as $plugin ) - unset( $recent[ $plugin ] ); + } else { + $recent = (array) get_site_option('recently_activated' ); + } + + foreach ( $plugins as $plugin ) { + unset( $recent[ $plugin ] ); + } + + if ( ! is_network_admin() ) { update_option( 'recently_activated', $recent ); + } else { + update_site_option( 'recently_activated', $recent ); } wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") ); @@ -120,7 +135,7 @@ if ( $action ) { require_once(ABSPATH . 'wp-admin/admin-header.php'); echo '
'; - echo '

' . esc_html( $title ) . '

'; + echo '

' . esc_html( $title ) . '

'; $url = self_admin_url('update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) )); $url = wp_nonce_url($url, 'bulk-update-plugins'); @@ -146,10 +161,6 @@ 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/plugin.php */ do_action( "activate_{$plugin}" ); @@ -167,8 +178,13 @@ if ( $action ) { } deactivate_plugins( $plugin, false, is_network_admin() ); - if ( ! is_network_admin() ) + + if ( ! is_network_admin() ) { update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) ); + } else { + update_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) ); + } + if ( headers_sent() ) echo ""; else @@ -196,11 +212,15 @@ if ( $action ) { deactivate_plugins( $plugins, false, is_network_admin() ); + $deactivated = array(); + foreach ( $plugins as $plugin ) { + $deactivated[ $plugin ] = time(); + } + if ( ! is_network_admin() ) { - $deactivated = array(); - foreach ( $plugins as $plugin ) - $deactivated[ $plugin ] = time(); update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); + } else { + update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) ); } wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") ); @@ -260,7 +280,7 @@ if ( $action ) { // Get plugins list from that folder. if ( $folder_plugins = get_plugins( '/' . $plugin_slug ) ) { - foreach( $folder_plugins as $plugin_file => $data ) { + foreach ( $folder_plugins as $plugin_file => $data ) { $plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data ); $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); if ( ! $plugin_info[ $plugin_file ]['Network'] ) { @@ -281,23 +301,31 @@ if ( $action ) { } } $plugins_to_delete = count( $plugin_info ); - echo '

' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '

'; ?> - -

+ +

+ +

+ +

+ +

+ +

+ +

-