Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Oct 22, 2024
1 parent d6e8156 commit 0e7e57b
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions includes/Services/PluginInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@ public static function install_premium_plugin( $plugin, $provider, $activate ) {
);
}

public static function is_plugin_installed( $plugin_path ) {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$all_plugins = \get_plugins();
return ! empty( $all_plugins[ $plugin_path ] );
}


/**
* Install the plugin from a custom ZIP.
*
Expand Down Expand Up @@ -371,6 +362,24 @@ public static function is_nfd_slug( $plugin ) {
return false;
}

/**
* Determines if a plugin has already been installed.
*
* @param string $plugin_path Path to the plugin's header file.
* @return boolean
*/
public static function is_plugin_installed( $plugin_path ) {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$all_plugins = \get_plugins();
if ( ! empty( $all_plugins[ $plugin_path ] ) ) {
return true;
} else {
return false;
}
}

/**
* Get the type of plugin slug. Ref: includes/Data/Plugins.php for the different types.
*
Expand Down

0 comments on commit 0e7e57b

Please sign in to comment.