diff --git a/includes/Services/PluginInstaller.php b/includes/Services/PluginInstaller.php index cdf0bf0..76adeda 100644 --- a/includes/Services/PluginInstaller.php +++ b/includes/Services/PluginInstaller.php @@ -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. * @@ -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. *