]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/includes/class-wp-plugins-list-table.php
WordPress 3.9
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-plugins-list-table.php
1 <?php
2 /**
3  * Plugins List Table class.
4  *
5  * @package WordPress
6  * @subpackage List_Table
7  * @since 3.1.0
8  * @access private
9  */
10 class WP_Plugins_List_Table extends WP_List_Table {
11
12         function __construct( $args = array() ) {
13                 global $status, $page;
14
15                 parent::__construct( array(
16                         'plural' => 'plugins',
17                         'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
18                 ) );
19
20                 $status = 'all';
21                 if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search' ) ) )
22                         $status = $_REQUEST['plugin_status'];
23
24                 if ( isset($_REQUEST['s']) )
25                         $_SERVER['REQUEST_URI'] = add_query_arg('s', wp_unslash($_REQUEST['s']) );
26
27                 $page = $this->get_pagenum();
28         }
29
30         function get_table_classes() {
31                 return array( 'widefat', $this->_args['plural'] );
32         }
33
34         function ajax_user_can() {
35                 return current_user_can('activate_plugins');
36         }
37
38         function prepare_items() {
39                 global $status, $plugins, $totals, $page, $orderby, $order, $s;
40
41                 wp_reset_vars( array( 'orderby', 'order', 's' ) );
42
43                 /**
44                  * Filter the full array of plugins to list in the Plugins list table.
45                  *
46                  * @since 3.0.0
47                  *
48                  * @see get_plugins()
49                  *
50                  * @param array $plugins An array of plugins to display in the list table.
51                  */
52                 $plugins = array(
53                         'all' => apply_filters( 'all_plugins', get_plugins() ),
54                         'search' => array(),
55                         'active' => array(),
56                         'inactive' => array(),
57                         'recently_activated' => array(),
58                         'upgrade' => array(),
59                         'mustuse' => array(),
60                         'dropins' => array()
61                 );
62
63                 $screen = $this->screen;
64
65                 if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) {
66
67                         /**
68                          * Filter whether to display the advanced plugins list table.
69                          *
70                          * There are two types of advanced plugins - must-use and drop-ins -
71                          * which can be used in a single site or Multisite network.
72                          *
73                          * The $type parameter allows you to differentiate between the type of advanced
74                          * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.
75                          *
76                          * @since 3.0.0
77                          *
78                          * @param bool   $show Whether to show the advanced plugins for the specified
79                          *                     plugin type. Default true.
80                          * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.
81                          */
82                         if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {
83                                 $plugins['mustuse'] = get_mu_plugins();
84                         }
85
86                         /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
87                         if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
88                                 $plugins['dropins'] = get_dropins();
89
90                         if ( current_user_can( 'update_plugins' ) ) {
91                                 $current = get_site_transient( 'update_plugins' );
92                                 foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
93                                         if ( isset( $current->response[ $plugin_file ] ) ) {
94                                                 $plugins['all'][ $plugin_file ]['update'] = true;
95                                                 $plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
96                                         }
97                                 }
98                         }
99                 }
100
101                 set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
102
103                 if ( ! $screen->in_admin( 'network' ) ) {
104                         $recently_activated = get_option( 'recently_activated', array() );
105
106                         foreach ( $recently_activated as $key => $time )
107                                 if ( $time + WEEK_IN_SECONDS < time() )
108                                         unset( $recently_activated[$key] );
109                         update_option( 'recently_activated', $recently_activated );
110                 }
111
112                 foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
113                         // Filter into individual sections
114                         if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) {
115                                 // On the non-network screen, filter out network-only plugins as long as they're not individually activated
116                                 unset( $plugins['all'][ $plugin_file ] );
117                         } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {
118                                 // On the non-network screen, filter out network activated plugins
119                                 unset( $plugins['all'][ $plugin_file ] );
120                         } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
121                                 || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {
122                                 // On the non-network screen, populate the active list with plugins that are individually activated
123                                 // On the network-admin screen, populate the active list with plugins that are network activated
124                                 $plugins['active'][ $plugin_file ] = $plugin_data;
125                         } else {
126                                 if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) {
127                                         // On the non-network screen, populate the recently activated list with plugins that have been recently activated
128                                         $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
129                                 }
130                                 // Populate the inactive list with plugins that aren't activated
131                                 $plugins['inactive'][ $plugin_file ] = $plugin_data;
132                         }
133                 }
134
135                 if ( $s ) {
136                         $status = 'search';
137                         $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
138                 }
139
140                 $totals = array();
141                 foreach ( $plugins as $type => $list )
142                         $totals[ $type ] = count( $list );
143
144                 if ( empty( $plugins[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
145                         $status = 'all';
146
147                 $this->items = array();
148                 foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {
149                         // Translate, Don't Apply Markup, Sanitize HTML
150                         $this->items[$plugin_file] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
151                 }
152
153                 $total_this_page = $totals[ $status ];
154
155                 if ( $orderby ) {
156                         $orderby = ucfirst( $orderby );
157                         $order = strtoupper( $order );
158
159                         uasort( $this->items, array( $this, '_order_callback' ) );
160                 }
161
162                 $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );
163
164                 $start = ( $page - 1 ) * $plugins_per_page;
165
166                 if ( $total_this_page > $plugins_per_page )
167                         $this->items = array_slice( $this->items, $start, $plugins_per_page );
168
169                 $this->set_pagination_args( array(
170                         'total_items' => $total_this_page,
171                         'per_page' => $plugins_per_page,
172                 ) );
173         }
174
175         function _search_callback( $plugin ) {
176                 static $term;
177                 if ( is_null( $term ) )
178                         $term = wp_unslash( $_REQUEST['s'] );
179
180                 foreach ( $plugin as $value ) {
181                         if ( false !== stripos( strip_tags( $value ), $term ) ) {
182                                 return true;
183                         }
184                 }
185
186                 return false;
187         }
188
189         function _order_callback( $plugin_a, $plugin_b ) {
190                 global $orderby, $order;
191
192                 $a = $plugin_a[$orderby];
193                 $b = $plugin_b[$orderby];
194
195                 if ( $a == $b )
196                         return 0;
197
198                 if ( 'DESC' == $order )
199                         return ( $a < $b ) ? 1 : -1;
200                 else
201                         return ( $a < $b ) ? -1 : 1;
202         }
203
204         function no_items() {
205                 global $plugins;
206
207                 if ( !empty( $plugins['all'] ) )
208                         _e( 'No plugins found.' );
209                 else
210                         _e( 'You do not appear to have any plugins available at this time.' );
211         }
212
213         function get_columns() {
214                 global $status;
215
216                 return array(
217                         'cb'          => !in_array( $status, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '',
218                         'name'        => __( 'Plugin' ),
219                         'description' => __( 'Description' ),
220                 );
221         }
222
223         function get_sortable_columns() {
224                 return array();
225         }
226
227         function get_views() {
228                 global $totals, $status;
229
230                 $status_links = array();
231                 foreach ( $totals as $type => $count ) {
232                         if ( !$count )
233                                 continue;
234
235                         switch ( $type ) {
236                                 case 'all':
237                                         $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
238                                         break;
239                                 case 'active':
240                                         $text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
241                                         break;
242                                 case 'recently_activated':
243                                         $text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
244                                         break;
245                                 case 'inactive':
246                                         $text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
247                                         break;
248                                 case 'mustuse':
249                                         $text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
250                                         break;
251                                 case 'dropins':
252                                         $text = _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
253                                         break;
254                                 case 'upgrade':
255                                         $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
256                                         break;
257                         }
258
259                         if ( 'search' != $type ) {
260                                 $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
261                                         add_query_arg('plugin_status', $type, 'plugins.php'),
262                                         ( $type == $status ) ? ' class="current"' : '',
263                                         sprintf( $text, number_format_i18n( $count ) )
264                                         );
265                         }
266                 }
267
268                 return $status_links;
269         }
270
271         function get_bulk_actions() {
272                 global $status;
273
274                 $actions = array();
275
276                 if ( 'active' != $status )
277                         $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
278
279                 if ( 'inactive' != $status && 'recent' != $status )
280                         $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
281
282                 if ( !is_multisite() || $this->screen->in_admin( 'network' ) ) {
283                         if ( current_user_can( 'update_plugins' ) )
284                                 $actions['update-selected'] = __( 'Update' );
285                         if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
286                                 $actions['delete-selected'] = __( 'Delete' );
287                 }
288
289                 return $actions;
290         }
291
292         function bulk_actions() {
293                 global $status;
294
295                 if ( in_array( $status, array( 'mustuse', 'dropins' ) ) )
296                         return;
297
298                 parent::bulk_actions();
299         }
300
301         function extra_tablenav( $which ) {
302                 global $status;
303
304                 if ( ! in_array($status, array('recently_activated', 'mustuse', 'dropins') ) )
305                         return;
306
307                 echo '<div class="alignleft actions">';
308
309                 if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status )
310                         submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false );
311                 elseif ( 'top' == $which && 'mustuse' == $status )
312                         echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>';
313                 elseif ( 'top' == $which && 'dropins' == $status )
314                         echo '<p>' . sprintf( __( 'Drop-ins are advanced plugins in the <code>%s</code> directory that replace WordPress functionality when present.' ), str_replace( ABSPATH, '', WP_CONTENT_DIR ) ) . '</p>';
315
316                 echo '</div>';
317         }
318
319         function current_action() {
320                 if ( isset($_POST['clear-recent-list']) )
321                         return 'clear-recent-list';
322
323                 return parent::current_action();
324         }
325
326         function display_rows() {
327                 global $status;
328
329                 if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) )
330                         return;
331
332                 foreach ( $this->items as $plugin_file => $plugin_data )
333                         $this->single_row( array( $plugin_file, $plugin_data ) );
334         }
335
336         function single_row( $item ) {
337                 global $status, $page, $s, $totals;
338
339                 list( $plugin_file, $plugin_data ) = $item;
340                 $context = $status;
341                 $screen = $this->screen;
342
343                 // preorder
344                 $actions = array(
345                         'deactivate' => '',
346                         'activate' => '',
347                         'edit' => '',
348                         'delete' => '',
349                 );
350
351                 if ( 'mustuse' == $context ) {
352                         $is_active = true;
353                 } elseif ( 'dropins' == $context ) {
354                         $dropins = _get_dropins();
355                         $plugin_name = $plugin_file;
356                         if ( $plugin_file != $plugin_data['Name'] )
357                                 $plugin_name .= '<br/>' . $plugin_data['Name'];
358                         if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
359                                 $is_active = true;
360                                 $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
361                         } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
362                                 $is_active = true;
363                                 $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
364                         } else {
365                                 $is_active = false;
366                                 $description = '<p><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>';
367                         }
368                         if ( $plugin_data['Description'] )
369                                 $description .= '<p>' . $plugin_data['Description'] . '</p>';
370                 } else {
371                         if ( $screen->in_admin( 'network' ) )
372                                 $is_active = is_plugin_active_for_network( $plugin_file );
373                         else
374                                 $is_active = is_plugin_active( $plugin_file );
375
376                         if ( $screen->in_admin( 'network' ) ) {
377                                 if ( $is_active ) {
378                                         if ( current_user_can( 'manage_network_plugins' ) )
379                                                 $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
380                                 } else {
381                                         if ( current_user_can( 'manage_network_plugins' ) )
382                                                 $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
383                                         if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
384                                                 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
385                                 }
386                         } else {
387                                 if ( $is_active ) {
388                                         $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
389                                 } else {
390                                         $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
391
392                                         if ( ! is_multisite() && current_user_can('delete_plugins') )
393                                                 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
394                                 } // end if $is_active
395                          } // end if $screen->in_admin( 'network' )
396
397                         if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
398                                 $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
399                 } // end if $context
400
401                 $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : '';
402
403                 /**
404                  * Filter the action links displayed for each plugin in the Plugins list table.
405                  *
406                  * The dynamic portion of the hook name, $prefix, refers to the context the
407                  * action links are displayed in. The 'network_admin_' prefix is used if the
408                  * current screen is the Network plugins list table. The prefix is empty ('')
409                  * if the current screen is the site plugins list table.
410                  *
411                  * The default action links for the Network plugins list table include
412                  * 'Network Activate', 'Network Deactivate', 'Edit', and 'Delete'.
413                  *
414                  * The default action links for the site plugins list table include
415                  * 'Activate', 'Deactivate', and 'Edit', for a network site, and
416                  * 'Activate', 'Deactivate', 'Edit', and 'Delete' for a single site.
417                  *
418                  * @since 2.5.0
419                  *
420                  * @param array  $actions     An array of plugin action links.
421                  * @param string $plugin_file Path to the plugin file.
422                  * @param array  $plugin_data An array of plugin data.
423                  * @param string $context     The plugin context. Defaults are 'All', 'Active',
424                  *                            'Inactive', 'Recently Activated', 'Upgrade',
425                  *                            'Must-Use', 'Drop-ins', 'Search'.
426                  */
427                 $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
428
429                 /**
430                  * Filter the list of action links displayed for a specific plugin.
431                  *
432                  * The first dynamic portion of the hook name, $prefix, refers to the context
433                  * the action links are displayed in. The 'network_admin_' prefix is used if the
434                  * current screen is the Network plugins list table. The prefix is empty ('')
435                  * if the current screen is the site plugins list table.
436                  *
437                  * The second dynamic portion of the hook name, $plugin_file, refers to the path
438                  * to the plugin file, relative to the plugins directory.
439                  *
440                  * @since 2.7.0
441                  *
442                  * @param array  $actions     An array of plugin action links.
443                  * @param string $plugin_file Path to the plugin file.
444                  * @param array  $plugin_data An array of plugin data.
445                  * @param string $context     The plugin context. Defaults are 'All', 'Active',
446                  *                            'Inactive', 'Recently Activated', 'Upgrade',
447                  *                            'Must-Use', 'Drop-ins', 'Search'.
448                  */
449                 $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
450
451                 $class = $is_active ? 'active' : 'inactive';
452                 $checkbox_id =  "checkbox_" . md5($plugin_data['Name']);
453                 if ( in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
454                         $checkbox = '';
455                 } else {
456                         $checkbox = "<label class='screen-reader-text' for='" . $checkbox_id . "' >" . sprintf( __( 'Select %s' ), $plugin_data['Name'] ) . "</label>"
457                                 . "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' />";
458                 }
459                 if ( 'dropins' != $context ) {
460                         $description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
461                         $plugin_name = $plugin_data['Name'];
462                 }
463
464                 $id = sanitize_title( $plugin_name );
465                 if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) )
466                         $class .= ' update';
467
468                 echo "<tr id='$id' class='$class'>";
469
470                 list( $columns, $hidden ) = $this->get_column_info();
471
472                 foreach ( $columns as $column_name => $column_display_name ) {
473                         $style = '';
474                         if ( in_array( $column_name, $hidden ) )
475                                 $style = ' style="display:none;"';
476
477                         switch ( $column_name ) {
478                                 case 'cb':
479                                         echo "<th scope='row' class='check-column'>$checkbox</th>";
480                                         break;
481                                 case 'name':
482                                         echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
483                                         echo $this->row_actions( $actions, true );
484                                         echo "</td>";
485                                         break;
486                                 case 'description':
487                                         echo "<td class='column-description desc'$style>
488                                                 <div class='plugin-description'>$description</div>
489                                                 <div class='$class second plugin-version-author-uri'>";
490
491                                         $plugin_meta = array();
492                                         if ( !empty( $plugin_data['Version'] ) )
493                                                 $plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
494                                         if ( !empty( $plugin_data['Author'] ) ) {
495                                                 $author = $plugin_data['Author'];
496                                                 if ( !empty( $plugin_data['AuthorURI'] ) )
497                                                         $author = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . esc_attr__( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
498                                                 $plugin_meta[] = sprintf( __( 'By %s' ), $author );
499                                         }
500                                         if ( ! empty( $plugin_data['PluginURI'] ) )
501                                                 $plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin site' ) . '">' . __( 'Visit plugin site' ) . '</a>';
502
503                                         /**
504                                          * Filter the array of row meta for each plugin in the Plugins list table.
505                                          *
506                                          * @since 2.8.0
507                                          *
508                                          * @param array  $plugin_meta An array of the plugin's metadata,
509                                          *                            including the version, author,
510                                          *                            author URI, and plugin URI.
511                                          * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
512                                          * @param array  $plugin_data An array of plugin data.
513                                          * @param string $status      Status of the plugin. Defaults are 'All', 'Active',
514                                          *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
515                                          *                            'Drop-ins', 'Search'.
516                                          */
517                                         $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
518                                         echo implode( ' | ', $plugin_meta );
519
520                                         echo "</div></td>";
521                                         break;
522                                 default:
523                                         echo "<td class='$column_name column-$column_name'$style>";
524
525                                         /**
526                                          * Fires inside each custom column of the Plugins list table.
527                                          *
528                                          * @since 3.1.0
529                                          *
530                                          * @param string $column_name Name of the column.
531                                          * @param string $plugin_file Path to the plugin file.
532                                          * @param array  $plugin_data An array of plugin data.
533                                          */
534                                         do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
535                                         echo "</td>";
536                         }
537                 }
538
539                 echo "</tr>";
540
541                 /**
542                  * Fires after each row in the Plugins list table.
543                  *
544                  * @since 2.3.0
545                  *
546                  * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
547                  * @param array  $plugin_data An array of plugin data.
548                  * @param string $status      Status of the plugin. Defaults are 'All', 'Active',
549                  *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
550                  *                            'Drop-ins', 'Search'.
551                  */
552                 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
553
554                 /**
555                  * Fires after each specific row in the Plugins list table.
556                  *
557                  * The dynamic portion of the hook name, $plugin_file, refers to the path
558                  * to the plugin file, relative to the plugins directory.
559                  *
560                  * @since 2.7.0
561                  *
562                  * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
563                  * @param array  $plugin_data An array of plugin data.
564                  * @param string $status      Status of the plugin. Defaults are 'All', 'Active',
565                  *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
566                  *                            'Drop-ins', 'Search'.
567                  */
568                 do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
569         }
570 }