Merged in feature/314-dev-dev01 (pull request #24)

auto-patch  314-dev-dev01-2024-01-25T04_09_02

* auto-patch  314-dev-dev01-2024-01-25T04_09_02
This commit is contained in:
Tony Volpe
2024-01-25 04:11:47 +00:00
parent 6b67473553
commit 68dbe860e9
540 changed files with 3445 additions and 2131 deletions

View File

@@ -9,7 +9,7 @@ use Yoast\WP\SEO\Helpers\User_Helper;
*/
class Alert_Dismissal_Action {
const USER_META_KEY = '_yoast_alerts_dismissed';
public const USER_META_KEY = '_yoast_alerts_dismissed';
/**
* Holds the user helper instance.
@@ -196,7 +196,7 @@ class Alert_Dismissal_Action {
/**
* Filter: 'wpseo_allowed_dismissable_alerts' - List of allowed dismissable alerts.
*
* @api string[] $allowed_dismissable_alerts Allowed dismissable alerts list.
* @param string[] $allowed_dismissable_alerts Allowed dismissable alerts list.
*/
$allowed_dismissable_alerts = \apply_filters( 'wpseo_allowed_dismissable_alerts', [] );

View File

@@ -13,7 +13,7 @@ class First_Time_Configuration_Action {
/**
* The fields for the site representation payload.
*/
const SITE_REPRESENTATION_FIELDS = [
public const SITE_REPRESENTATION_FIELDS = [
'company_or_person',
'company_name',
'website_name',
@@ -78,9 +78,9 @@ class First_Time_Configuration_Action {
/**
* Action: 'wpseo_post_update_site_representation' - Allows for Hiive event tracking.
*
* @param array The new values of the options.
* @param array The old values of the options.
* @param array The options that failed to be saved.
* @param array $params The new values of the options.
* @param array $old_values The old values of the options.
* @param array $failures The options that failed to be saved.
*
* @internal
*/
@@ -115,9 +115,9 @@ class First_Time_Configuration_Action {
/**
* Action: 'wpseo_post_update_social_profiles' - Allows for Hiive event tracking.
*
* @param array The new values of the options.
* @param array The old values of the options.
* @param array The options that failed to be saved.
* @param array $params The new values of the options.
* @param array $old_values The old values of the options.
* @param array $failures The options that failed to be saved.
*
* @internal
*/
@@ -206,9 +206,9 @@ class First_Time_Configuration_Action {
/**
* Action: 'wpseo_post_update_enable_tracking' - Allows for Hiive event tracking.
*
* @param array The new value.
* @param array The old value.
* @param bool Whether the option failed to be stored.
* @param array $new_value The new value.
* @param array $old_value The old value.
* @param bool $failure Whether the option failed to be stored.
*
* @internal
*/
@@ -332,7 +332,7 @@ class First_Time_Configuration_Action {
*
* @return array The old values.
*/
private function get_old_values( array $fields_names ) : array {
private function get_old_values( array $fields_names ): array {
$old_values = [];
foreach ( $fields_names as $field_name ) {

View File

@@ -21,14 +21,14 @@ abstract class Abstract_Aioseo_Importing_Action implements Importing_Action_Inte
*
* @var string
*/
const PLUGIN = null;
public const PLUGIN = null;
/**
* The type the class deals with.
*
* @var string
*/
const TYPE = null;
public const TYPE = null;
/**
* The AIOSEO helper.
@@ -111,6 +111,8 @@ abstract class Abstract_Aioseo_Importing_Action implements Importing_Action_Inte
* @required
*
* @param Aioseo_Helper $aioseo_helper The AIOSEO helper.
*
* @return void
*/
public function set_aioseo_helper( Aioseo_Helper $aioseo_helper ) {
$this->aioseo_helper = $aioseo_helper;
@@ -124,7 +126,7 @@ abstract class Abstract_Aioseo_Importing_Action implements Importing_Action_Inte
* @throws Exception If the PLUGIN constant is not set in the child class.
*/
public function get_plugin() {
$class = \get_class( $this );
$class = static::class;
$plugin = $class::PLUGIN;
if ( $plugin === null ) {
@@ -142,7 +144,7 @@ abstract class Abstract_Aioseo_Importing_Action implements Importing_Action_Inte
* @throws Exception If the TYPE constant is not set in the child class.
*/
public function get_type() {
$class = \get_class( $this );
$class = static::class;
$type = $class::TYPE;
if ( $type === null ) {

View File

@@ -17,19 +17,19 @@ abstract class Abstract_Aioseo_Settings_Importing_Action extends Abstract_Aioseo
*
* @var string
*/
const PLUGIN = null;
public const PLUGIN = null;
/**
* The type the class deals with.
*
* @var string
*/
const TYPE = null;
public const TYPE = null;
/**
* The option_name of the AIOSEO option that contains the settings.
*/
const SOURCE_OPTION_NAME = null;
public const SOURCE_OPTION_NAME = null;
/**
* The map of aioseo_options to yoast settings.
@@ -74,6 +74,8 @@ abstract class Abstract_Aioseo_Settings_Importing_Action extends Abstract_Aioseo
* @required
*
* @param Import_Helper $import_helper The import helper.
*
* @return void
*/
public function set_import_helper( Import_Helper $import_helper ) {
$this->import_helper = $import_helper;
@@ -232,7 +234,7 @@ abstract class Abstract_Aioseo_Settings_Importing_Action extends Abstract_Aioseo
/**
* Filter 'wpseo_aioseo_<identifier>_import_cursor' - Allow filtering the value of the aioseo settings import cursor.
*
* @api int The value of the aioseo posttype default settings import cursor.
* @param int $import_cursor The value of the aioseo posttype default settings import cursor.
*/
$cursor = \apply_filters( 'wpseo_aioseo_' . $this->get_type() . '_import_cursor', $cursor );
@@ -257,7 +259,7 @@ abstract class Abstract_Aioseo_Settings_Importing_Action extends Abstract_Aioseo
/**
* Filter 'wpseo_aioseo_<identifier>_indexation_limit' - Allow filtering the number of settings imported during each importing pass.
*
* @api int The maximum number of posts indexed.
* @param int $max_posts The maximum number of posts indexed.
*/
$limit = \apply_filters( 'wpseo_aioseo_' . $this->get_type() . '_indexation_limit', 25 );

View File

@@ -15,12 +15,12 @@ class Aioseo_Cleanup_Action extends Abstract_Aioseo_Importing_Action {
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'cleanup';
public const TYPE = 'cleanup';
/**
* The AIOSEO meta_keys to be cleaned up.
@@ -163,7 +163,7 @@ class Aioseo_Cleanup_Action extends Abstract_Aioseo_Importing_Action {
/**
* Filter 'wpseo_aioseo_cleanup_limit' - Allow filtering the number of posts indexed during each indexing pass.
*
* @api int The maximum number of posts cleaned up.
* @param int $max_posts The maximum number of posts cleaned up.
*/
$limit = \apply_filters( 'wpseo_aioseo_cleanup_limit', 25 );

View File

@@ -21,17 +21,17 @@ class Aioseo_Custom_Archive_Settings_Importing_Action extends Abstract_Aioseo_Se
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'custom_archive_settings';
public const TYPE = 'custom_archive_settings';
/**
* The option_name of the AIOSEO option that contains the settings.
*/
const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
public const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
/**
* The map of aioseo_options to yoast settings.

View File

@@ -13,17 +13,17 @@ class Aioseo_Default_Archive_Settings_Importing_Action extends Abstract_Aioseo_S
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'default_archive_settings';
public const TYPE = 'default_archive_settings';
/**
* The option_name of the AIOSEO option that contains the settings.
*/
const SOURCE_OPTION_NAME = 'aioseo_options';
public const SOURCE_OPTION_NAME = 'aioseo_options';
/**
* The map of aioseo_options to yoast settings.

View File

@@ -19,17 +19,17 @@ class Aioseo_General_Settings_Importing_Action extends Abstract_Aioseo_Settings_
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'general_settings';
public const TYPE = 'general_settings';
/**
* The option_name of the AIOSEO option that contains the settings.
*/
const SOURCE_OPTION_NAME = 'aioseo_options';
public const SOURCE_OPTION_NAME = 'aioseo_options';
/**
* The map of aioseo_options to yoast settings.

View File

@@ -26,12 +26,12 @@ class Aioseo_Posts_Importing_Action extends Abstract_Aioseo_Importing_Action {
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'posts';
public const TYPE = 'posts';
/**
* The map of aioseo to yoast meta.
@@ -188,7 +188,8 @@ class Aioseo_Posts_Importing_Action extends Abstract_Aioseo_Importing_Action {
Aioseo_Replacevar_Service $replacevar_handler,
Aioseo_Robots_Provider_Service $robots_provider,
Aioseo_Robots_Transformer_Service $robots_transformer,
Aioseo_Social_Images_Provider_Service $social_images_provider ) {
Aioseo_Social_Images_Provider_Service $social_images_provider
) {
parent::__construct( $import_cursor, $options, $sanitization, $replacevar_handler, $robots_provider, $robots_transformer );
$this->indexable_repository = $indexable_repository;
@@ -379,7 +380,7 @@ class Aioseo_Posts_Importing_Action extends Abstract_Aioseo_Importing_Action {
/**
* Filter 'wpseo_aioseo_post_indexation_limit' - Allow filtering the number of posts indexed during each indexing pass.
*
* @api int The maximum number of posts indexed.
* @param int $max_posts The maximum number of posts indexed.
*/
$limit = \apply_filters( 'wpseo_aioseo_post_indexation_limit', 25 );
@@ -444,7 +445,7 @@ class Aioseo_Posts_Importing_Action extends Abstract_Aioseo_Importing_Action {
/**
* Filter 'wpseo_aioseo_post_cursor' - Allow filtering the value of the aioseo post import cursor.
*
* @api int The value of the aioseo post import cursor.
* @param int $import_cursor The value of the aioseo post import cursor.
*/
$cursor = \apply_filters( 'wpseo_aioseo_post_import_cursor', $cursor );

View File

@@ -13,17 +13,17 @@ class Aioseo_Posttype_Defaults_Settings_Importing_Action extends Abstract_Aioseo
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'posttype_default_settings';
public const TYPE = 'posttype_default_settings';
/**
* The option_name of the AIOSEO option that contains the settings.
*/
const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
public const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
/**
* The map of aioseo_options to yoast settings.

View File

@@ -11,17 +11,17 @@ class Aioseo_Taxonomy_Settings_Importing_Action extends Abstract_Aioseo_Settings
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'taxonomy_settings';
public const TYPE = 'taxonomy_settings';
/**
* The option_name of the AIOSEO option that contains the settings.
*/
const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
public const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
/**
* The map of aioseo_options to yoast settings.

View File

@@ -16,12 +16,12 @@ class Aioseo_Validate_Data_Action extends Abstract_Aioseo_Importing_Action {
/**
* The plugin of the action.
*/
const PLUGIN = 'aioseo';
public const PLUGIN = 'aioseo';
/**
* The type of the action.
*/
const TYPE = 'validate_data';
public const TYPE = 'validate_data';
/**
* The WordPress database instance.
@@ -242,7 +242,7 @@ class Aioseo_Validate_Data_Action extends Abstract_Aioseo_Importing_Action {
/**
* Filter 'wpseo_aioseo_cleanup_limit' - Allow filtering the number of validations during each action pass.
*
* @api int The maximum number of validations.
* @param int $limit The maximum number of validations.
*/
$limit = \apply_filters( 'wpseo_aioseo_validation_limit', 25 );

View File

@@ -22,14 +22,14 @@ class Deactivate_Conflicting_Plugins_Action extends Abstract_Aioseo_Importing_Ac
*
* @var string
*/
const PLUGIN = 'conflicting-plugins';
public const PLUGIN = 'conflicting-plugins';
/**
* The type the class deals with.
*
* @var string
*/
const TYPE = 'deactivation';
public const TYPE = 'deactivation';
/**
* The replacevar handler.
@@ -80,6 +80,8 @@ class Deactivate_Conflicting_Plugins_Action extends Abstract_Aioseo_Importing_Ac
/**
* Get the total number of conflicting plugins.
*
* @return int
*/
public function get_total_unindexed() {
return \count( $this->get_detected_plugins() );
@@ -98,6 +100,8 @@ class Deactivate_Conflicting_Plugins_Action extends Abstract_Aioseo_Importing_Ac
/**
* Deactivate conflicting plugins.
*
* @return array
*/
public function index() {
$detected_plugins = $this->get_detected_plugins();

View File

@@ -14,14 +14,14 @@ abstract class Abstract_Indexing_Action implements Indexation_Action_Interface,
*
* @var string
*/
const UNINDEXED_COUNT_TRANSIENT = null;
public const UNINDEXED_COUNT_TRANSIENT = null;
/**
* The transient cache key for limited counts.
*
* @var string
*/
const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
public const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
/**
* Builds a query for selecting the ID's of unindexed posts.

View File

@@ -98,7 +98,7 @@ abstract class Abstract_Link_Indexing_Action extends Abstract_Indexing_Action {
/**
* Filter 'wpseo_link_indexing_limit' - Allow filtering the number of texts indexed during each link indexing pass.
*
* @api int The maximum number of texts indexed.
* @param int $limit The maximum number of texts indexed.
*/
return \apply_filters( 'wpseo_link_indexing_limit', 5 );
}

View File

@@ -13,7 +13,7 @@ class Indexable_General_Indexation_Action implements Indexation_Action_Interface
/**
* The transient cache key.
*/
const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_general_items';
public const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_general_items';
/**
* Represents the indexables repository.

View File

@@ -20,14 +20,14 @@ class Indexable_Post_Indexation_Action extends Abstract_Indexing_Action {
*
* @var string
*/
const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_posts';
public const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_posts';
/**
* The transient cache key for limited counts.
*
* @var string
*/
const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
public const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
/**
* The post type helper.
@@ -120,7 +120,7 @@ class Indexable_Post_Indexation_Action extends Abstract_Indexing_Action {
/**
* Filter 'wpseo_post_indexation_limit' - Allow filtering the amount of posts indexed during each indexing pass.
*
* @api int The maximum number of posts indexed.
* @param int $limit The maximum number of posts indexed.
*/
$limit = \apply_filters( 'wpseo_post_indexation_limit', 25 );

View File

@@ -19,7 +19,7 @@ class Indexable_Post_Type_Archive_Indexation_Action implements Indexation_Action
/**
* The transient cache key.
*/
const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_post_type_archives';
public const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_post_type_archives';
/**
* The post type helper.
@@ -127,7 +127,7 @@ class Indexable_Post_Type_Archive_Indexation_Action implements Indexation_Action
/**
* Filter 'wpseo_post_type_archive_indexation_limit' - Allow filtering the number of posts indexed during each indexing pass.
*
* @api int The maximum number of posts indexed.
* @param int $limit The maximum number of posts indexed.
*/
$limit = \apply_filters( 'wpseo_post_type_archive_indexation_limit', 25 );
@@ -192,7 +192,7 @@ class Indexable_Post_Type_Archive_Indexation_Action implements Indexation_Action
return [];
}
$callback = static function( $result ) {
$callback = static function ( $result ) {
return $result['object_sub_type'];
};

View File

@@ -17,14 +17,14 @@ class Indexable_Term_Indexation_Action extends Abstract_Indexing_Action {
/**
* The transient cache key.
*/
const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_terms';
public const UNINDEXED_COUNT_TRANSIENT = 'wpseo_total_unindexed_terms';
/**
* The transient cache key for limited counts.
*
* @var string
*/
const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
public const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
/**
* The post type helper.
@@ -107,7 +107,7 @@ class Indexable_Term_Indexation_Action extends Abstract_Indexing_Action {
/**
* Filter 'wpseo_term_indexation_limit' - Allow filtering the number of terms indexed during each indexing pass.
*
* @api int The maximum number of terms indexed.
* @param int $limit The maximum number of terms indexed.
*/
$limit = \apply_filters( 'wpseo_term_indexation_limit', 25 );

View File

@@ -15,14 +15,14 @@ class Post_Link_Indexing_Action extends Abstract_Link_Indexing_Action {
*
* @var string
*/
const UNINDEXED_COUNT_TRANSIENT = 'wpseo_unindexed_post_link_count';
public const UNINDEXED_COUNT_TRANSIENT = 'wpseo_unindexed_post_link_count';
/**
* The transient cache key for limited counts.
*
* @var string
*/
const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
public const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
/**
* The post type helper.

View File

@@ -15,14 +15,14 @@ class Term_Link_Indexing_Action extends Abstract_Link_Indexing_Action {
*
* @var string
*/
const UNINDEXED_COUNT_TRANSIENT = 'wpseo_unindexed_term_link_count';
public const UNINDEXED_COUNT_TRANSIENT = 'wpseo_unindexed_term_link_count';
/**
* The transient cache key for limited counts.
*
* @var string
*/
const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
public const UNINDEXED_LIMITED_COUNT_TRANSIENT = self::UNINDEXED_COUNT_TRANSIENT . '_limited';
/**
* The post type helper.

View File

@@ -49,6 +49,8 @@ class SEMrush_Login_Action {
/**
* Performs the login request, if necessary.
*
* @return void
*/
public function login() {
if ( $this->client->has_valid_tokens() ) {

View File

@@ -13,14 +13,14 @@ class SEMrush_Phrases_Action {
/**
* The transient cache key.
*/
const TRANSIENT_CACHE_KEY = 'wpseo_semrush_related_keyphrases_%s_%s';
public const TRANSIENT_CACHE_KEY = 'wpseo_semrush_related_keyphrases_%s_%s';
/**
* The SEMrush keyphrase URL.
*
* @var string
*/
const KEYPHRASES_URL = 'https://oauth.semrush.com/api/v1/keywords/phrase_fullsearch';
public const KEYPHRASES_URL = 'https://oauth.semrush.com/api/v1/keywords/phrase_fullsearch';
/**
* The SEMrush_Client instance.

View File

@@ -2,6 +2,7 @@
namespace Yoast\WP\SEO\Actions\Wincher;
use Exception;
use Yoast\WP\SEO\Config\Wincher_Client;
use Yoast\WP\SEO\Helpers\Options_Helper;
@@ -10,8 +11,8 @@ use Yoast\WP\SEO\Helpers\Options_Helper;
*/
class Wincher_Account_Action {
const ACCOUNT_URL = 'https://api.wincher.com/beta/account';
const UPGRADE_CAMPAIGN_URL = 'https://api.wincher.com/v1/yoast/upgrade-campaign';
public const ACCOUNT_URL = 'https://api.wincher.com/beta/account';
public const UPGRADE_CAMPAIGN_URL = 'https://api.wincher.com/v1/yoast/upgrade-campaign';
/**
* The Wincher_Client instance.
@@ -59,7 +60,7 @@ class Wincher_Account_Action {
'historyDays' => $history,
'status' => 200,
];
} catch ( \Exception $e ) {
} catch ( Exception $e ) {
return (object) [
'status' => $e->getCode(),
'error' => $e->getMessage(),
@@ -75,9 +76,9 @@ class Wincher_Account_Action {
public function get_upgrade_campaign() {
try {
$result = $this->client->get( self::UPGRADE_CAMPAIGN_URL );
$type = isset( $result['type'] ) ? $result['type'] : null;
$months = isset( $result['months'] ) ? $result['months'] : null;
$discount = isset( $result['value'] ) ? $result['value'] : null;
$type = ( $result['type'] ?? null );
$months = ( $result['months'] ?? null );
$discount = ( $result['value'] ?? null );
// We display upgrade discount only if it's a rate discount and positive months/discount.
if ( $type === 'RATE' && $months && $discount ) {
@@ -94,7 +95,7 @@ class Wincher_Account_Action {
'months' => null,
'status' => 200,
];
} catch ( \Exception $e ) {
} catch ( Exception $e ) {
return (object) [
'status' => $e->getCode(),
'error' => $e->getMessage(),

View File

@@ -19,21 +19,21 @@ class Wincher_Keyphrases_Action {
*
* @var string
*/
const KEYPHRASES_ADD_URL = 'https://api.wincher.com/beta/websites/%s/keywords/bulk';
public const KEYPHRASES_ADD_URL = 'https://api.wincher.com/beta/websites/%s/keywords/bulk';
/**
* The Wincher tracked keyphrase retrieval URL.
*
* @var string
*/
const KEYPHRASES_URL = 'https://api.wincher.com/beta/yoast/%s';
public const KEYPHRASES_URL = 'https://api.wincher.com/beta/yoast/%s';
/**
* The Wincher delete tracked keyphrase URL.
*
* @var string
*/
const KEYPHRASE_DELETE_URL = 'https://api.wincher.com/beta/websites/%s/keywords/%s';
public const KEYPHRASE_DELETE_URL = 'https://api.wincher.com/beta/websites/%s/keywords/%s';
/**
* The Wincher_Client instance.
@@ -125,7 +125,7 @@ class Wincher_Keyphrases_Action {
// The endpoint returns a lot of stuff that we don't want/need.
$results['data'] = \array_map(
static function( $keyphrase ) {
static function ( $keyphrase ) {
return [
'id' => $keyphrase['id'],
'keyword' => $keyphrase['keyword'],
@@ -312,7 +312,7 @@ class Wincher_Keyphrases_Action {
protected function filter_results_by_used_keyphrases( $results, $used_keyphrases ) {
return \array_filter(
$results,
static function( $result ) use ( $used_keyphrases ) {
static function ( $result ) use ( $used_keyphrases ) {
return \in_array( $result['keyword'], \array_map( 'strtolower', $used_keyphrases ), true );
}
);

View File

@@ -56,7 +56,9 @@ class Missing_Indexables_Collector implements WPSEO_Collection {
* Filter: Adds the possibility to add additional indexation actions to be included in the count routine.
*
* @internal
* @api Indexation_Action_Interface This filter expects a list of Indexation_Action_Interface instances and expects only Indexation_Action_Interface implementations to be added to the list.
* @param Indexation_Action_Interface $actions This filter expects a list of Indexation_Action_Interface instances
* and expects only Indexation_Action_Interface implementations to be
* added to the list.
*/
$indexing_actions = (array) \apply_filters( 'wpseo_indexable_collector_add_indexation_actions', $this->indexation_actions );

View File

@@ -32,6 +32,8 @@ class To_Be_Cleaned_Indexables_Collector implements WPSEO_Collection {
/**
* Gets the data for the collector.
*
* @return array
*/
public function get() {
$to_be_cleaned_indexable_bucket = new To_Be_Cleaned_Indexable_Bucket();
@@ -75,7 +77,7 @@ class To_Be_Cleaned_Indexables_Collector implements WPSEO_Collection {
* Action: Adds the possibility to add additional to be cleaned objects.
*
* @internal
* @api To_Be_Cleaned_Indexable_Bucket An indexable cleanup bucket. New values are instances of To_Be_Cleaned_Indexable_Count.
* @param To_Be_Cleaned_Indexable_Bucket $bucket An indexable cleanup bucket. New values are instances of To_Be_Cleaned_Indexable_Count.
*/
\do_action( 'wpseo_add_cleanup_counts_to_indexable_bucket', $to_be_cleaned_indexable_bucket );
}

View File

@@ -157,6 +157,8 @@ class Indexable_Builder {
* @required
*
* @param Indexable_Repository $indexable_repository The indexable repository.
*
* @return void
*/
public function set_indexable_repository( Indexable_Repository $indexable_repository ) {
$this->indexable_repository = $indexable_repository;
@@ -282,9 +284,8 @@ class Indexable_Builder {
* the intended action may cause problems when moving from a staging to a
* production environment because indexable permalinks may get set incorrectly.
*
* @param Indexable $indexable The indexable to be saved.
*
* @api bool $intend_to_save True if YoastSEO intends to save the indexable.
* @param bool $intend_to_save True if YoastSEO intends to save the indexable.
* @param Indexable $indexable The indexable to be saved.
*/
$intend_to_save = \apply_filters( 'wpseo_should_save_indexable', $intend_to_save, $indexable );
@@ -300,9 +301,8 @@ class Indexable_Builder {
* Action: 'wpseo_save_indexable' - Allow developers to perform an action
* when the indexable is updated.
*
* @param Indexable $indexable The saved indexable.
* @param Indexable $indexable_before The indexable before saving.
*
* @api Indexable $indexable The saved indexable.
*/
\do_action( 'wpseo_save_indexable', $indexable, $indexable_before );
}

View File

@@ -87,6 +87,8 @@ class Indexable_Hierarchy_Builder {
* @required
*
* @param Indexable_Repository $indexable_repository The indexable repository.
*
* @return void
*/
public function set_indexable_repository( Indexable_Repository $indexable_repository ) {
$this->indexable_repository = $indexable_repository;

View File

@@ -2,7 +2,6 @@
namespace Yoast\WP\SEO\Builders;
use wpdb;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Post_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;

View File

@@ -238,7 +238,7 @@ class Indexable_Link_Builder {
$attribute = \apply_filters( 'wpseo_image_attribute_containing_id', 'class' );
while ( $processor->next_tag( $query ) ) {
$src = \htmlentities( $processor->get_attribute( 'src' ), ( ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ), \get_bloginfo( 'charset' ) );
$src = \htmlentities( $processor->get_attribute( 'src' ), ( \ENT_QUOTES | \ENT_SUBSTITUTE | \ENT_HTML401 ), \get_bloginfo( 'charset' ) );
$classes = $processor->get_attribute( $attribute );
$id = $this->extract_id_of_classes( $classes );
@@ -268,13 +268,13 @@ class Indexable_Link_Builder {
*/
$attribute = \apply_filters( 'wpseo_image_attribute_containing_id', 'class' );
libxml_use_internal_errors( true );
\libxml_use_internal_errors( true );
$post_dom = new DOMDocument();
$post_dom->loadHTML( '<?xml encoding="' . $charset . '">' . $content );
libxml_clear_errors();
\libxml_clear_errors();
foreach ( $post_dom->getElementsByTagName( 'img' ) as $img ) {
$src = \htmlentities( $img->getAttribute( 'src' ), ( ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ), $charset );
$src = \htmlentities( $img->getAttribute( 'src' ), ( \ENT_QUOTES | \ENT_SUBSTITUTE | \ENT_HTML401 ), $charset );
$classes = $img->getAttribute( $attribute );
$id = $this->extract_id_of_classes( $classes );
@@ -311,7 +311,7 @@ class Indexable_Link_Builder {
$matches = [];
if ( preg_match( $pattern, $classes, $matches ) ) {
if ( \preg_match( $pattern, $classes, $matches ) ) {
return (int) $matches[1];
}
@@ -345,11 +345,11 @@ class Indexable_Link_Builder {
* @since 21.1
*/
$should_not_parse_content = \apply_filters( 'wpseo_force_skip_image_content_parsing', $should_not_parse_content );
if ( ! $should_not_parse_content && class_exists( WP_HTML_Tag_Processor::class ) ) {
if ( ! $should_not_parse_content && \class_exists( WP_HTML_Tag_Processor::class ) ) {
return $this->gather_images_wp( $content );
}
if ( ! $should_not_parse_content && class_exists( DOMDocument::class ) ) {
if ( ! $should_not_parse_content && \class_exists( DOMDocument::class ) ) {
return $this->gather_images_DOMDocument( $content );
}
@@ -383,7 +383,7 @@ class Indexable_Link_Builder {
$home_url = \wp_parse_url( \home_url() );
$current_url = \wp_parse_url( $indexable->permalink );
$links = \array_map(
function( $link ) use ( $home_url, $indexable ) {
function ( $link ) use ( $home_url, $indexable ) {
return $this->create_internal_link( $link, $home_url, $indexable );
},
$links
@@ -633,7 +633,7 @@ class Indexable_Link_Builder {
return \array_udiff(
$links_a,
$links_b,
static function( SEO_Links $link_a, SEO_Links $link_b ) {
static function ( SEO_Links $link_a, SEO_Links $link_b ) {
return \strcmp( $link_a->url, $link_b->url );
}
);

View File

@@ -83,6 +83,8 @@ class Indexable_Post_Builder {
* @required
*
* @param Indexable_Repository $indexable_repository The indexable repository.
*
* @return void
*/
public function set_indexable_repository( Indexable_Repository $indexable_repository ) {
$this->indexable_repository = $indexable_repository;

View File

@@ -44,6 +44,8 @@ trait Indexable_Social_Image_Trait {
* @param Image_Helper $image The image helper.
* @param Open_Graph_Image_Helper $open_graph_image The Open Graph image helper.
* @param Twitter_Image_Helper $twitter_image The Twitter image helper.
*
* @return void
*/
public function set_social_image_helpers(
Image_Helper $image,
@@ -60,6 +62,8 @@ trait Indexable_Social_Image_Trait {
*
* @param array $alternative_image The alternative image to set.
* @param Indexable $indexable The indexable to set image for.
*
* @return void
*/
protected function set_alternative_image( array $alternative_image, Indexable $indexable ) {
if ( ! empty( $alternative_image['image_id'] ) ) {
@@ -94,6 +98,8 @@ trait Indexable_Social_Image_Trait {
* Sets the Open Graph image meta data for an og image
*
* @param Indexable $indexable The indexable.
*
* @return void
*/
protected function set_open_graph_image_meta_data( Indexable $indexable ) {
if ( ! $indexable->open_graph_image_id ) {
@@ -112,6 +118,8 @@ trait Indexable_Social_Image_Trait {
* Handles the social images.
*
* @param Indexable $indexable The indexable to handle.
*
* @return void
*/
protected function handle_social_images( Indexable $indexable ) {
// When the image or image id is set.
@@ -144,6 +152,8 @@ trait Indexable_Social_Image_Trait {
* Resets the social images.
*
* @param Indexable $indexable The indexable to set images for.
*
* @return void
*/
protected function reset_social_images( Indexable $indexable ) {
$indexable->open_graph_image = null;

View File

@@ -16,7 +16,7 @@ class Indexable_System_Page_Builder {
/**
* Mapping of object type to title option keys.
*/
const OPTION_MAPPING = [
public const OPTION_MAPPING = [
'search-result' => [
'title' => 'title-search-wpseo',
],

View File

@@ -270,6 +270,8 @@ class Index_Command implements Command_Interface {
/**
* Clears the database related to the indexables.
*
* @return void
*/
protected function clear() {
global $wpdb;

View File

@@ -20,7 +20,7 @@ class Yoast_Admin_Conditional implements Conditional {
/**
* Constructs the conditional.
*
* @param \Yoast\WP\SEO\Helpers\Current_Page_Helper $current_page_helper The current page helper.
* @param Current_Page_Helper $current_page_helper The current page helper.
*/
public function __construct( Current_Page_Helper $current_page_helper ) {
$this->current_page_helper = $current_page_helper;

View File

@@ -36,7 +36,7 @@ class Should_Index_Links_Conditional implements Conditional {
/**
* Filter: 'wpseo_should_index_links' - Allows disabling of Yoast's links indexation.
*
* @api bool To disable the indexation, return false.
* @param bool $enable To disable the indexation, return false.
*/
return \apply_filters( 'wpseo_should_index_links', $should_index_links );
}

View File

@@ -20,7 +20,7 @@ class Elementor_Edit_Conditional implements Conditional {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
if ( isset( $_GET['action'] ) && \is_string( $_GET['action'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
// phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
$get_action = \wp_unslash( $_GET['action'] );
if ( $pagenow === 'post.php' && $get_action === 'elementor' ) {
return true;
@@ -29,7 +29,7 @@ class Elementor_Edit_Conditional implements Conditional {
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: We are not processing form information.
if ( isset( $_POST['action'] ) && \is_string( $_POST['action'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
// phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
$post_action = \wp_unslash( $_POST['action'] );
return \wp_doing_ajax() && $post_action === 'wpseo_elementor_save';
}

View File

@@ -15,7 +15,7 @@ class WPML_WPSEO_Conditional implements Conditional {
*
* @internal
*/
const PATH_TO_WPML_WPSEO_PLUGIN_FILE = 'wp-seo-multilingual/plugin.php';
public const PATH_TO_WPML_WPSEO_PLUGIN_FILE = 'wp-seo-multilingual/plugin.php';
/**
* Returns whether or not the Yoast SEO Multilingual plugin is active.

View File

@@ -13,6 +13,6 @@ class WP_CRON_Enabled_Conditional implements Conditional {
* @return bool True when WP_CRON is enabled.
*/
public function is_met() {
return ! ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON );
return ! ( \defined( 'DISABLE_WP_CRON' ) && \DISABLE_WP_CRON );
}
}

View File

@@ -10,12 +10,12 @@ namespace Yoast\WP\SEO\Config;
*/
class Badge_Group_Names {
const GROUP_GLOBAL_TEMPLATES = 'global-templates';
public const GROUP_GLOBAL_TEMPLATES = 'global-templates';
/**
* Constant describing when certain groups of new badges will no longer be shown.
*/
const GROUP_NAMES = [
public const GROUP_NAMES = [
self::GROUP_GLOBAL_TEMPLATES => '16.7-beta0',
];

View File

@@ -7,7 +7,7 @@ namespace Yoast\WP\SEO\Config;
*/
class Conflicting_Plugins {
const OPEN_GRAPH_PLUGINS = [
public const OPEN_GRAPH_PLUGINS = [
'2-click-socialmedia-buttons/2-click-socialmedia-buttons.php',
// 2 Click Social Media Buttons.
'add-link-to-facebook/add-link-to-facebook.php', // Add Link to Facebook.
@@ -49,7 +49,7 @@ class Conflicting_Plugins {
'zoltonorg-social-plugin/zosp.php', // Zolton.org Social Plugin.
];
const XML_SITEMAPS_PLUGINS = [
public const XML_SITEMAPS_PLUGINS = [
'google-sitemap-plugin/google-sitemap-plugin.php',
// Google Sitemap (BestWebSoft).
'xml-sitemaps/xml-sitemaps.php',
@@ -82,14 +82,14 @@ class Conflicting_Plugins {
// RPS Sitemap Generator (redpixelstudios).
];
const CLOAKING_PLUGINS = [
public const CLOAKING_PLUGINS = [
'rs-head-cleaner/rs-head-cleaner.php',
// RS Head Cleaner Plus https://wordpress.org/plugins/rs-head-cleaner/.
'rs-head-cleaner-lite/rs-head-cleaner-lite.php',
// RS Head Cleaner Lite https://wordpress.org/plugins/rs-head-cleaner-lite/.
];
const SEO_PLUGINS = [
public const SEO_PLUGINS = [
'all-in-one-seo-pack/all_in_one_seo_pack.php', // All in One SEO Pack.
'seo-ultimate/seo-ultimate.php', // SEO Ultimate.
'seo-by-rank-math/rank-math.php', // Rank Math.

View File

@@ -10,40 +10,40 @@ class Indexing_Reasons {
/**
* Represents the reason that the indexing process failed and should be tried again.
*/
const REASON_INDEXING_FAILED = 'indexing_failed';
public const REASON_INDEXING_FAILED = 'indexing_failed';
/**
* Represents the reason that the permalink settings are changed.
*/
const REASON_PERMALINK_SETTINGS = 'permalink_settings_changed';
public const REASON_PERMALINK_SETTINGS = 'permalink_settings_changed';
/**
* Represents the reason that the category base is changed.
*/
const REASON_CATEGORY_BASE_PREFIX = 'category_base_changed';
public const REASON_CATEGORY_BASE_PREFIX = 'category_base_changed';
/**
* Represents the reason that the tag base is changed.
*/
const REASON_TAG_BASE_PREFIX = 'tag_base_changed';
public const REASON_TAG_BASE_PREFIX = 'tag_base_changed';
/**
* Represents the reason that the home url option is changed.
*/
const REASON_HOME_URL_OPTION = 'home_url_option_changed';
public const REASON_HOME_URL_OPTION = 'home_url_option_changed';
/**
* Represents the reason that a post type has been made public.
*/
const REASON_POST_TYPE_MADE_PUBLIC = 'post_type_made_public';
public const REASON_POST_TYPE_MADE_PUBLIC = 'post_type_made_public';
/**
* Represents the reason that a post type has been made viewable.
*/
const REASON_TAXONOMY_MADE_PUBLIC = 'taxonomy_made_public';
public const REASON_TAXONOMY_MADE_PUBLIC = 'taxonomy_made_public';
/**
* Represents the reason that attachments have stopped being redirected.
*/
const REASON_ATTACHMENTS_MADE_ENABLED = 'attachments_made_enabled';
public const REASON_ATTACHMENTS_MADE_ENABLED = 'attachments_made_enabled';
}

View File

@@ -14,7 +14,7 @@ class Migration_Status {
*
* @var string
*/
const MIGRATION_OPTION_KEY = 'yoast_migrations_';
public const MIGRATION_OPTION_KEY = 'yoast_migrations_';
/**
* The migration options.

View File

@@ -37,6 +37,8 @@ class WpYoastIndexable extends Migration {
/**
* Creates the indexable table.
*
* @return void
*/
private function add_table() {
$table_name = $this->get_table_name();
@@ -327,6 +329,8 @@ class WpYoastIndexable extends Migration {
* Adds indexes to the indexable table.
*
* @param string $indexable_table_name The name of the indexable table.
*
* @return void
*/
private function add_indexes( $indexable_table_name ) {
$this->add_index(

View File

@@ -84,6 +84,8 @@ class WpYoastPrimaryTerm extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
$this->drop_table( $this->get_table_name() );

View File

@@ -19,6 +19,8 @@ class WpYoastDropIndexableMetaTableIfExists extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$table_name = $this->get_table_name();
@@ -29,6 +31,8 @@ class WpYoastDropIndexableMetaTableIfExists extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
// No down required. This specific table should never exist.

View File

@@ -19,6 +19,8 @@ class WpYoastIndexableHierarchy extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$table_name = $this->get_table_name();
@@ -63,6 +65,8 @@ class WpYoastIndexableHierarchy extends Migration {
/**
* Migration up.
*
* @return void
*/
public function down() {
$this->drop_table( $this->get_table_name() );

View File

@@ -19,6 +19,8 @@ class AddCollationToTables extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
global $wpdb;
@@ -42,6 +44,8 @@ class AddCollationToTables extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
// No down required.

View File

@@ -19,6 +19,8 @@ class AddColumnsToIndexables extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$tables = $this->get_tables();
@@ -54,6 +56,8 @@ class AddColumnsToIndexables extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
$tables = $this->get_tables();

View File

@@ -19,6 +19,8 @@ class BreadcrumbTitleAndHierarchyReset extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->change_column( $this->get_indexable_table_name(), 'breadcrumb_title', 'text', [ 'null' => true ] );
@@ -27,6 +29,8 @@ class BreadcrumbTitleAndHierarchyReset extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
$this->change_column(

View File

@@ -19,6 +19,8 @@ class ExpandIndexableColumnLengths extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->change_column( $this->get_table_name(), 'title', 'text', [ 'null' => true ] );
@@ -30,6 +32,8 @@ class ExpandIndexableColumnLengths extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
$attr_limit_191 = [

View File

@@ -19,6 +19,8 @@ class TruncateIndexableTables extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->query( 'TRUNCATE TABLE ' . $this->get_indexable_table_name() );
@@ -27,6 +29,8 @@ class TruncateIndexableTables extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
// Nothing to do.

View File

@@ -19,6 +19,8 @@ class AddIndexableObjectIdAndTypeIndex extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->add_index(
@@ -35,6 +37,8 @@ class AddIndexableObjectIdAndTypeIndex extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
$this->remove_index(

View File

@@ -19,6 +19,8 @@ class ClearIndexableTables extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->query( 'TRUNCATE TABLE ' . $this->get_indexable_table_name() );
@@ -27,6 +29,8 @@ class ClearIndexableTables extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
// Nothing to do.

View File

@@ -19,6 +19,8 @@ class DeleteDuplicateIndexables extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$table_name = $this->get_table_name();
@@ -32,6 +34,8 @@ class DeleteDuplicateIndexables extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
// Nothing to do.

View File

@@ -19,6 +19,8 @@ class ResetIndexableHierarchyTable extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->query( 'TRUNCATE TABLE ' . $this->get_table_name() );
@@ -26,6 +28,8 @@ class ResetIndexableHierarchyTable extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
// Nothing to do.

View File

@@ -20,6 +20,8 @@ class AddHasAncestorsColumn extends Migration {
/**
* Migration up.
*
* @return void
*/
public function up() {
$this->add_column(
@@ -42,6 +44,8 @@ class AddHasAncestorsColumn extends Migration {
/**
* Migration down.
*
* @return void
*/
public function down() {
$this->remove_column( Model::get_table_name( 'Indexable' ), 'has_ancestors' );

View File

@@ -72,7 +72,7 @@ abstract class OAuth_Client {
$tokens['expires'],
$tokens['has_expired'],
$tokens['created_at'],
isset( $tokens['error_count'] ) ? $tokens['error_count'] : 0
( $tokens['error_count'] ?? 0 )
);
}
}

View File

@@ -7,5 +7,5 @@ namespace Yoast\WP\SEO\Config;
*/
class Researcher_Languages {
const SUPPORTED_LANGUAGES = [ 'ar', 'ca', 'de', 'en', 'es', 'fa', 'fr', 'he', 'hu', 'id', 'it', 'nb', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'cs', 'sk', 'el', 'ja' ];
public const SUPPORTED_LANGUAGES = [ 'ar', 'ca', 'de', 'en', 'es', 'fa', 'fr', 'he', 'hu', 'id', 'it', 'nb', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'cs', 'sk', 'el', 'ja' ];
}

View File

@@ -10,57 +10,50 @@ class Schema_IDs {
/**
* Hash used for the Author `@id`.
*/
const AUTHOR_HASH = '#author';
public const AUTHOR_HASH = '#author';
/**
* Hash used for the Author Logo's `@id`.
*/
const AUTHOR_LOGO_HASH = '#authorlogo';
public const AUTHOR_LOGO_HASH = '#authorlogo';
/**
* Hash used for the Breadcrumb's `@id`.
*/
const BREADCRUMB_HASH = '#breadcrumb';
public const BREADCRUMB_HASH = '#breadcrumb';
/**
* Hash used for the Person `@id`.
*/
const PERSON_HASH = '#/schema/person/';
public const PERSON_HASH = '#/schema/person/';
/**
* Hash used for the Article `@id`.
*/
const ARTICLE_HASH = '#article';
public const ARTICLE_HASH = '#article';
/**
* Hash used for the Organization `@id`.
*/
const ORGANIZATION_HASH = '#organization';
public const ORGANIZATION_HASH = '#organization';
/**
* Hash used for the Organization `@id`.
*/
const ORGANIZATION_LOGO_HASH = '#/schema/logo/image/';
public const ORGANIZATION_LOGO_HASH = '#/schema/logo/image/';
/**
* Hash used for the logo `@id`.
*/
const PERSON_LOGO_HASH = '#/schema/person/image/';
public const PERSON_LOGO_HASH = '#/schema/person/image/';
/**
* Hash used for an Article's primary image `@id`.
*/
const PRIMARY_IMAGE_HASH = '#primaryimage';
/**
* Hash used for the WebPage's `@id`.
*
* @deprecated 19.3
*/
const WEBPAGE_HASH = '';
public const PRIMARY_IMAGE_HASH = '#primaryimage';
/**
* Hash used for the Website's `@id`.
*/
const WEBSITE_HASH = '#website';
public const WEBSITE_HASH = '#website';
}

View File

@@ -14,7 +14,7 @@ class Schema_Types {
*
* @var string[]
*/
const PAGE_TYPES = [
public const PAGE_TYPES = [
'WebPage' => '',
'ItemPage' => '',
'AboutPage' => '',
@@ -36,7 +36,7 @@ class Schema_Types {
*
* @var string[]
*/
const ARTICLE_TYPES = [
public const ARTICLE_TYPES = [
'Article' => '',
'BlogPosting' => '',
'SocialMediaPosting' => '',
@@ -118,7 +118,7 @@ class Schema_Types {
*
* Make sure when you filter this to also filter `wpseo_schema_article_types`.
*
* @api array $schema_article_types_labels The available schema article types and their labels.
* @param array $schema_article_types_labels The available schema article types and their labels.
*/
return \apply_filters(
'wpseo_schema_article_types_labels',
@@ -166,24 +166,4 @@ class Schema_Types {
]
);
}
/**
* Gets the values of the article type options.
*
* @deprecated 19.12
* @codeCoverageIgnore
*
* @return array[] The values of the Schema article type options.
*/
public function get_article_type_options_values() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
$article_types = $this->get_article_type_options();
$article_type_values = [];
foreach ( $article_types as $type ) {
$article_type_values[] = $type['value'];
}
return $article_type_values;
}
}

View File

@@ -19,7 +19,7 @@ class SEMrush_Client extends OAuth_Client {
/**
* The option's key.
*/
const TOKEN_OPTION = 'semrush_tokens';
public const TOKEN_OPTION = 'semrush_tokens';
/**
* SEMrush_Client constructor.

View File

@@ -20,12 +20,12 @@ class Wincher_Client extends OAuth_Client {
/**
* The option's key.
*/
const TOKEN_OPTION = 'wincher_tokens';
public const TOKEN_OPTION = 'wincher_tokens';
/**
* Name of the temporary PKCE cookie.
*/
const PKCE_TRANSIENT_NAME = 'yoast_wincher_pkce';
public const PKCE_TRANSIENT_NAME = 'yoast_wincher_pkce';
/**
* The WP_Remote_Handler instance.

View File

@@ -2,6 +2,7 @@
namespace Yoast\WP\SEO\Config;
use Exception;
use UnexpectedValueException;
use YoastSEO_Vendor\GuzzleHttp\Exception\BadResponseException;
use YoastSEO_Vendor\League\OAuth2\Client\Provider\Exception\IdentityProviderException;
@@ -71,7 +72,7 @@ class Wincher_PKCE_Provider extends GenericProvider {
*
* @return string
*
* @throws \Exception Throws exception if an invalid value is passed to random_bytes.
* @throws Exception Throws exception if an invalid value is passed to random_bytes.
*/
protected function getRandomPkceCode( $length = 64 ) {
return \substr(
@@ -103,7 +104,7 @@ class Wincher_PKCE_Provider extends GenericProvider {
* @return array The authorization parameters
*
* @throws InvalidArgumentException Throws exception if an invalid PCKE method is passed in the options.
* @throws \Exception When something goes wrong with generating the PKCE code.
* @throws Exception When something goes wrong with generating the PKCE code.
*/
protected function getAuthorizationParameters( array $options ) {
if ( empty( $options['state'] ) ) {

View File

@@ -34,13 +34,13 @@ class Content_Type_Visibility_Dismiss_Notifications {
*/
public function post_type_dismiss( $post_type_name ) {
$success = true;
$message = __( 'Post type is not new.', 'wordpress-seo' );
$message = \__( 'Post type is not new.', 'wordpress-seo' );
$post_types_needs_review = $this->options->get( 'new_post_types', [] );
if ( $post_types_needs_review && \in_array( $post_type_name, $post_types_needs_review, true ) ) {
$new_needs_review = \array_diff( $post_types_needs_review, [ $post_type_name ] );
$success = $this->options->set( 'new_post_types', $new_needs_review );
$message = ( $success ) ? __( 'Post type is no longer new.', 'wordpress-seo' ) : __( 'Error: Post type was not removed from new_post_types list.', 'wordpress-seo' );
$message = ( $success ) ? \__( 'Post type is no longer new.', 'wordpress-seo' ) : \__( 'Error: Post type was not removed from new_post_types list.', 'wordpress-seo' );
if ( $success ) {
$this->maybe_dismiss_notifications( [ 'new_post_types' => $new_needs_review ] );
}
@@ -63,14 +63,14 @@ class Content_Type_Visibility_Dismiss_Notifications {
*/
public function taxonomy_dismiss( $taxonomy_name ) {
$success = true;
$message = __( 'Taxonomy is not new.', 'wordpress-seo' );
$message = \__( 'Taxonomy is not new.', 'wordpress-seo' );
$taxonomies_needs_review = $this->options->get( 'new_taxonomies', [] );
if ( \in_array( $taxonomy_name, $taxonomies_needs_review, true ) ) {
$new_needs_review = \array_diff( $taxonomies_needs_review, [ $taxonomy_name ] );
$success = $this->options->set( 'new_taxonomies', $new_needs_review );
$message = ( $success ) ? __( 'Taxonomy is no longer new.', 'wordpress-seo' ) : __( 'Error: Taxonomy was not removed from new_taxonomies list.', 'wordpress-seo' );
$message = ( $success ) ? \__( 'Taxonomy is no longer new.', 'wordpress-seo' ) : \__( 'Error: Taxonomy was not removed from new_taxonomies list.', 'wordpress-seo' );
if ( $success ) {
$this->maybe_dismiss_notifications( [ 'new_taxonomies' => $new_needs_review ] );
}
@@ -89,12 +89,12 @@ class Content_Type_Visibility_Dismiss_Notifications {
* Checks if there are new content types or taxonomies.
*
* @param array $new_content_types The new content types.
* @return bool
* @return void
*/
public function maybe_dismiss_notifications( $new_content_types = [] ) {
$post_types_needs_review = ( array_key_exists( 'new_post_types', $new_content_types ) ) ? $new_content_types['new_post_types'] : $this->options->get( 'new_post_types', [] );
$taxonomies_needs_review = ( array_key_exists( 'new_taxonomies', $new_content_types ) ) ? $new_content_types['new_taxonomies'] : $this->options->get( 'new_taxonomies', [] );
$post_types_needs_review = ( \array_key_exists( 'new_post_types', $new_content_types ) ) ? $new_content_types['new_post_types'] : $this->options->get( 'new_post_types', [] );
$taxonomies_needs_review = ( \array_key_exists( 'new_taxonomies', $new_content_types ) ) ? $new_content_types['new_taxonomies'] : $this->options->get( 'new_taxonomies', [] );
if ( $post_types_needs_review || $taxonomies_needs_review ) {
return;
@@ -116,7 +116,7 @@ class Content_Type_Visibility_Dismiss_Notifications {
/**
* Check if there is a new content type to show notification only once in the settings.
*
* @return bool $show_new_content_type_notification Should the notification be shown.
* @return bool Should the notification be shown.
*/
public function maybe_add_settings_notification() {
$show_new_content_type_notification = $this->options->get( 'show_new_content_type_notification', false );

View File

@@ -7,7 +7,6 @@ use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast_Notification;
use Yoast_Notification_Center;
use Yoast\WP\SEO\Content_Type_Visibility\Application\Content_Type_Visibility_Dismiss_Notifications;
/**
* Handles showing notifications for new content types.
@@ -29,18 +28,18 @@ class Content_Type_Visibility_Watcher_Actions implements Integration_Interface {
*/
private $notification_center;
/**
* The notifications center.
*
* @var Content_Type_Visibility_Dismiss_Notifications
*/
/**
* The notifications center.
*
* @var Content_Type_Visibility_Dismiss_Notifications
*/
private $content_type_dismiss_notifications;
/**
* Indexable_Post_Type_Change_Watcher constructor.
*
* @param Options_Helper $options The options helper.
* @param Yoast_Notification_Center $notification_center The notification center.
* @param Options_Helper $options The options helper.
* @param Yoast_Notification_Center $notification_center The notification center.
* @param Content_Type_Visibility_Dismiss_Notifications $content_type_dismiss_notifications The content type dismiss notifications.
*/
public function __construct(

View File

@@ -2,12 +2,12 @@
namespace Yoast\WP\SEO\Content_Type_Visibility\User_Interface;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Main;
use Yoast\WP\SEO\Routes\Route_Interface;
use Yoast\WP\SEO\Content_Type_Visibility\Application\Content_Type_Visibility_Dismiss_Notifications;
use WP_REST_Request;
use WP_REST_Response;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Content_Type_Visibility\Application\Content_Type_Visibility_Dismiss_Notifications;
use Yoast\WP\SEO\Main;
use Yoast\WP\SEO\Routes\Route_Interface;
/**
* Handles the dismiss route for "New" badges of new content types in settings menu.
@@ -22,21 +22,21 @@ class Content_Type_Visibility_Dismiss_New_Route implements Route_Interface {
*
* @var string
*/
const ROUTE_PREFIX = 'new-content-type-visibility';
public const ROUTE_PREFIX = 'new-content-type-visibility';
/**
* Represents post type dismiss route.
*
* @var string
*/
const POST_TYPE_DISMISS_ROUTE = self::ROUTE_PREFIX . '/dismiss-post-type';
public const POST_TYPE_DISMISS_ROUTE = self::ROUTE_PREFIX . '/dismiss-post-type';
/**
* Represents taxonomy dismiss route.
*
* @var string
*/
const TAXONOMY_DISMISS_ROUTE = self::ROUTE_PREFIX . '/dismiss-taxonomy';
public const TAXONOMY_DISMISS_ROUTE = self::ROUTE_PREFIX . '/dismiss-taxonomy';
/**
* Holds the Options_Helper instance.
@@ -101,9 +101,11 @@ class Content_Type_Visibility_Dismiss_New_Route implements Route_Interface {
* @param string $param The parameter.
* @param WP_REST_Request $request Full details about the request.
* @param string $key The key.
*
* @return bool
*/
public function validate_post_type( $param, $request, $key ) {
return post_type_exists( $param );
return \post_type_exists( $param );
}
/**
@@ -128,9 +130,11 @@ class Content_Type_Visibility_Dismiss_New_Route implements Route_Interface {
* @param string $param The parameter.
* @param WP_REST_Request $request Full details about the request.
* @param string $key The key.
*
* @return bool
*/
public function validate_taxonomy( $param, $request, $key ) {
return taxonomy_exists( $param );
return \taxonomy_exists( $param );
}
/**

View File

@@ -306,7 +306,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Filter: 'wpseo_schema_company_name' - Allows filtering company name
*
* @api string $company_name.
* @param string $company_name.
*/
$company_name = \apply_filters( 'wpseo_schema_company_name', $this->options->get( 'company_name' ) );
@@ -341,7 +341,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Filter: 'wpseo_schema_person_logo_id' - Allows filtering person logo id.
*
* @api integer $person_logo_id.
* @param int $person_logo_id.
*/
return \apply_filters( 'wpseo_schema_person_logo_id', $person_logo_id );
}
@@ -362,7 +362,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Filter: 'wpseo_schema_person_logo_meta' - Allows filtering person logo meta.
*
* @api string $person_logo_meta.
* @param string $person_logo_meta.
*/
return \apply_filters( 'wpseo_schema_person_logo_meta', $person_logo_meta );
}
@@ -382,7 +382,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Filter: 'wpseo_schema_company_logo_id' - Allows filtering company logo id.
*
* @api integer $company_logo_id.
* @param int $company_logo_id.
*/
return \apply_filters( 'wpseo_schema_company_logo_id', $company_logo_id );
}
@@ -398,7 +398,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Filter: 'wpseo_schema_company_logo_meta' - Allows filtering company logo meta.
*
* @api string $company_logo_meta.
* @param string $company_logo_meta.
*/
return \apply_filters( 'wpseo_schema_company_logo_meta', $company_logo_meta );
}
@@ -541,7 +541,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Filter: 'wpseo_schema_webpage_type' - Allow changing the WebPage type.
*
* @api string|array $type The WebPage type.
* @param string|array $type The WebPage type.
*/
return \apply_filters( 'wpseo_schema_webpage_type', $type );
}

View File

@@ -43,6 +43,8 @@ class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
*
* @codeCoverageIgnore
* @deprecated 20.3
*
* @return void
*/
public function enqueue_help_scout_script() {
_deprecated_function( __METHOD__, 'Yoast SEO 20.3', 'HelpScout_Beacon::enqueue_help_scout_script' );
@@ -53,6 +55,8 @@ class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
*
* @codeCoverageIgnore
* @deprecated 20.3
*
* @return void
*/
public function output_beacon_js() {
_deprecated_function( __METHOD__, 'Yoast SEO 20.3', 'HelpScout_Beacon::output_beacon_js' );

View File

@@ -140,6 +140,8 @@ class WPSEO_Frontend {
/**
* Outputs the meta robots value.
*
* @return void
*/
public function robots() {
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
@@ -223,6 +225,8 @@ class WPSEO_Frontend {
* Adds 'prev' and 'next' links to archives.
*
* @link http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
*
* @return void
*/
public function adjacent_rel_links() {
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );

View File

@@ -375,7 +375,7 @@ class Indexables_Page_Action {
$ignore_list = \array_values(
\array_filter(
$ignore_list,
static function( $indexable ) use ( $indexable_id ) {
static function ( $indexable ) use ( $indexable_id ) {
return $indexable !== $indexable_id;
}
)

View File

@@ -13,9 +13,9 @@ use Yoast\WP\SEO\Helpers\User_Helper;
*/
class Settings_Introduction_Action {
const USER_META_KEY = '_yoast_settings_introduction';
public const USER_META_KEY = '_yoast_settings_introduction';
const DEFAULT_VALUES = [
public const DEFAULT_VALUES = [
'wistia_embed_permission' => false,
'show' => true,
];

View File

@@ -15,28 +15,28 @@ class Indexables_Page_Helper {
*
* @var int
*/
const LIST_SIZE = 5;
public const LIST_SIZE = 5;
/**
* The default size of the buffer, in terms of how many times is bigger than the list size.
*
* @var int
*/
const BUFFER_SIZE = 20;
public const BUFFER_SIZE = 20;
/**
* The default minimum threshold for the amount of posts in the site.
*
* @var int
*/
const POSTS_THRESHOLD = 20;
public const POSTS_THRESHOLD = 20;
/**
* The default minimum threshold for the amount of analysed posts in the site, as a fraction of the total posts.
*
* @var float
*/
const ANALYSED_POSTS_THRESHOLD = 0.5;
public const ANALYSED_POSTS_THRESHOLD = 0.5;
/**
* The options helper.
@@ -73,7 +73,7 @@ class Indexables_Page_Helper {
/**
* Filter 'wpseo_indexables_list_size' - Allow filtering the size of the Indexables lists.
*
* @api int The size of the Indexables lists.
* @param int $list_size The size of the Indexables lists.
*/
return \apply_filters_deprecated( 'wpseo_indexables_list_size', [ self::LIST_SIZE ], 'Yoast SEO 20.4' );
}
@@ -92,7 +92,7 @@ class Indexables_Page_Helper {
/**
* Filter 'wpseo_indexables_buffer_size' - Allow filtering the size of the buffer for the Indexables lists, in terms of how many times bigger it is from the lists' size.
*
* @api int The size of the buffer for the Indexables lists, in terms of how many times bigger it is from the lists' size.
* @param int $buffer_size The size of the buffer for the Indexables lists, in terms of how many times bigger it is from the lists' size.
*/
$times = \apply_filters_deprecated( 'wpseo_indexables_buffer_size', [ self::BUFFER_SIZE ], 'Yoast SEO 20.4' );
if ( $times < 3 ) {
@@ -116,7 +116,7 @@ class Indexables_Page_Helper {
/**
* Filter 'wpseo_posts_threshold' - Allow filtering the minimum threshold for the amount of posts in the site, in order for Indexable lists to be relevant.
*
* @api int The minimum threshold for the amount of posts in the site, in order for Indexable lists to be relevant.
* @param int $post_threshold The minimum threshold for the amount of posts in the site, in order for Indexable lists to be relevant.
*/
return \apply_filters_deprecated( 'wpseo_posts_threshold', [ self::POSTS_THRESHOLD ], 'Yoast SEO 20.4' );
}
@@ -135,7 +135,7 @@ class Indexables_Page_Helper {
/**
* Filter 'wpseo_analyzed_posts_threshold' - Allow filtering the minimum threshold for the amount of analyzed posts in the site, in order for Indexable lists to be relevant.
*
* @api int The minimum threshold for the amount of analyzed posts in the site, in order for Indexable lists to be relevant.
* @param int $analysed_post_threshold The minimum threshold for the amount of analyzed posts in the site, in order for Indexable lists to be relevant.
*/
return \apply_filters_deprecated( 'wpseo_analyzed_posts_threshold', [ self::ANALYSED_POSTS_THRESHOLD ], 'Yoast SEO 20.4' );
}

View File

@@ -134,6 +134,8 @@ class Indexables_Page_Integration implements Integration_Interface {
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return void
*/
public function enqueue_assets() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );

View File

@@ -65,6 +65,8 @@ class Social_Templates_Integration implements Integration_Interface {
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @return void
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -108,6 +110,8 @@ class Social_Templates_Integration implements Integration_Interface {
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
*
* @return void
*/
public function social_author_archives( $yform ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -125,6 +129,8 @@ class Social_Templates_Integration implements Integration_Interface {
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
*
* @return void
*/
public function social_date_archives( $yform ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -143,6 +149,8 @@ class Social_Templates_Integration implements Integration_Interface {
*
* @param Yoast_Form $yform The form builder.
* @param string $post_type_name The name of the current post_type that gets the social fields added.
*
* @return void
*/
public function social_post_type( $yform, $post_type_name ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -164,6 +172,8 @@ class Social_Templates_Integration implements Integration_Interface {
*
* @param Yoast_Form $yform The form builder.
* @param string $post_type_name The name of the current post_type that gets the social fields added.
*
* @return void
*/
public function social_post_types_archive( $yform, $post_type_name ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -182,6 +192,8 @@ class Social_Templates_Integration implements Integration_Interface {
*
* @param Yoast_Form $yform The form builder.
* @param WP_Taxonomy $taxonomy The taxonomy that gets the social fields added.
*
* @return void
*/
public function social_taxonomies( $yform, $taxonomy ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -199,6 +211,8 @@ class Social_Templates_Integration implements Integration_Interface {
* @param string $identifier A page-wide unique identifier for data storage and unique DOM elements.
* @param string $page_type_recommended Recommended type of page for a list of replaceable variables.
* @param string $page_type_specific Editor specific type of page for a list of replaceable variables.
*
* @return void
*/
protected function build_social_fields( Yoast_Form $yform, $identifier, $page_type_recommended, $page_type_specific ) {
$image_url_field_id = 'social-image-url-' . $identifier;

View File

@@ -113,18 +113,10 @@ class Schema_Blocks implements Integration_Interface {
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @return void
*/
public function output() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
}
/**
* Loads the translations and localizes the schema-blocks script file.
*
* @codeCoverageIgnore
* @deprecated 18.0
*/
public function load_translations() {
\_deprecated_function( __FUNCTION__, '18.0' );
}
}

View File

@@ -81,6 +81,8 @@ class Wincher implements Integration_Interface {
* @codeCoverageIgnore
*
* @param Yoast_Feature_Toggle $integration The integration toggle class.
*
* @return void
*/
public function after_integration_toggle( $integration ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 21.6' );
@@ -93,6 +95,8 @@ class Wincher implements Integration_Interface {
* @codeCoverageIgnore
*
* @param Yoast_Feature_Toggle $integration The integration toggle class.
*
* @return void
*/
public function after_network_integration_toggle( $integration ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 21.6' );

View File

@@ -100,6 +100,8 @@ class Wordproof_Integration_Toggle implements Integration_Interface {
* @codeCoverageIgnore
*
* @param Yoast_Feature_Toggle $integration The integration toggle class.
*
* @return void
*/
public function after_integration_toggle( $integration ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
@@ -127,6 +129,8 @@ class Wordproof_Integration_Toggle implements Integration_Interface {
* Add an explainer when the network integration toggle is disabled.
*
* @param Yoast_Feature_Toggle $integration The integration toggle class.
*
* @return void
*/
public function after_network_integration_toggle( $integration ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 21.6' );

View File

@@ -23,77 +23,77 @@ class Indexables_Page_Route implements Route_Interface {
*
* @var string
*/
const SETUP_INFO = '/setup_info';
public const SETUP_INFO = '/setup_info';
/**
* Represents the least readability route.
*
* @var string
*/
const LEAST_READABILITY_ROUTE = '/least_readability';
public const LEAST_READABILITY_ROUTE = '/least_readability';
/**
* Represents the least SEO score route.
*
* @var string
*/
const LEAST_SEO_SCORE_ROUTE = '/least_seo_score';
public const LEAST_SEO_SCORE_ROUTE = '/least_seo_score';
/**
* Represents the most linked route.
*
* @var string
*/
const MOST_LINKED_ROUTE = '/most_linked';
public const MOST_LINKED_ROUTE = '/most_linked';
/**
* Represents the least linked route.
*
* @var string
*/
const LEAST_LINKED_ROUTE = '/least_linked';
public const LEAST_LINKED_ROUTE = '/least_linked';
/**
* Allows to mark an indexable to be ignored.
*
* @var string
*/
const UPDATE_IGNORED_INDEXABLES_ROUTE = '/update_ignored_indexables';
public const UPDATE_IGNORED_INDEXABLES_ROUTE = '/update_ignored_indexables';
/**
* Allows to restore an indexable previously ignored.
*
* @var string
*/
const RESTORE_INDEXABLE_ROUTE = '/restore_indexable';
public const RESTORE_INDEXABLE_ROUTE = '/restore_indexable';
/**
* Allows to restore all indexables previously ignored.
*
* @var string
*/
const RESTORE_ALL_INDEXABLES_ROUTE = '/restore_all_indexables';
public const RESTORE_ALL_INDEXABLES_ROUTE = '/restore_all_indexables';
/**
* Allows to restore all indexables previously ignored for a certain list.
*
* @var string
*/
const RESTORE_ALL_INDEXABLES_FOR_LIST_ROUTE = '/restore_all_indexables_for_list';
public const RESTORE_ALL_INDEXABLES_FOR_LIST_ROUTE = '/restore_all_indexables_for_list';
/**
* Gets the reading list state.
*
* @var string
*/
const GET_READING_LIST_STATE = '/get_reading_list';
public const GET_READING_LIST_STATE = '/get_reading_list';
/**
* Sets the reading list state.
*
* @var string
*/
const SET_READING_LIST_STATE = '/set_reading_list';
public const SET_READING_LIST_STATE = '/set_reading_list';
/**
* The indexable actions.

View File

@@ -23,21 +23,21 @@ class Settings_Introduction_Route implements Route_Interface {
*
* @var string
*/
const ROUTE_PREFIX = '/settings_introduction';
public const ROUTE_PREFIX = '/settings_introduction';
/**
* Represents the Wistia embed permission.
*
* @var string
*/
const WISTIA_EMBED_PERMISSION = self::ROUTE_PREFIX . '/wistia_embed_permission';
public const WISTIA_EMBED_PERMISSION = self::ROUTE_PREFIX . '/wistia_embed_permission';
/**
* Represents showing the introduction.
*
* @var string
*/
const SHOW = self::ROUTE_PREFIX . '/show';
public const SHOW = self::ROUTE_PREFIX . '/show';
/**
* Holds the Settings_Introduction_Action.

View File

@@ -17,17 +17,17 @@ class Icons {
/**
* Represents the start of the SVG tag.
*/
const SVG_START_TAG = "<svg xmlns='http://www.w3.org/2000/svg' fill='none' style='fill:none' viewBox='0 0 24 24' stroke='currentColor' height='%SIZE%' width='%SIZE%' >";
public const SVG_START_TAG = "<svg xmlns='http://www.w3.org/2000/svg' fill='none' style='fill:none' viewBox='0 0 24 24' stroke='currentColor' height='%SIZE%' width='%SIZE%' >";
/**
* The default height and width of an icon.
*/
const SIZE_DEFAULT = 24;
public const SIZE_DEFAULT = 24;
/**
* The height and width of an icon in a variation picker.
*/
const SIZE_VARIATION = 36;
public const SIZE_VARIATION = 36;
/**
* The Heroicons academic cap svg icon.

View File

@@ -13,7 +13,7 @@ class Post_Not_Built_Exception extends Not_Built_Exception {
*
* @param int $post_id ID of the post.
*
* @throws Post_Not_Built_Exception When the post is not indexable.
* @return Post_Not_Built_Exception
*/
public static function because_not_indexable( $post_id ) {
/* translators: %s: expands to the post id */
@@ -25,7 +25,7 @@ class Post_Not_Built_Exception extends Not_Built_Exception {
*
* @param int $post_id ID of the post.
*
* @throws Post_Not_Built_Exception When the post type is excluded.
* @return Post_Not_Built_Exception
*/
public static function because_post_type_excluded( $post_id ) {
/* translators: %s: expands to the post id */

View File

@@ -13,7 +13,7 @@ class Post_Type_Not_Built_Exception extends Not_Built_Exception {
*
* @param string $post_type The post type.
*
* @throws Post_Type_Not_Built_Exception When the post type is not indexable.
* @return Post_Type_Not_Built_Exception
*/
public static function because_not_indexable( $post_type ) {
/* translators: %s: expands to the post type */

View File

@@ -13,7 +13,7 @@ class Term_Not_Built_Exception extends Not_Built_Exception {
*
* @param int $term_id ID of the term.
*
* @throws Term_Not_Built_Exception When the term is not built.
* @return Term_Not_Built_Exception
*/
public static function because_not_indexable( $term_id ) {
/* translators: %s: expands to the term id */

View File

@@ -9,7 +9,7 @@ use Exception;
*/
class Failed_Storage_Exception extends Exception {
const DEFAULT_MESSAGE = 'Token storing failed. Please try again.';
public const DEFAULT_MESSAGE = 'Token storing failed. Please try again.';
/**
* Failed_Storage_Exception constructor.

View File

@@ -1 +1 @@
<?php return array('reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => '12182ae0a212b06fdd280a55ecf73744'), 'analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'fac137b503b16899b5ca746abda81471'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-react-select', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'ac9328f28e30f198d9e2d87e2c5dce84'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e31079ea733c63b5c6d6beb19648e8dd'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => '9419e6f0040a66a3a62429d7c2b89773'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-draft-js-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '1d25cad55481d205ce1932431062b2a5'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'bc65ddc57a58eda0552d745784be6af5'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'fd9577d451151c11845c5389a5584646'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => '5990e0e44726b9493b0e4e16d76f7e58'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => '69a3938cf99bd9231f5ff73703244211'), 'chart.js.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f19164afd9b3f6267a7d0fe22ec28c17'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'ba9f44fcd9ccb5896f9c03a7a95aec85'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b9a5413d15ff8168fa70ddf19ee0c6ff'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b1e0d995706673946d80aa5c218c5a9b'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => '1f1e314b2b6a9e4a288f725fd3e76f82'), 'redux.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '7ccfae4f1b9d0d83b9702b2d265aec0a'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => 'b5f301c39577731227d9e86189ed3989'), 'components.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-report-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-jed-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-search-metadata-previews-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'b462e7623e085a9db118c343f7760981'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => '03698316c12604bfe25db12c1bc85b94'));
<?php return array('reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => '7b1d457a2bb74008e9d5dc825bf4ffee'), 'analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '3da0a1534f032fd1d93dd68640b0ae7d'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-react-select', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'cfc4110e2731f88fa98a79bdd9bfbea6'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'da2a94d1aa004c8f82293a439727e9c2'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => '33de598883eb2ecb2f37e57aa7d8b526'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-draft-js-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '991bc77e067128be49654a851ad34c96'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '33c3725096f0692f3b800cc5fe63377a'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'c3adb86cb1a0125b5d466bfeecdbe356'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => 'e14d917b865498fe0d4e1b043a9c054b'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => '538bad97e86caa3082dd32b866d71efd'), 'chart.js.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'ec419913bb5b7c66842141107387fa8e'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '57e3ec3e0be75be9ae305d85aede87c1'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'ab9ae4f1d8d72c555bdd4a654c85fa20'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f62c8cfc745b688b458e026846e3fb0d'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => '3678b7c6efc5751cfdb7b32085645eed'), 'redux.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '73ed60e5a3677a7350b55c88e8bef1c4'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => '77610b98d9ce5d7e8490cd8aba5582f7'), 'components.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-report-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-jed-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-search-metadata-previews-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'ad3c948e2e99cc68e9a0800c5ae5004f'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => 'a95b12dac49ef5655eceb9b989dfbf80'));

File diff suppressed because one or more lines are too long

View File

@@ -114,9 +114,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\conditionals\\settings_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Settings_Conditional',
'yoast\\wp\\seo\\conditionals\\should_index_links_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Should_Index_Links_Conditional',
'yoast\\wp\\seo\\conditionals\\text_formality_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Text_Formality_Conditional',
'yoast\\wp\\seo\\conditionals\\the_events_calendar_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\The_Events_Calendar_Conditional',
'yoast\\wp\\seo\\conditionals\\third_party\\coauthors_plus_activated_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Activated_Conditional',
'yoast\\wp\\seo\\conditionals\\third_party\\coauthors_plus_flag_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Flag_Conditional',
'yoast\\wp\\seo\\conditionals\\third_party\\elementor_activated_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\Elementor_Activated_Conditional',
'yoast\\wp\\seo\\conditionals\\third_party\\elementor_edit_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\Elementor_Edit_Conditional',
'yoast\\wp\\seo\\conditionals\\third_party\\jetpack_boost_active_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\Jetpack_Boost_Active_Conditional',
@@ -193,8 +190,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\generators\\schema\\main_image' => 'Yoast\\WP\\SEO\\Generators\\Schema\\Main_Image',
'yoast\\wp\\seo\\generators\\schema\\organization' => 'Yoast\\WP\\SEO\\Generators\\Schema\\Organization',
'yoast\\wp\\seo\\generators\\schema\\person' => 'Yoast\\WP\\SEO\\Generators\\Schema\\Person',
'yoast\\wp\\seo\\generators\\schema\\third_party\\coauthor' => 'Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\CoAuthor',
'yoast\\wp\\seo\\generators\\schema\\third_party\\events_calendar_schema' => 'Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\Events_Calendar_Schema',
'yoast\\wp\\seo\\generators\\schema\\webpage' => 'Yoast\\WP\\SEO\\Generators\\Schema\\WebPage',
'yoast\\wp\\seo\\generators\\schema\\website' => 'Yoast\\WP\\SEO\\Generators\\Schema\\Website',
'yoast\\wp\\seo\\generators\\schema_generator' => 'Yoast\\WP\\SEO\\Generators\\Schema_Generator',
@@ -331,12 +326,10 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\integrations\\support_integration' => 'Yoast\\WP\\SEO\\Integrations\\Support_Integration',
'yoast\\wp\\seo\\integrations\\third_party\\amp' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\AMP',
'yoast\\wp\\seo\\integrations\\third_party\\bbpress' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\BbPress',
'yoast\\wp\\seo\\integrations\\third_party\\coauthors_plus' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\CoAuthors_Plus',
'yoast\\wp\\seo\\integrations\\third_party\\elementor' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Elementor',
'yoast\\wp\\seo\\integrations\\third_party\\exclude_elementor_post_types' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Exclude_Elementor_Post_Types',
'yoast\\wp\\seo\\integrations\\third_party\\exclude_woocommerce_post_types' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Exclude_WooCommerce_Post_Types',
'yoast\\wp\\seo\\integrations\\third_party\\jetpack' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Jetpack',
'yoast\\wp\\seo\\integrations\\third_party\\the_events_calendar' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\The_Events_Calendar',
'yoast\\wp\\seo\\integrations\\third_party\\w3_total_cache' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\W3_Total_Cache',
'yoast\\wp\\seo\\integrations\\third_party\\web_stories' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Web_Stories',
'yoast\\wp\\seo\\integrations\\third_party\\web_stories_post_edit' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Web_Stories_Post_Edit',
@@ -545,9 +538,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Conditionals\\Settings_Conditional' => 'getSettingsConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Should_Index_Links_Conditional' => 'getShouldIndexLinksConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Text_Formality_Conditional' => 'getTextFormalityConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\The_Events_Calendar_Conditional' => 'getTheEventsCalendarConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Activated_Conditional' => 'getCoAuthorsPlusActivatedConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Flag_Conditional' => 'getCoAuthorsPlusFlagConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\Elementor_Activated_Conditional' => 'getElementorActivatedConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\Elementor_Edit_Conditional' => 'getElementorEditConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Third_Party\\Jetpack_Boost_Active_Conditional' => 'getJetpackBoostActiveConditionalService',
@@ -624,8 +614,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Generators\\Schema\\Main_Image' => 'getMainImageService',
'Yoast\\WP\\SEO\\Generators\\Schema\\Organization' => 'getOrganizationService',
'Yoast\\WP\\SEO\\Generators\\Schema\\Person' => 'getPersonService',
'Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\CoAuthor' => 'getCoAuthorService',
'Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\Events_Calendar_Schema' => 'getEventsCalendarSchemaService',
'Yoast\\WP\\SEO\\Generators\\Schema\\WebPage' => 'getWebPageService',
'Yoast\\WP\\SEO\\Generators\\Schema\\Website' => 'getWebsiteService',
'Yoast\\WP\\SEO\\Generators\\Schema_Generator' => 'getSchemaGeneratorService',
@@ -762,12 +750,10 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Integrations\\Support_Integration' => 'getSupportIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\AMP' => 'getAMPService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\BbPress' => 'getBbPressService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\CoAuthors_Plus' => 'getCoAuthorsPlusService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Elementor' => 'getElementorService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Exclude_Elementor_Post_Types' => 'getExcludeElementorPostTypesService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Exclude_WooCommerce_Post_Types' => 'getExcludeWooCommercePostTypesService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\Jetpack' => 'getJetpackService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\The_Events_Calendar' => 'getTheEventsCalendarService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\W3_Total_Cache' => 'getW3TotalCacheService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\WPML' => 'getWPMLService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\WPML_WPSEO_Notification' => 'getWPMLWPSEONotificationService',
@@ -2063,48 +2049,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Text_Formality_Conditional'] = new \Yoast\WP\SEO\Conditionals\Text_Formality_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\The_Events_Calendar_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\The_Events_Calendar_Conditional
*
* @deprecated Yoast\WP\SEO\Conditionals\The_Events_Calendar_Conditional is deprecated since version 19.12!
*/
protected function getTheEventsCalendarConditionalService()
{
@trigger_error('Yoast\\WP\\SEO\\Conditionals\\The_Events_Calendar_Conditional is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Conditionals\\The_Events_Calendar_Conditional'] = new \Yoast\WP\SEO\Conditionals\The_Events_Calendar_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Activated_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Activated_Conditional
*
* @deprecated Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Activated_Conditional is deprecated since version 19.12!
*/
protected function getCoAuthorsPlusActivatedConditionalService()
{
@trigger_error('Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Activated_Conditional is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Activated_Conditional'] = new \Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Activated_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Flag_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Flag_Conditional
*
* @deprecated Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Flag_Conditional is deprecated since version 19.12!
*/
protected function getCoAuthorsPlusFlagConditionalService()
{
@trigger_error('Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Flag_Conditional is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Third_Party\\CoAuthors_Plus_Flag_Conditional'] = new \Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Flag_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Third_Party\Elementor_Activated_Conditional' shared autowired service.
*
@@ -2855,34 +2799,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Generators\\Schema\\Person'] = new \Yoast\WP\SEO\Generators\Schema\Person();
}
/**
* Gets the public 'Yoast\WP\SEO\Generators\Schema\Third_Party\CoAuthor' shared autowired service.
*
* @return \Yoast\WP\SEO\Generators\Schema\Third_Party\CoAuthor
*
* @deprecated Yoast\WP\SEO\Generators\Schema\Third_Party\CoAuthor is deprecated since version 19.12!
*/
protected function getCoAuthorService()
{
@trigger_error('Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\CoAuthor is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\CoAuthor'] = new \Yoast\WP\SEO\Generators\Schema\Third_Party\CoAuthor();
}
/**
* Gets the public 'Yoast\WP\SEO\Generators\Schema\Third_Party\Events_Calendar_Schema' shared autowired service.
*
* @return \Yoast\WP\SEO\Generators\Schema\Third_Party\Events_Calendar_Schema
*
* @deprecated Yoast\WP\SEO\Generators\Schema\Third_Party\Events_Calendar_Schema is deprecated since version 19.12!
*/
protected function getEventsCalendarSchemaService()
{
@trigger_error('Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\Events_Calendar_Schema is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Generators\\Schema\\Third_Party\\Events_Calendar_Schema'] = new \Yoast\WP\SEO\Generators\Schema\Third_Party\Events_Calendar_Schema();
}
/**
* Gets the public 'Yoast\WP\SEO\Generators\Schema\WebPage' shared autowired service.
*
@@ -4302,20 +4218,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\Third_Party\\BbPress'] = new \Yoast\WP\SEO\Integrations\Third_Party\BbPress(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Third_Party\CoAuthors_Plus' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Third_Party\CoAuthors_Plus
*
* @deprecated Yoast\WP\SEO\Integrations\Third_Party\CoAuthors_Plus is deprecated since version 19.12!
*/
protected function getCoAuthorsPlusService()
{
@trigger_error('Yoast\\WP\\SEO\\Integrations\\Third_Party\\CoAuthors_Plus is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Integrations\\Third_Party\\CoAuthors_Plus'] = new \Yoast\WP\SEO\Integrations\Third_Party\CoAuthors_Plus(${($_ = isset($this->services['Yoast\\WP\\SEO\\Surfaces\\Helpers_Surface']) ? $this->services['Yoast\\WP\\SEO\\Surfaces\\Helpers_Surface'] : $this->getHelpersSurfaceService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Third_Party\Elementor' shared autowired service.
*
@@ -4356,20 +4258,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\Third_Party\\Jetpack'] = new \Yoast\WP\SEO\Integrations\Third_Party\Jetpack();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Third_Party\The_Events_Calendar' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Third_Party\The_Events_Calendar
*
* @deprecated Yoast\WP\SEO\Integrations\Third_Party\The_Events_Calendar is deprecated since version 19.12!
*/
protected function getTheEventsCalendarService()
{
@trigger_error('Yoast\\WP\\SEO\\Integrations\\Third_Party\\The_Events_Calendar is deprecated since version 19.12!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Integrations\\Third_Party\\The_Events_Calendar'] = new \Yoast\WP\SEO\Integrations\Third_Party\The_Events_Calendar();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Third_Party\W3_Total_Cache' shared autowired service.
*

View File

@@ -208,14 +208,13 @@ class Breadcrumbs_Generator implements Generator_Interface {
$crumbs = $filtered_crumbs;
}
$filter_callback = static function( $link_info, $index ) use ( $crumbs ) {
$filter_callback = static function ( $link_info, $index ) use ( $crumbs ) {
/**
* Filter: 'wpseo_breadcrumb_single_link_info' - Allow developers to filter the Yoast SEO Breadcrumb link information.
*
* @api array $link_info The breadcrumb link information.
*
* @param int $index The index of the breadcrumb in the list.
* @param array $crumbs The complete list of breadcrumbs.
* @param array $link_info The breadcrumb link information.
* @param int $index The index of the breadcrumb in the list.
* @param array $crumbs The complete list of breadcrumbs.
*/
return \apply_filters( 'wpseo_breadcrumb_single_link_info', $link_info, $index, $crumbs );
};

View File

@@ -84,7 +84,7 @@ class Open_Graph_Image_Generator implements Generator_Interface {
/**
* Filter: wpseo_add_opengraph_images - Allow developers to add images to the Open Graph tags.
*
* @api Yoast\WP\SEO\Values\Open_Graph\Images The current object.
* @param Yoast\WP\SEO\Values\Open_Graph\Images $image_container The current object.
*/
\apply_filters( 'wpseo_add_opengraph_images', $image_container );
} catch ( Error $error ) {
@@ -98,7 +98,7 @@ class Open_Graph_Image_Generator implements Generator_Interface {
/**
* Filter: wpseo_add_opengraph_additional_images - Allows to add additional images to the Open Graph tags.
*
* @api Yoast\WP\SEO\Values\Open_Graph\Images The current object.
* @param Yoast\WP\SEO\Values\Open_Graph\Images $image_container The current object.
*/
\apply_filters( 'wpseo_add_opengraph_additional_images', $image_container );
} catch ( Error $error ) {
@@ -137,6 +137,8 @@ class Open_Graph_Image_Generator implements Generator_Interface {
*
* @param Indexable $indexable The indexable.
* @param Images $image_container The image container.
*
* @return void
*/
protected function add_from_indexable( Indexable $indexable, Images $image_container ) {
if ( $indexable->open_graph_image_meta ) {
@@ -170,6 +172,8 @@ class Open_Graph_Image_Generator implements Generator_Interface {
* Retrieves the default Open Graph image.
*
* @param Images $image_container The image container.
*
* @return void
*/
protected function add_from_default( Images $image_container ) {
if ( $image_container->has_images() ) {
@@ -194,6 +198,8 @@ class Open_Graph_Image_Generator implements Generator_Interface {
*
* @param Meta_Tags_Context $context The context.
* @param Images $image_container The image container.
*
* @return void
*/
protected function add_from_templates( Meta_Tags_Context $context, Images $image_container ) {
if ( $image_container->has_images() ) {

View File

@@ -22,7 +22,7 @@ class Open_Graph_Locale_Generator implements Generator_Interface {
*
* Note that this filter is different from `wpseo_og_locale`, which is run _after_ the OG specific filtering.
*
* @api string Locale string.
* @param string $locale Locale string.
*/
$locale = \apply_filters( 'wpseo_locale', \get_locale() );

View File

@@ -57,7 +57,6 @@ class Schema_Generator implements Generator_Interface {
/**
* Filter: 'wpseo_pre_schema_block_type_<block-type>' - Allows hooking things to change graph output based on the blocks on the page.
*
* @param string $block_type The block type.
* @param WP_Block_Parser_Block[] $blocks All the blocks of this block type.
* @param Meta_Tags_Context $context A value object with context variables.
*/
@@ -102,7 +101,7 @@ class Schema_Generator implements Generator_Interface {
/**
* Filter: 'wpseo_schema_needs_<identifier>' - Allows changing which graph pieces we output.
*
* @api bool $is_needed Whether or not to show a graph piece.
* @param bool $is_needed Whether or not to show a graph piece.
*/
$is_needed = \apply_filters( 'wpseo_schema_needs_' . $identifier, $piece->is_needed() );
if ( ! $is_needed ) {
@@ -141,10 +140,9 @@ class Schema_Generator implements Generator_Interface {
* Filter: 'wpseo_schema_<identifier>' - Allows changing graph piece output.
* This filter can be called with either an identifier or a block type (see `add_schema_blocks_graph_pieces()`).
*
* @api array $graph_piece The graph piece to filter.
*
* @param Meta_Tags_Context $context A value object with context variables.
* @param Abstract_Schema_Piece $graph_piece_generator A value object with context variables.
* @param array $graph_piece The graph piece to filter.
* @param Meta_Tags_Context $context A value object with context variables.
* @param Abstract_Schema_Piece $graph_piece_generator A value object with context variables.
* @param Abstract_Schema_Piece[] $graph_piece_generators A value object with context variables.
*/
$graph_piece = \apply_filters( 'wpseo_schema_' . $identifier, $graph_piece, $context, $graph_piece_generator, $graph_piece_generators );
@@ -160,8 +158,7 @@ class Schema_Generator implements Generator_Interface {
/**
* Filter: 'wpseo_schema_graph' - Allows changing graph output.
*
* @api array $graph The graph to filter.
*
* @param array $graph The graph to filter.
* @param Meta_Tags_Context $context A value object with context variables.
*/
$graph = \apply_filters( 'wpseo_schema_graph', $graph, $context );
@@ -322,9 +319,8 @@ class Schema_Generator implements Generator_Interface {
/**
* Filter: 'wpseo_schema_graph_pieces' - Allows adding pieces to the graph.
*
* @param array $pieces The schema pieces.
* @param Meta_Tags_Context $context An object with context variables.
*
* @api array $pieces The schema pieces.
*/
return \apply_filters( 'wpseo_schema_graph_pieces', $schema_pieces, $context );
}
@@ -353,10 +349,9 @@ class Schema_Generator implements Generator_Interface {
/**
* Filter: 'wpseo_schema_<type>' - Allows changing graph piece output by @type.
*
* @api array $graph_piece The graph piece to filter.
*
* @param Meta_Tags_Context $context A value object with context variables.
* @param Abstract_Schema_Piece $graph_piece_generator A value object with context variables.
* @param array $graph_piece The graph piece to filter.
* @param Meta_Tags_Context $context A value object with context variables.
* @param Abstract_Schema_Piece $graph_piece_generator A value object with context variables.
* @param Abstract_Schema_Piece[] $graph_piece_generators A value object with context variables.
*/
$graph_piece = \apply_filters( 'wpseo_schema_' . $type, $graph_piece, $context, $graph_piece_generator, $graph_piece_generators );

View File

@@ -91,7 +91,7 @@ class Article extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_article_keywords_taxonomy' - Allow changing the taxonomy used to assign keywords to a post type Article data.
*
* @api string $taxonomy The chosen taxonomy.
* @param string $taxonomy The chosen taxonomy.
*/
$taxonomy = \apply_filters( 'wpseo_schema_article_keywords_taxonomy', 'post_tag' );
@@ -109,7 +109,7 @@ class Article extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_article_sections_taxonomy' - Allow changing the taxonomy used to assign keywords to a post type Article data.
*
* @api string $taxonomy The chosen taxonomy.
* @param string $taxonomy The chosen taxonomy.
*/
$taxonomy = \apply_filters( 'wpseo_schema_article_sections_taxonomy', 'category' );
@@ -132,7 +132,7 @@ class Article extends Abstract_Schema_Piece {
return $data;
}
$callback = static function( $term ) {
$callback = static function ( $term ) {
// We are using the WordPress internal translation.
return $term->name !== \__( 'Uncategorized', 'default' );
};
@@ -176,7 +176,7 @@ class Article extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_article_potential_action_target' - Allows filtering of the schema Article potentialAction target.
*
* @api array $targets The URLs for the Article potentialAction target.
* @param array $targets The URLs for the Article potentialAction target.
*/
$targets = \apply_filters( 'wpseo_schema_article_potential_action_target', [ $this->context->canonical . '#respond' ] );

View File

@@ -82,7 +82,7 @@ class Author extends Person {
/**
* Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.
*
* @api int|bool $user_id The user ID currently determined.
* @param int|bool $user_id The user ID currently determined.
*/
$user_id = \apply_filters( 'wpseo_schema_person_user_id', $user_id );

View File

@@ -38,6 +38,8 @@ class HowTo extends Abstract_Schema_Piece {
*
* @param array $data Our How-To schema data.
* @param array $attributes The block data attributes.
*
* @return void
*/
private function add_duration( &$data, $attributes ) {
if ( empty( $attributes['hasDuration'] ) ) {
@@ -58,6 +60,8 @@ class HowTo extends Abstract_Schema_Piece {
*
* @param array $data Our How-To schema data.
* @param array $steps Our How-To block's steps.
*
* @return void
*/
private function add_steps( &$data, $steps ) {
foreach ( $steps as $step ) {
@@ -113,6 +117,8 @@ class HowTo extends Abstract_Schema_Piece {
*
* @param array $schema_step Our Schema output for the Step.
* @param string $json_text The step text.
*
* @return void
*/
private function add_step_description( &$schema_step, $json_text ) {
$schema_step['itemListElement'] = [
@@ -128,6 +134,8 @@ class HowTo extends Abstract_Schema_Piece {
*
* @param array $schema_step Our Schema output for the Step.
* @param array $step The step block data.
*
* @return void
*/
private function add_step_image( &$schema_step, $step ) {
if ( isset( $step['text'] ) && \is_array( $step['text'] ) ) {
@@ -145,6 +153,8 @@ class HowTo extends Abstract_Schema_Piece {
* @param array $graph Our Schema data.
* @param array $block The How-To block content.
* @param int $index The index of the current block.
*
* @return void
*/
protected function add_how_to( &$graph, $block, $index ) {
$data = [

View File

@@ -73,7 +73,7 @@ class Organization extends Abstract_Schema_Piece {
* Filter: 'wpseo_schema_organization_social_profiles' - Allows filtering social profiles for the
* represented organization.
*
* @api string[] $profiles
* @param string[] $profiles
*/
$profiles = \apply_filters( 'wpseo_schema_organization_social_profiles', $profiles );

View File

@@ -72,7 +72,7 @@ class Person extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.
*
* @api int|bool $user_id The user ID currently determined.
* @param int|bool $user_id The user ID currently determined.
*/
$user_id = \apply_filters( 'wpseo_schema_person_user_id', $this->context->site_user_id );
@@ -96,10 +96,9 @@ class Person extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_person_social_profiles' - Allows filtering of social profiles per user.
*
* @param int $user_id The current user we're grabbing social profiles for.
*
* @api string[] $social_profiles The array of social profiles to retrieve. Each should be a user meta field
* key. As they are retrieved using the WordPress function `get_the_author_meta`.
* @param string[] $social_profiles The array of social profiles to retrieve. Each should be a user meta field
* key. As they are retrieved using the WordPress function `get_the_author_meta`.
* @param int $user_id The current user we're grabbing social profiles for.
*/
$social_profiles = \apply_filters( 'wpseo_schema_person_social_profiles', $this->social_profiles, $user_id );
@@ -181,7 +180,7 @@ class Person extends Abstract_Schema_Piece {
}
if ( \is_array( $this->type ) && \in_array( 'Organization', $this->type, true ) ) {
$data_logo = isset( $data['image']['@id'] ) ? $data['image']['@id'] : $schema_id;
$data_logo = ( $data['image']['@id'] ?? $schema_id );
$data['logo'] = [ '@id' => $data_logo ];
}

View File

@@ -99,6 +99,8 @@ class WebPage extends Abstract_Schema_Piece {
* If we have an image, make it the primary image of the page.
*
* @param array $data WebPage schema data.
*
* @return array
*/
public function add_image( $data ) {
if ( $this->context->has_image ) {
@@ -138,7 +140,7 @@ class WebPage extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_webpage_potential_action_target' - Allows filtering of the schema WebPage potentialAction target.
*
* @api array $targets The URLs for the WebPage potentialAction target.
* @param array $targets The URLs for the WebPage potentialAction target.
*/
$targets = \apply_filters( 'wpseo_schema_webpage_potential_action_target', [ $url ] );

View File

@@ -71,7 +71,7 @@ class Website extends Abstract_Schema_Piece {
/**
* Filter: 'disable_wpseo_json_ld_search' - Allow disabling of the json+ld output.
*
* @api bool $display_search Whether or not to display json+ld search on the frontend.
* @param bool $display_search Whether or not to display json+ld search on the frontend.
*/
if ( \apply_filters( 'disable_wpseo_json_ld_search', false ) ) {
return $data;
@@ -80,7 +80,7 @@ class Website extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_json_ld_search_url' - Allows filtering of the search URL for Yoast SEO.
*
* @api string $search_url The search URL for this site with a `{search_term_string}` variable.
* @param string $search_url The search URL for this site with a `{search_term_string}` variable.
*/
$search_url = \apply_filters( 'wpseo_json_ld_search_url', $this->context->site_url . '?s={search_term_string}' );

Some files were not shown because too many files have changed in this diff Show More