Skip to content

Commit

Permalink
Put the feature behind a feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobattocchi committed Aug 28, 2024
1 parent 1ef0932 commit 61c0670
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
18 changes: 18 additions & 0 deletions src/conditionals/check-required-version-conditional.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Yoast\WP\SEO\Conditionals;

/**
* Conditional for the CHECK_REQUIRED_VERSION feature flag.
*/
class Check_Required_Version_Conditional extends Feature_Flag_Conditional {

/**
* Returns the name of the feature flag.
*
* @return string The name of the feature flag.
*/
protected function get_feature_flag() {
return 'CHECK_REQUIRED_VERSION';
}
}
13 changes: 10 additions & 3 deletions src/integrations/admin/check-required-version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Plugin_Upgrader;
use WP_Error;
use WP_Upgrader;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Conditionals\Check_Required_Version_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
Expand All @@ -16,8 +16,6 @@
*/
class Check_Required_Version implements Integration_Interface {

use No_Conditionals;

/**
* Initializes the integration.
*
Expand All @@ -28,6 +26,15 @@ public function register_hooks() {
\add_filter( 'install_plugin_overwrite_comparison', [ $this, 'update_comparison_table' ], 10, 3 );
}

/**
* Returns the conditionals based on which this loadable should be active.
*
* @return string[] The conditionals based on which this loadable should be active.
*/
public static function get_conditionals() {
return [ Check_Required_Version_Conditional::class ];
}

/**
* Checks if the required version of Yoast SEO is installed.
*
Expand Down

0 comments on commit 61c0670

Please sign in to comment.