-$all_plugins = get_plugins();
-$active_plugins = array();
-$inactive_plugins = array();
-$recent_plugins = array();
-$recently_activated = (array)get_option('recently_activated');
-
-//Clean out any plugins which were deactivated over a week ago.
-foreach( $recently_activated as $key => $time )
- if( $time + (7*24*60*60) < time() ) //1 week
- unset($recently_activated[ $key ]);
-if( $recently_activated != get_option('recently_activated') ) //If array changed, update it.
- update_option('recently_activated', $recently_activated);
-
-$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
-
-foreach( (array)$all_plugins as $plugin_file => $plugin_data) {
-
- // Sanitize all displayed data
- $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags);
- $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags);
- $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
- $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags);
- if( ! empty($plugin_data['Author']) )
- $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
-
- //Filter into individual sections
- if ( is_plugin_active($plugin_file) ) {
- $active_plugins[ $plugin_file ] = $plugin_data;
- } else {
- if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated?
- $recent_plugins[ $plugin_file ] = $plugin_data;
- else
- $inactive_plugins[ $plugin_file ] = $plugin_data;
- }
-}
-
-?>
-
-<?php
-function print_plugins_table($plugins, $context = '') {
-?>
-<table class="widefat" id="<?php echo $context ?>-plugins-table">
- <thead>
- <tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"><?php _e('Plugin'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col"><?php _e('Description'); ?></th>
- <th scope="col" class="action-links"><?php _e('Action'); ?></th>
- </tr>
- </thead>
- <tbody class="plugins">