| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Editors\Framework; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Editors\Domain\Analysis_Features\Analysis_Feature_Interface; |
| 6 |
|
| 7 |
/** |
| 8 |
* Describes if the previously used keyword feature should be enabled. |
| 9 |
*/ |
| 10 |
class Previously_Used_Keyphrase implements Analysis_Feature_Interface { |
| 11 |
|
| 12 |
public const NAME = 'previouslyUsedKeyphrase'; |
| 13 |
|
| 14 |
/** |
| 15 |
* If this analysis is enabled. |
| 16 |
* |
| 17 |
* @return bool If this analysis is enabled. |
| 18 |
*/ |
| 19 |
public function is_enabled(): bool { |
| 20 |
/** |
| 21 |
* Filter to determine If the PreviouslyUsedKeyphrase assessment should run. |
| 22 |
* |
| 23 |
* @param bool $previouslyUsedKeyphraseActive If the PreviouslyUsedKeyphrase assessment should run. |
| 24 |
*/ |
| 25 |
return (bool) \apply_filters( 'wpseo_previously_used_keyword_active', true ); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Returns the name of the object. |
| 30 |
* |
| 31 |
* @return string |
| 32 |
*/ |
| 33 |
public function get_name(): string { |
| 34 |
return self::NAME; |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Gets the legacy key. |
| 39 |
* |
| 40 |
* @return string The legacy key. |
| 41 |
*/ |
| 42 |
public function get_legacy_key(): string { |
| 43 |
return 'previouslyUsedKeywordActive'; |
| 44 |
} |
| 45 |
} |
| 46 |
|