Title: WP_REST_Plugins_Controller::get_plugin_status
Published: August 11, 2020
Last modified: February 24, 2026

---

# WP_REST_Plugins_Controller::get_plugin_status( string $plugin ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#changelog)

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

Get’s the activation status for a plugin.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#parameters)󠁿

 `$plugin`stringrequired

The plugin file to check.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/get_plugin_status/?output_format=md#return)󠁿

 string Either `'network-active'`, `'active'` or `'inactive'`.

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

    ```php
    protected function get_plugin_status( $plugin ) {
    	if ( is_plugin_active_for_network( $plugin ) ) {
    		return 'network-active';
    	}

    	if ( is_plugin_active( $plugin ) ) {
    		return 'active';
    	}

    	return 'inactive';
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php#L674)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php#L674-L684)

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

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

Determines whether the plugin is active for the entire network.

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

Determines whether a plugin is active.

  |

| Used by | Description | 
| [WP_REST_Plugins_Controller::does_plugin_match_request()](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/does_plugin_match_request/)`wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php` |

Checks if the plugin matches the requested parameters.

  | 
| [WP_REST_Plugins_Controller::update_item_permissions_check()](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/update_item_permissions_check/)`wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php` |

Checks if a given request has access to update a specific plugin.

  | 
| [WP_REST_Plugins_Controller::update_item()](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/update_item/)`wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php` |

Updates one plugin.

  | 
| [WP_REST_Plugins_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php` |

Prepares the plugin for the REST response.

  |

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

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

## User Contributed Notes

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