Title: Plugin_Installer_Skin::after
Published: April 25, 2014
Last modified: May 20, 2026

---

# Plugin_Installer_Skin::after()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#wp--skip-link--target)

Performs an action following a plugin install.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#source)󠁿

    ```php
    public function after() {
    	// Check if the plugin can be overwritten and output the HTML.
    	if ( $this->do_overwrite() ) {
    		return;
    	}

    	$plugin_file = $this->upgrader->plugin_info();

    	$install_actions = array();

    	$from = isset( $_GET['from'] ) ? wp_unslash( $_GET['from'] ) : 'plugins';

    	if ( 'import' === $from ) {
    		$install_actions['activate_plugin'] = sprintf(
    			'<a class="button button-primary" href="%s" target="_parent">%s</a>',
    			wp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
    			__( 'Activate Plugin &amp; Run Importer' )
    		);
    	} elseif ( 'press-this' === $from ) {
    		$install_actions['activate_plugin'] = sprintf(
    			'<a class="button button-primary" href="%s" target="_parent">%s</a>',
    			wp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
    			__( 'Activate Plugin &amp; Go to Press This' )
    		);
    	} else {
    		$install_actions['activate_plugin'] = sprintf(
    			'<a class="button button-primary" href="%s" target="_parent">%s</a>',
    			wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
    			__( 'Activate Plugin' )
    		);
    	}

    	if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
    		$install_actions['network_activate'] = sprintf(
    			'<a class="button button-primary" href="%s" target="_parent">%s</a>',
    			wp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
    			_x( 'Network Activate', 'plugin' )
    		);
    		unset( $install_actions['activate_plugin'] );
    	}

    	if ( 'import' === $from ) {
    		$install_actions['importers_page'] = sprintf(
    			'<a href="%s" target="_parent">%s</a>',
    			admin_url( 'import.php' ),
    			__( 'Go to Importers' )
    		);
    	} elseif ( 'web' === $this->type ) {
    		$install_actions['plugins_page'] = sprintf(
    			'<a href="%s" target="_parent">%s</a>',
    			self_admin_url( 'plugin-install.php' ),
    			__( 'Go to Plugin Installer' )
    		);
    	} elseif ( 'upload' === $this->type && 'plugins' === $from ) {
    		$install_actions['plugins_page'] = sprintf(
    			'<a href="%s">%s</a>',
    			self_admin_url( 'plugin-install.php' ),
    			__( 'Go to Plugin Installer' )
    		);
    	} else {
    		$install_actions['plugins_page'] = sprintf(
    			'<a href="%s" target="_parent">%s</a>',
    			self_admin_url( 'plugins.php' ),
    			__( 'Go to Plugins page' )
    		);
    	}

    	if ( ! $this->result || is_wp_error( $this->result ) ) {
    		unset( $install_actions['activate_plugin'], $install_actions['network_activate'] );
    	} elseif ( ! current_user_can( 'activate_plugin', $plugin_file ) || is_plugin_active( $plugin_file ) ) {
    		unset( $install_actions['activate_plugin'] );
    	}

    	/**
    	 * Filters the list of action links available following a single plugin installation.
    	 *
    	 * @since 2.7.0
    	 *
    	 * @param string[] $install_actions Array of plugin action links.
    	 * @param object   $api             Object containing WordPress.org API plugin data. Empty
    	 *                                  for non-API installs, such as when a plugin is installed
    	 *                                  via upload.
    	 * @param string   $plugin_file     Path to the plugin file relative to the plugins directory.
    	 */
    	$install_actions = apply_filters( 'install_plugin_complete_actions', $install_actions, $this->api, $plugin_file );

    	if ( ! empty( $install_actions ) ) {
    		$this->feedback( implode( ' ', (array) $install_actions ) );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-plugin-installer-skin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-plugin-installer-skin.php#L94)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-plugin-installer-skin.php#L94-L183)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#hooks)󠁿

 [apply_filters( ‘install_plugin_complete_actions’, string[] $install_actions, object $api, string $plugin_file )](https://developer.wordpress.org/reference/hooks/install_plugin_complete_actions/)

Filters the list of action links available following a single plugin installation.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#related)󠁿

| Uses | Description | 
| [Plugin_Installer_Skin::do_overwrite()](https://developer.wordpress.org/reference/classes/plugin_installer_skin/do_overwrite/)`wp-admin/includes/class-plugin-installer-skin.php` |

Checks if the plugin can be overwritten and outputs the HTML for overwriting a plugin on upload.

  | 
| [is_plugin_active()](https://developer.wordpress.org/reference/functions/is_plugin_active/)`wp-admin/includes/plugin.php` |

Determines whether a plugin is active.

  | 
| [self_admin_url()](https://developer.wordpress.org/reference/functions/self_admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for either the current site or the network depending on context.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [wp_unslash()](https://developer.wordpress.org/reference/functions/wp_unslash/)`wp-includes/formatting.php` |

Removes slashes from a string or recursively removes slashes from strings within an array.

  | 
| [is_multisite()](https://developer.wordpress.org/reference/functions/is_multisite/)`wp-includes/load.php` |

Determines whether Multisite is enabled.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  | 
| [admin_url()](https://developer.wordpress.org/reference/functions/admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for the current site.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

[Show 9 more](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/plugin_installer_skin/after/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fplugin_installer_skin%2Fafter%2F)
before being able to contribute a note or feedback.