Change plugin eligibility to check for installed plugins

This commit is contained in:
Eric Jinks 2022-05-05 10:37:48 +10:00
parent b32a8f49a9
commit e36c5d3b8f
No known key found for this signature in database
GPG Key ID: 22C09ACBC4DC9279
1 changed files with 3 additions and 3 deletions

View File

@ -77,8 +77,8 @@ class WcPaySubscriptionsPage {
* @return bool
*/
private function is_store_experiment_eligible() {
// Ineligible if WooCommerce Payments OR an existing subscriptions plugin is active.
$active_plugins = PluginsHelper::get_active_plugin_slugs();
// Ineligible if WooCommerce Payments OR an existing subscriptions plugin is installed.
$installed_plugins = PluginsHelper::get_installed_plugin_slugs();
$plugin_ineligible_list = array(
'woocommerce-payments',
'woocommerce-subscriptions',
@ -87,7 +87,7 @@ class WcPaySubscriptionsPage {
'yith-woocommerce-subscription',
);
foreach ( $plugin_ineligible_list as $plugin_slug ) {
if ( in_array( $plugin_slug, $active_plugins, true ) ) {
if ( in_array( $plugin_slug, $installed_plugins, true ) ) {
return false;
}
}