rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -106,6 +106,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
"{$allow_prefix}remove_feed_global_comments" => true,
"{$allow_prefix}remove_feed_post_comments" => true,
"{$allow_prefix}enable_index_now" => true,
"{$allow_prefix}enable_ai_generator" => true,
"{$allow_prefix}remove_feed_authors" => true,
"{$allow_prefix}remove_feed_categories" => true,
"{$allow_prefix}remove_feed_tags" => true,
@@ -212,7 +213,6 @@ class WPSEO_Option_MS extends WPSEO_Option {
}
break;
case 'defaultblog':
if ( isset( $dirty[ $key ] ) && ( $dirty[ $key ] !== '' && $dirty[ $key ] !== '-' ) ) {
$int = WPSEO_Utils::validate_int( $dirty[ $key ] );

View File

@@ -331,7 +331,6 @@ class WPSEO_Option_Social extends WPSEO_Option {
}
unset( $old_option );
return $option_value;
}
}

View File

@@ -93,6 +93,14 @@ class WPSEO_Option_Titles extends WPSEO_Option {
'open_graph_frontpage_image' => '', // Text field.
'open_graph_frontpage_image_id' => 0,
'publishing_principles_id' => 0,
'ownership_funding_info_id' => 0,
'actionable_feedback_policy_id' => 0,
'corrections_policy_id' => 0,
'ethics_policy_id' => 0,
'diversity_policy_id' => 0,
'diversity_staffing_report_id' => 0,
/*
* Uses enrich_defaults to add more along the lines of:
* - 'title-' . $pt->name => ''; // Text field.
@@ -579,6 +587,13 @@ class WPSEO_Option_Titles extends WPSEO_Option {
case 'person_logo_id':
case 'social-image-id-':
case 'open_graph_frontpage_image_id':
case 'publishing_principles_id':
case 'ownership_funding_info_id':
case 'actionable_feedback_policy_id':
case 'corrections_policy_id':
case 'ethics_policy_id':
case 'diversity_policy_id':
case 'diversity_staffing_report_id':
if ( isset( $dirty[ $key ] ) ) {
$int = WPSEO_Utils::validate_int( $dirty[ $key ] );
if ( $int !== false && $int >= 0 ) {
@@ -592,7 +607,6 @@ class WPSEO_Option_Titles extends WPSEO_Option {
}
}
break;
/* Separator field - Radio. */
case 'separator':
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
@@ -764,13 +778,11 @@ class WPSEO_Option_Titles extends WPSEO_Option {
}
unset( $old_option );
// Fix wrongness created by buggy version 1.2.2.
if ( isset( $option_value['title-home'] ) && $option_value['title-home'] === '%%sitename%% - %%sitedesc%% - 12345' ) {
$option_value['title-home-wpseo'] = '%%sitename%% - %%sitedesc%%';
}
/*
* Renaming these options to avoid ever overwritting these if a (bloody stupid) user /
* programmer would use any of the following as a custom post type or custom taxonomy:
@@ -799,7 +811,6 @@ class WPSEO_Option_Titles extends WPSEO_Option {
}
unset( $rename, $old, $new );
/*
* {@internal This clean-up action can only be done effectively once the taxonomies
* and post_types have been registered, i.e. at the end of the init action.}}
@@ -953,11 +964,11 @@ class WPSEO_Option_Titles extends WPSEO_Option {
'label' => __( 'Dash', 'wordpress-seo' ),
],
'sc-ndash' => [
'option' => '–',
'option' => '–',
'label' => __( 'En dash', 'wordpress-seo' ),
],
'sc-mdash' => [
'option' => '—',
'option' => '—',
'label' => __( 'Em dash', 'wordpress-seo' ),
],
'sc-colon' => [
@@ -965,11 +976,11 @@ class WPSEO_Option_Titles extends WPSEO_Option {
'label' => __( 'Colon', 'wordpress-seo' ),
],
'sc-middot' => [
'option' => '·',
'option' => '·',
'label' => __( 'Middle dot', 'wordpress-seo' ),
],
'sc-bull' => [
'option' => '•',
'option' => '•',
'label' => __( 'Bullet', 'wordpress-seo' ),
],
'sc-star' => [
@@ -989,19 +1000,19 @@ class WPSEO_Option_Titles extends WPSEO_Option {
'label' => __( 'Small tilde', 'wordpress-seo' ),
],
'sc-laquo' => [
'option' => '«',
'option' => '«',
'label' => __( 'Left angle quotation mark', 'wordpress-seo' ),
],
'sc-raquo' => [
'option' => '»',
'option' => '»',
'label' => __( 'Right angle quotation mark', 'wordpress-seo' ),
],
'sc-lt' => [
'option' => '<',
'option' => '>',
'label' => __( 'Less than sign', 'wordpress-seo' ),
],
'sc-gt' => [
'option' => '>',
'option' => '<',
'label' => __( 'Greater than sign', 'wordpress-seo' ),
],
];

View File

@@ -58,6 +58,7 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'enable_xml_sitemap' => true,
'enable_text_link_counter' => true,
'enable_index_now' => true,
'enable_ai_generator' => false,
'show_onboarding_notice' => false,
'first_activated_on' => false,
'myyoast-oauth' => [
@@ -88,7 +89,6 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'configuration_finished_steps' => [],
'dismiss_configuration_workout_notice' => false,
'dismiss_premium_deactivated_notice' => false,
'dismiss_old_premium_version_notice' => '',
'importing_completed' => [],
'wincher_integration_active' => true,
'wincher_tokens' => [],
@@ -126,6 +126,7 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'search_character_limit' => 50,
'deny_search_crawling' => false,
'deny_wp_json_crawling' => false,
'deny_adsbot_crawling' => false,
'redirect_search_pretty_urls' => false,
'least_readability_ignore_list' => [],
'least_seo_score_ignore_list' => [],
@@ -136,6 +137,9 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'last_known_public_post_types' => [],
'last_known_public_taxonomies' => [],
'last_known_no_unindexed' => [],
'new_post_types' => [],
'new_taxonomies' => [],
'show_new_content_type_notification' => false,
];
/**
@@ -325,7 +329,6 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
case 'wincher_website_id':
case 'clean_permalinks_extra_variables':
case 'indexables_overview_state':
case 'dismiss_old_premium_version_notice':
if ( isset( $dirty[ $key ] ) ) {
$clean[ $key ] = $dirty[ $key ];
}
@@ -409,6 +412,8 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
case 'indexables_page_reading_list':
case 'last_known_public_post_types':
case 'last_known_public_taxonomies':
case 'new_post_types':
case 'new_taxonomies':
$clean[ $key ] = $old[ $key ];
if ( isset( $dirty[ $key ] ) ) {
@@ -505,8 +510,10 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
* 'search_cleanup_emoji'
* 'search_cleanup_patterns'
* 'deny_wp_json_crawling'
* 'deny_adsbot_crawling'
* 'redirect_search_pretty_urls'
* 'should_redirect_after_install_free'
* 'show_new_content_type_notification'
* and most of the feature variables.
*/
default:
@@ -553,6 +560,7 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'remove_feed_global_comments' => false,
'remove_feed_post_comments' => false,
'enable_index_now' => false,
'enable_ai_generator' => false,
'remove_feed_authors' => false,
'remove_feed_categories' => false,
'remove_feed_tags' => false,

View File

@@ -149,7 +149,6 @@ abstract class WPSEO_Option {
$this->add_default_filters(); // Return defaults if option not set.
$this->add_option_filters(); // Merge with defaults if option *is* set.
if ( $this->multisite_only !== true ) {
/**
* The option validation routines remove the default filters to prevent failing
@@ -181,7 +180,6 @@ abstract class WPSEO_Option {
add_action( 'update_site_option_' . $this->option_name, [ 'WPSEO_Options', 'clear_cache' ], 1, 0 );
}
/*
* Make sure the option will always get validated, independently of register_setting()
* (only available on back-end).
@@ -194,7 +192,6 @@ abstract class WPSEO_Option {
/* Register our option for the admin pages */
add_action( 'admin_init', [ $this, 'register_setting' ] );
/* Set option group name if not given */
if ( ! isset( $this->group_name ) || $this->group_name === '' ) {
$this->group_name = 'yoast_' . $this->option_name . '_options';

View File

@@ -59,7 +59,7 @@ class WPSEO_Options {
protected function __construct() {
$this->register_hooks();
foreach ( static::$options as $option_name => $option_class ) {
foreach ( static::$options as $option_class ) {
static::register_option( call_user_func( [ $option_class, 'get_instance' ] ) );
}
}
@@ -559,7 +559,6 @@ class WPSEO_Options {
private static function get_lookup_table() {
$lookup_table = [];
foreach ( array_keys( static::$options ) as $option_name ) {
$full_option = static::get_option( $option_name );
foreach ( $full_option as $key => $value ) {

View File

@@ -409,7 +409,6 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
return $tax_meta;
}
if ( isset( $tax_meta[ 'wpseo_' . $meta ] ) ) {
return $tax_meta[ 'wpseo_' . $meta ];
}
@@ -477,7 +476,6 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
public static function get_keyword_usage( $keyword, $current_term_id, $current_taxonomy ) {
$tax_meta = self::get_tax_meta();
$found = [];
// @todo Check for terms of all taxonomies, not only the current taxonomy.
foreach ( $tax_meta as $taxonomy_name => $terms ) {