-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLANET-7532 Retire unused feature flags
- Remove "Purge Cloudflare HTML cache on feature changes". - Removed now obsolete hooks triggered on saving a feature flag. - Remove "WordPress template editor". - Add migration to clean up those options from database. --- Ref: https://jira.greenpeace.org/browse/PLANET-7532
- Loading branch information
Showing
7 changed files
with
60 additions
and
140 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace P4\MasterTheme\Migrations; | ||
|
||
use P4\MasterTheme\MigrationRecord; | ||
use P4\MasterTheme\MigrationScript; | ||
|
||
/** | ||
* Remove the WordPress template editor option from Planet 4 Features. | ||
*/ | ||
class M029RemoveTemplateEditorOption extends MigrationScript | ||
{ | ||
/** | ||
* Perform the actual migration. | ||
* | ||
* @param MigrationRecord $record Information on the execution, can be used to add logs. | ||
* phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter -- interface implementation | ||
*/ | ||
protected static function execute(MigrationRecord $record): void | ||
{ | ||
// Template editor feature flag. | ||
$features = get_option('planet4_features'); | ||
unset($features[ 'wp_template_editor' ]); | ||
update_option('planet4_features', $features); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace P4\MasterTheme\Migrations; | ||
|
||
use P4\MasterTheme\MigrationRecord; | ||
use P4\MasterTheme\MigrationScript; | ||
|
||
/** | ||
* Remove the Purge on feature change option from Planet 4 Features. | ||
*/ | ||
class M030RemovePurgeOnFeatureChangeOption extends MigrationScript | ||
{ | ||
/** | ||
* Perform the actual migration. | ||
* | ||
* @param MigrationRecord $record Information on the execution, can be used to add logs. | ||
* phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter -- interface implementation | ||
*/ | ||
protected static function execute(MigrationRecord $record): void | ||
{ | ||
// Purge on feature change feature flag. | ||
$features = get_option('planet4_features'); | ||
unset($features[ 'purge_on_feature_changes' ]); | ||
update_option('planet4_features', $features); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters