<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13233] trunk/wp-admin:
Show must-use plugins and drop-ins in the plugins admin panel.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13233">13233</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-02-19 21:16:14 +0000 (Fri, 19 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Show must-use plugins and drop-ins in the plugins admin panel. First pass. See <a href="http://trac.wordpress.org/ticket/11861">#11861</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludespluginphp">trunk/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludespluginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/plugin.php (13232 => 13233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/plugin.php        2010-02-19 20:56:16 UTC (rev 13232)
+++ trunk/wp-admin/includes/plugin.php        2010-02-19 21:16:14 UTC (rev 13233)
</span><span class="lines">@@ -266,6 +266,122 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.
+ *
+ * WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).
+ *
+ * @since 3.0.0
+ * @return array Key is the mu-plugin file path and the value is an array of the mu-plugin data.
+ */
+function get_mu_plugins() {
+        $wp_plugins = array();
+        // Files in wp-content/mu-plugins directory
+        $plugin_files = array();
+
+        if ( ! is_dir( WPMU_PLUGIN_DIR ) )
+                return $wp_plugins;
+        if ( $plugins_dir = @ opendir( WPMU_PLUGIN_DIR ) ) {
+                while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
+                        if ( substr( $file, -4 ) == '.php' )
+                                $plugin_files[] = $file;
+                }
+        }
+
+        @closedir( $plugins_dir );
+
+        if ( !$plugins_dir || empty($plugin_files) )
+                return $wp_plugins;
+
+        foreach ( $plugin_files as $plugin_file ) {
+                if ( !is_readable( WPMU_PLUGIN_DIR . "/$plugin_file" ) )
+                        continue;
+
+                $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
+
+                if ( empty ( $plugin_data['Name'] ) )
+                        $plugin_data['Name'] = $plugin_file;
+
+                $wp_plugins[ $plugin_file ] = $plugin_data;
+        }
+
+        if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php') <= 30 ) // silence is golden
+                unset( $wp_plugins['index.php'] );
+
+        uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
+
+        return $wp_plugins;
+}
+
+/**
+ * Check the wp-content directory and retrieve all drop-ins with any plugin data.
+ *
+ * @since 3.0.0
+ * @return array Key is the file path and the value is an array of the plugin data.
+ */
+function get_dropins() {
+        $dropins = array();
+        $plugin_files = array();
+
+        $_dropins = _get_dropins();
+
+        // These exist in the wp-content directory
+        if ( $plugins_dir = @ opendir( WP_CONTENT_DIR ) ) {
+                while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
+                        if ( isset( $_dropins[ $file ] ) )
+                                $plugin_files[] = $file;
+                        }
+        }
+
+        @closedir( $plugins_dir );
+
+        if ( !$plugins_dir || empty($plugin_files) )
+                        return $dropins;
+
+        foreach ( $plugin_files as $plugin_file ) {
+                        if ( !is_readable( WP_CONTENT_DIR . "/$plugin_file" ) )
+                                        continue;
+                        $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
+                        if ( empty ( $plugin_data['Name'] ) )
+                                $plugin_data['Name'] = $plugin_file;
+                        $dropins[ $plugin_file ] = $plugin_data;
+        }
+
+        uksort( $dropins, create_function( '$a, $b', 'return strnatcasecmp( $a, $b );' ));
+
+        return $dropins;
+}
+
+/**
+ * Returns drop-ins that WordPress uses.
+ *
+ * Includes Multisite drop-ins only when is_multisite()
+ *
+ * @since 3.0.0
+ * @return array Key is file name. The value is an array, with the first value the
+ *        purpose of the drop-in and the second value the name of the constant that must be
+ *        true for the drop-in to be used, or true if no constant is required.
+ */
+function _get_dropins() {
+        $dropins = array(
+                'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE
+                'db.php' => array( __( 'Custom database class.' ), true ), // auto on load
+                'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error
+                'install.php' => array( __( 'Custom install script.' ), true ), // auto on install
+                'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance
+                'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load
+        );
+
+        if ( is_multisite() ) {
+                $dropins['sunrise.php' ] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE
+                $dropins['blog-deleted.php' ] = array( __( 'Custom blog deleted message.' ), true ); // auto on deleted blog
+                $dropins['blog-inactive.php' ] = array( __( 'Custom blog inactive message.' ), true ); // auto on inactive blog
+                $dropins['blog-suspended.php'] = array( __( 'Custom blog suspended message.' ), true ); // auto on archived or spammed blog
+        }
+
+        return $dropins;
+}
+
+/**
</ins><span class="cx"> * Check whether the plugin is active by checking the active_plugins list.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.5.0
</span></span></pre></div>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (13232 => 13233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2010-02-19 20:56:16 UTC (rev 13232)
+++ trunk/wp-admin/plugins.php        2010-02-19 21:16:14 UTC (rev 13233)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> if ( empty($default_status) )
</span><span class="cx">         $default_status = 'all';
</span><span class="cx"> $status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : $default_status;
</span><del>-if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'network', 'search')) )
</del><ins>+if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'network', 'mustuse', 'dropins', 'search')) )
</ins><span class="cx">         $status = 'all';
</span><span class="cx"> if ( $status != $default_status && 'search' != $status )
</span><span class="cx">         update_usermeta($current_user->ID, 'plugins_last_view', $status);
</span><span class="lines">@@ -365,6 +365,8 @@
</span><span class="cx"> $recently_activated = get_option('recently_activated', array());
</span><span class="cx"> $upgrade_plugins = array();
</span><span class="cx"> $network_plugins = array();
</span><ins>+$mustuse_plugins = get_mu_plugins();
+$dropins_plugins = get_dropins();
</ins><span class="cx">
</span><span class="cx"> set_transient( 'plugin_slugs', array_keys($all_plugins), 86400 );
</span><span class="cx">
</span><span class="lines">@@ -376,12 +378,16 @@
</span><span class="cx">         update_option('recently_activated', $recently_activated);
</span><span class="cx"> $current = get_site_transient( 'update_plugins' );
</span><span class="cx">
</span><del>-foreach ( (array)$all_plugins as $plugin_file => $plugin_data) {
</del><ins>+foreach ( array( 'all_plugins', 'mustuse_plugins', 'dropins_plugins' ) as $plugin_array_name) {
+        foreach ( (array) $$plugin_array_name as $plugin_file => $plugin_data ) {
+                // Translate, Apply Markup, Sanitize HTML
+                $plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true);
+                $$plugin_array_name[ $plugin_file ] = $plugin_data;
+        }
+}
+unset( $plugin_array_name );
</ins><span class="cx">
</span><del>-        // Translate, Apply Markup, Sanitize HTML
-        $plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true);
-        $all_plugins[ $plugin_file ] = $plugin_data;
-
</del><ins>+foreach ( (array) $all_plugins as $plugin_file => $plugin_data) {
</ins><span class="cx">         // Filter into individual sections
</span><span class="cx">         if ( is_plugin_active_for_network($plugin_file) && is_super_admin() ) {
</span><span class="cx">                 $network_plugins[ $plugin_file ] = $plugin_data;
</span><span class="lines">@@ -406,6 +412,8 @@
</span><span class="cx"> $total_recent_plugins = count($recent_plugins);
</span><span class="cx"> $total_upgrade_plugins = count($upgrade_plugins);
</span><span class="cx"> $total_network_plugins = count($network_plugins);
</span><ins>+$total_mustuse_plugins = count($mustuse_plugins);
+$total_dropins_plugins = count($dropins_plugins);
</ins><span class="cx">
</span><span class="cx"> //Searching.
</span><span class="cx"> if ( isset($_GET['s']) ) {
</span><span class="lines">@@ -469,11 +477,12 @@
</span><span class="cx"> */
</span><span class="cx"> function print_plugins_table($plugins, $context = '') {
</span><span class="cx">         global $page;
</span><ins>+        $checkbox = ! in_array( $context, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '';
</ins><span class="cx"> ?>
</span><span class="cx"> <table class="widefat" cellspacing="0" id="<?php echo $context ?>-plugins-table">
</span><span class="cx">         <thead>
</span><span class="cx">         <tr>
</span><del>-                <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
</del><ins>+                <th scope="col" class="manage-column check-column"><?php echo $checkbox; ?></th>
</ins><span class="cx">                 <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
</span><span class="cx">                 <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
</span><span class="cx">         </tr>
</span><span class="lines">@@ -481,7 +490,7 @@
</span><span class="cx">
</span><span class="cx">         <tfoot>
</span><span class="cx">         <tr>
</span><del>-                <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
</del><ins>+                <th scope="col" class="manage-column check-column"><?php echo $checkbox; ?></th>
</ins><span class="cx">                 <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
</span><span class="cx">                 <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
</span><span class="cx">         </tr>
</span><span class="lines">@@ -497,43 +506,72 @@
</span><span class="cx">         }
</span><span class="cx">         foreach ( (array)$plugins as $plugin_file => $plugin_data) {
</span><span class="cx">                 $actions = array();
</span><del>-                $is_active_for_network = is_plugin_active_for_network($plugin_file);
-                $is_active = $is_active_for_network || is_plugin_active( $plugin_file );
</del><ins>+                if ( 'mustuse' == $context ) {
+                        $is_active = true;
+                } elseif ( 'dropins' == $context ) {
+                        $dropins = _get_dropins();
+                        $plugin_name = $plugin_file;
+                        if ( $plugin_file != $plugin_data['Name'] )
+                                $plugin_name .= '<br/>' . $plugin_data['Name'];
+                        if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
+                                $is_active = true;
+                                $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+                        } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
+                                $is_active = true;
+                                $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+                        } else {
+                                $is_active = false;
+                                $description = '<strong>' . $dropins[ $plugin_file ][0] . ' <span class="attention">' . __('Inactive:') . '</span></strong> ' . sprintf( __( 'Requires <code>%s</code> in <code>wp-config.php</code>.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '</p>';
+                        }
+                        $description .= '<p>' . $plugin_data['Description'] . '</p>';
+                } else {
+                        $is_active_for_network = is_plugin_active_for_network($plugin_file);
+                        $is_active = $is_active_for_network || is_plugin_active( $plugin_file );
+                        if ( $is_active_for_network && !is_super_admin() )
+                                continue;
</ins><span class="cx">
</span><del>-                if ( $is_active_for_network && !is_super_admin() )
-                        continue;
-
-                if ( $is_active ) {
-                        if ( $is_active_for_network ) {
-                                if ( is_super_admin() )
-                                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
</del><ins>+                        if ( $is_active ) {
+                                if ( $is_active_for_network ) {
+                                        if ( is_super_admin() )
+                                                $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
+                                } else {
+                                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
+                                }
</ins><span class="cx">                         } else {
</span><del>-                                $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
</del><ins>+                                $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
+                                if ( is_multisite() && is_super_admin() )
+                                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
</ins><span class="cx">                         }
</span><del>-                } else {
</del><ins>+
</ins><span class="cx">                         if ( is_multisite() && is_network_only_plugin( $plugin_file ) )
</span><span class="cx">                                 $actions[] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>';
</span><span class="cx">                         else
</span><span class="cx">                                 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
</span><span class="cx">                         if ( is_multisite() && is_super_admin() )
</span><span class="cx">                                 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
</span><del>-                }
</del><span class="cx">
</span><del>-                if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
-                        $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
</del><ins>+                        if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
+                                $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
</ins><span class="cx">
</span><del>-                if ( ! $is_active && current_user_can('delete_plugins') )
-                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
</del><ins>+                        if ( ! $is_active && current_user_can('delete_plugins') )
+                                $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
</ins><span class="cx">
</span><ins>+                }
+
</ins><span class="cx">                 $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
</span><span class="cx">                 $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
</span><del>-                $action_count = count($actions);
</del><ins>+
</ins><span class="cx">                 $class = $is_active ? 'active' : 'inactive';
</span><ins>+                $checkbox = in_array( $context, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' />";
+                if ( 'dropins' != $context ) {
+                        $description = '<p>' . $plugin_data['Description'] . '</p>';
+                        $plugin_name = $plugin_data['Name'];
+                }
</ins><span class="cx">                 echo "
</span><span class="cx">         <tr class='$class'>
</span><del>-                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
-                <td class='plugin-title'><strong>{$plugin_data['Name']}</strong></td>
-                <td class='desc'><p>{$plugin_data['Description']}</p></td>
</del><ins>+                <th scope='row' class='check-column'>$checkbox</th>
+                <td class='plugin-title'><strong>$plugin_name</strong></td>
+                <td class='desc'>$description</td>
</ins><span class="cx">         </tr>
</span><span class="cx">         <tr class='$class second'>
</span><span class="cx">                 <td></td>
</span><span class="lines">@@ -577,6 +615,8 @@
</span><span class="cx"> * @param string $context
</span><span class="cx"> */
</span><span class="cx"> function print_plugin_actions($context, $field_name = 'action' ) {
</span><ins>+        if ( in_array( $context, array( 'mustuse', 'dropins' ) ) )
+                return;
</ins><span class="cx"> ?>
</span><span class="cx">         <div class="alignleft actions">
</span><span class="cx">                 <select name="<?php echo $field_name; ?>">
</span><span class="lines">@@ -642,6 +682,14 @@
</span><span class="cx">         $class = ( 'network' == $status ) ? ' class="current"' : '';
</span><span class="cx">         $status_links[] = "<li><a href='plugins.php?plugin_status=network' $class>" . sprintf( _n( 'Network <span class="count">(%s)</span>', 'Network <span class="count">(%s)</span>', $total_network_plugins ), number_format_i18n( $total_network_plugins ) ) . '</a>';
</span><span class="cx"> }
</span><ins>+if ( ! empty($mustuse_plugins) ) {
+        $class = ( 'mustuse' == $status ) ? ' class="current"' : '';
+        $status_links[] = "<li><a href='plugins.php?plugin_status=mustuse' $class>" . sprintf( _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $total_mustuse_plugins ), number_format_i18n( $total_mustuse_plugins ) ) . '</a>';
+}
+if ( ! empty($dropins_plugins) ) {
+        $class = ( 'dropins' == $status ) ? ' class="current"' : '';
+        $status_links[] = "<li><a href='plugins.php?plugin_status=dropins' $class>" . sprintf( _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $total_dropins_plugins ), number_format_i18n( $total_dropins_plugins ) ) . '</a>';
+}
</ins><span class="cx"> if ( ! empty($upgrade_plugins) ) {
</span><span class="cx">         $class = ( 'upgrade' == $status ) ? ' class="current"' : '';
</span><span class="cx">         $status_links[] = "<li><a href='plugins.php?plugin_status=upgrade' $class>" . sprintf( _n( 'Upgrade Available <span class="count">(%s)</span>', 'Upgrade Available <span class="count">(%s)</span>', $total_upgrade_plugins ), number_format_i18n( $total_upgrade_plugins ) ) . '</a>';
</span><span class="lines">@@ -656,8 +704,14 @@
</span><span class="cx"> ?>
</span><span class="cx"> </ul>
</span><span class="cx">
</span><del>-<?php if ( ! empty( $plugins ) ) { ?>
</del><ins>+<?php
+if ( 'mustuse' == $status )
+        echo '<div class="clear"><p>' . __( 'Files in the <code>wp-content/mu-plugins</code> directory are executed automatically.' ) . '</p>';
+elseif ( 'dropins' == $status )
+        echo '<div class="clear"><p>' . __( 'Drop-ins are advanced plugins in the <code>wp-content</code> directory that replace WordPress functionality when present.' ) . '</p>';
</ins><span class="cx">
</span><ins>+if ( !empty( $plugins ) && ( ! in_array( $status, array( 'mustuse', 'dropins' ) ) || $page_links ) ) :
+?>
</ins><span class="cx"> <div class="tablenav">
</span><span class="cx"> <?php
</span><span class="cx"> if ( $page_links )
</span><span class="lines">@@ -668,10 +722,14 @@
</span><span class="cx"> </div>
</span><span class="cx"> <div class="clear"></div>
</span><span class="cx"> <?php
</span><del>-        if ( $total_this_page > $plugins_per_page )
-                $plugins = array_slice($plugins, $start, $plugins_per_page);
</del><ins>+endif;
</ins><span class="cx">
</span><del>-        print_plugins_table($plugins, $status);
</del><ins>+if ( $total_this_page > $plugins_per_page )
+        $plugins = array_slice($plugins, $start, $plugins_per_page);
+
+print_plugins_table($plugins, $status);
+
+if ( !empty( $plugins ) && ! in_array( $status, array( 'mustuse', 'dropins' ) ) || $page_links ) {
</ins><span class="cx"> ?>
</span><span class="cx"> <div class="tablenav">
</span><span class="cx"> <?php
</span></span></pre>
</div>
</div>
</body>
</html>