diff --git src/wp-admin/includes/class-wp-plugin-install-list-table.php src/wp-admin/includes/class-wp-plugin-install-list-table.php
index 69f8aa2..22d65eb 100644
|
|
class WP_Plugin_Install_List_Table extends WP_List_Table { |
416 | 416 | break; |
417 | 417 | case 'latest_installed': |
418 | 418 | case 'newer_installed': |
419 | | $action_links[] = '<span class="button button-disabled" title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . _x( 'Installed', 'plugin' ) . '</span>'; |
| 419 | $plugins = get_plugins( '/' . $plugin['slug'] ); |
| 420 | if ( ! empty( $plugins ) ) { |
| 421 | $keys = array_keys( $plugins ); |
| 422 | $plugin_file = $plugin['slug'] . '/' . $keys[0]; |
| 423 | } |
| 424 | if ( ! is_plugin_active( $plugin_file ) ) { |
| 425 | $args = array(); |
| 426 | if ( isset( $_REQUEST['tab'] ) ) { |
| 427 | $args['tab'] = $_REQUEST['tab']; |
| 428 | } |
| 429 | if ( isset( $_REQUEST['s'] ) ) { |
| 430 | $args['s'] = $_REQUEST['s']; |
| 431 | } |
| 432 | $action_links[] = '<a class="button" href="' . wp_nonce_url( add_query_arg( $args, 'plugins.php?action=activate&plugin=' . $plugin_file . '&from=plugin-install' ), 'activate-plugin_' . $plugin_file ) . '" title="' . esc_attr__( 'Activate this plugin' ) . '" target="_parent">' . _x( 'Activate', 'plugin' ) . '</a>'; |
| 433 | } else { |
| 434 | $action_links[] = '<span class="button button-disabled" title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . _x( 'Installed', 'plugin' ) . '</span>'; |
| 435 | } |
420 | 436 | break; |
421 | 437 | } |
422 | 438 | } |
diff --git src/wp-admin/plugins.php src/wp-admin/plugins.php
index 29bca4a..57dd595 100644
|
|
if ( $action ) { |
56 | 56 | |
57 | 57 | if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { |
58 | 58 | wp_redirect( self_admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix |
| 59 | } else if ( isset( $_GET['from'] ) && 'plugin-install' == $_GET['from'] ) { |
| 60 | $args = array(); |
| 61 | if ( isset( $_REQUEST['tab'] ) ) { |
| 62 | $args['tab'] = $_REQUEST['tab']; |
| 63 | } |
| 64 | if ( ! empty( $s ) ) { |
| 65 | $args['s'] = $s; |
| 66 | } |
| 67 | wp_redirect( self_admin_url( add_query_arg( $args, "plugin-install.php" ) ) ); |
59 | 68 | } else { |
60 | 69 | wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above |
61 | 70 | } |