WordPress at a glance
function is not described

WP_Recovery_Mode_Email_Service::get_plugin() private WP 5.3.0

Return the details for a single plugin based on the extension data from an error.

{} It's a method of the class: WP_Recovery_Mode_Email_Service{}

No Hooks.

Return

Array|false. A plugin array get_plugins() or false if no plugin was found.

Usage

// private - for code of main (parent) class only
$result = $this->get_plugin( $extension );
$extension(array) (required)
The extension that caused the error.

Changelog

Since 5.3.0 Introduced.

Code of WP_Recovery_Mode_Email_Service::get_plugin() WP 5.7.2

<?php
private function get_plugin( $extension ) {
	if ( ! function_exists( 'get_plugins' ) ) {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
	}

	$plugins = get_plugins();

	// Assume plugin main file name first since it is a common convention.
	if ( isset( $plugins[ "{$extension['slug']}/{$extension['slug']}.php" ] ) ) {
		return $plugins[ "{$extension['slug']}/{$extension['slug']}.php" ];
	} else {
		foreach ( $plugins as $file => $plugin_data ) {
			if ( 0 === strpos( $file, "{$extension['slug']}/" ) || $file === $extension['slug'] ) {
				return $plugin_data;
			}
		}
	}

	return false;
}