/**
* Retrieves one plugin from the site.
*
* @since 5.5.0
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function get_item( $request ) { require_once ABSPATH . 'wp-admin/includes/plugin.php';
$data =
$this->
get_plugin_data( $request['plugin'
] );
if ( is_wp_error( $data ) ) { return $data;
} return $this->
prepare_item_for_response( $data,
$request );
} /**
* Checks if the given plugin can be viewed by the current user.
*
* On multisite, this hides non-active network only plugins if the user does not have permission
* to manage network plugins.
*
* @since 5.5.0
*
* @param string $plugin The plugin file to check.
* @return true|WP_Error True if can read, a WP_Error instance otherwise.
*/