Index: update-core.php
===================================================================
--- update-core.php	(revision 43431)
+++ update-core.php	(working copy)
@@ -262,6 +262,21 @@
 	<tbody class="plugins">
 	<?php
 	foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
+		$actions = get_plugin_actions( $plugin_file );
+		$action_count = count( $actions );
+		$i = 0;
+
+		if ( !$action_count )
+			return '';
+
+		$action_links = '<div class="row-actions visible">';
+		foreach ( $actions as $action => $link ) {
+			++$i;
+			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+			$action_links .= "<span class='$action'>$link$sep</span>";
+		}
+		$action_links .= '</div>';
+
 		$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
 
 		$icon            = '<span class="dashicons dashicons-admin-plugins"></span>';
@@ -350,6 +365,201 @@
 	<?php
 }
 
+function get_plugin_actions( $plugin_file ) {
+	global $status;
+
+	$args = wp_parse_args( $args, array(
+			'plural' => '',
+			'singular' => '',
+			'ajax' => false,
+			'screen' => null,
+	) );
+
+	$screen = convert_to_screen( $args[ 'screen' ] );
+	$context = $status;
+	// Do not restrict by default
+	$restrict_network_active = false;
+	$restrict_network_only = false;
+
+	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 ( defined( $dropins[ $plugin_file ][1] ) && 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 = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="error-message">' . __( 'Inactive:' ) . '</span></strong> ' .
+				/* translators: 1: drop-in constant name, 2: wp-config.php */
+				sprintf( __( 'Requires %1$s in %2$s file.' ),
+					"<code>define('" . $dropins[ $plugin_file ][1] . "', true);</code>",
+					'<code>wp-config.php</code>'
+				) . '</p>';
+		}
+
+		if ( $plugin_data[ 'Description' ] )
+			$description .= '<p>' . $plugin_data[ 'Description' ] . '</p>';
+	} else {
+
+		if ( $screen->in_admin( 'network' ) ) {
+			$is_active = is_plugin_active_for_network( $plugin_file );
+		} else {
+			$is_active = is_plugin_active( $plugin_file );
+			$restrict_network_active = ( is_multisite() && is_plugin_active_for_network( $plugin_file ) );
+			$restrict_network_only = ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! $is_active );
+		}
+
+		if ( $screen->in_admin( 'network' ) ) {
+			if ( $is_active ) {
+				if ( current_user_can( 'manage_network_plugins' ) ) {
+					/* translators: %s: plugin name */
+					$actions[ 'deactivate' ] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Deactivate' ) . '</a>';
+					}
+			} else {
+				if ( current_user_can( 'manage_network_plugins' ) ) {
+					$button_text  = __( 'Activate' );
+					/* translators: %s: Plugin name */
+					$button_label = _x( 'Activate %s', 'plugin' );
+					$activate_url = add_query_arg( array(
+						'_wpnonce'    => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
+						'action'      => 'activate',
+						'plugin'      => $status['file'],
+					), network_admin_url( 'plugins.php' ) );
+
+					if ( is_network_admin() ) {
+						$button_text  = __( 'Network Activate' );
+						/* translators: %s: Plugin name */
+						$button_label = _x( 'Network Activate %s', 'plugin' );
+						$activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
+					}
+
+					$actions['deactivate'] = sprintf(
+						'<a href="%1$s" class="button activate-now" aria-label="%2$s">%3$s</a>',
+						esc_url( $activate_url ),
+						esc_attr( sprintf( $button_label, $plugin['name'] ) ),
+						$button_text
+					);
+				}
+				if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {
+					/* translators: %s: plugin name */
+					$actions[ 'delete' ] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&amp;checked[]=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
+				}
+			}
+		} else {
+			if ( $restrict_network_active ) {
+				$actions = array(
+					'network_active' => __( 'Network Active' ),
+				);
+			} elseif ( $restrict_network_only ) {
+				$actions = array(
+					'network_only' => __( 'Network Only' ),
+				);
+			} elseif ( $is_active ) {
+				if ( current_user_can( 'deactivate_plugin', $plugin_file ) ) {
+					/* translators: %s: plugin name */
+					$actions[ 'deactivate' ] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
+				}
+			} else {
+				if ( current_user_can( 'activate_plugin', $plugin_file ) ) {
+					/* translators: %s: plugin name */
+					$actions[ 'activate' ] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Activate' ) . '</a>';
+				}
+
+				if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
+					/* translators: %s: plugin name */
+					$actions[ 'delete' ] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&amp;checked[]=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
+				}
+			} // end if $is_active
+
+		} // end if $screen->in_admin( 'network' )
+
+	} // end if $context
+
+	$actions = array_filter( $actions );
+
+	if ( $screen->in_admin( 'network' ) ) {
+
+		/**
+		 * Filters the action links displayed for each plugin in the Network Admin Plugins list table.
+		 *
+		 * @since 3.1.0
+		 *
+		 * @param array  $actions     An array of plugin action links. By default this can include 'activate',
+		 *                            'deactivate', and 'delete'.
+		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+		 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`.
+		 * @param string $context     The plugin context. By default this can include 'all', 'active', 'inactive',
+		 *                            'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+		 */
+		$actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
+
+		/**
+		 * Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table.
+		 *
+		 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
+		 * to the plugin file, relative to the plugins directory.
+		 *
+		 * @since 3.1.0
+		 *
+		 * @param array  $actions     An array of plugin action links. By default this can include 'activate',
+		 *                            'deactivate', and 'delete'.
+		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+		 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`.
+		 * @param string $context     The plugin context. By default this can include 'all', 'active', 'inactive',
+		 *                            'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+		 */
+		$actions = apply_filters( "network_admin_plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
+
+	} else {
+
+		/**
+		 * Filters the action links displayed for each plugin in the Plugins list table.
+		 *
+		 * @since 2.5.0
+		 * @since 2.6.0 The `$context` parameter was added.
+		 * @since 4.9.0 The 'Edit' link was removed from the list of action links.
+		 *
+		 * @param array  $actions     An array of plugin action links. By default this can include 'activate',
+		 *                            'deactivate', and 'delete'. With Multisite active this can also include
+		 *                            'network_active' and 'network_only' items.
+		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+		 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`.
+		 * @param string $context     The plugin context. By default this can include 'all', 'active', 'inactive',
+		 *                            'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+		 */
+		$actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
+
+		/**
+		 * Filters the list of action links displayed for a specific plugin in the Plugins list table.
+		 *
+		 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
+		 * to the plugin file, relative to the plugins directory.
+		 *
+		 * @since 2.7.0
+		 * @since 4.9.0 The 'Edit' link was removed from the list of action links.
+		 *
+		 * @param array  $actions     An array of plugin action links. By default this can include 'activate',
+		 *                            'deactivate', and 'delete'. With Multisite active this can also include
+		 *                            'network_active' and 'network_only' items.
+		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+		 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`.
+		 * @param string $context     The plugin context. By default this can include 'all', 'active', 'inactive',
+		 *                            'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+		 */
+		$actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
+
+	}
+
+	return $actions;
+}
 /**
  * @since 2.9.0
  */
