diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 2652c7d7b3..7899d5882b 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -28,9 +28,9 @@ if( !empty($action) ) { check_admin_referer('activate-plugin_' . $plugin); $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin); if ( is_wp_error( $result ) ) - wp_die( $result->get_error_message() ); + wp_die($result); $recent = (array)get_option('recently_activated'); - if( isset($recent[ $plugin ]) ){ + if ( isset($recent[ $plugin ]) ) { unset($recent[ $plugin ]); update_option('recently_activated', $recent); } @@ -43,7 +43,7 @@ if( !empty($action) ) { $recent = (array)get_option('recently_activated'); foreach( (array)$_POST['checked'] as $plugin => $time) { - if( isset($recent[ $plugin ]) ) + if ( isset($recent[ $plugin ]) ) unset($recent[ $plugin ]); } if( $recent != get_option('recently_activated') ) //If array changed, update it. @@ -59,7 +59,9 @@ if( !empty($action) ) { wp_die($valid); error_reporting( E_ALL ^ E_NOTICE ); @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. - include(WP_PLUGIN_DIR . '/' . $plugin); + $result = activate_plugin($plugin, false); + if ( is_wp_error( $result ) ) + wp_die($result); exit; break; case 'deactivate': @@ -73,14 +75,14 @@ if( !empty($action) ) { check_admin_referer('bulk-manage-plugins'); deactivate_plugins($_POST['checked']); $deactivated = array(); - foreach( (array)$_POST['checked'] as $plugin ) + foreach ( (array)$_POST['checked'] as $plugin ) $deactivated[ $plugin ] = time(); update_option('recently_activated', $deactivated + (array)get_option('recently_activated')); wp_redirect('plugins.php?deactivate-multi=true'); exit; break; case 'delete-selected': - if( ! current_user_can('delete_plugins') ) + if ( ! current_user_can('delete_plugins') ) wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); check_admin_referer('bulk-manage-plugins'); @@ -91,7 +93,7 @@ if( !empty($action) ) { $title = __('Delete Plugin'); $parent_file = 'plugins.php'; - if( ! isset($_REQUEST['verify-delete']) ) { + if ( ! isset($_REQUEST['verify-delete']) ) { wp_enqueue_script('jquery'); require_once('admin-header.php'); ?> @@ -99,8 +101,8 @@ if( !empty($action) ) {

@@ -130,7 +132,7 @@ if( !empty($action) ) { '; ?> @@ -144,7 +146,7 @@ if( !empty($action) ) {