plugin updates

This commit is contained in:
Tony Volpe
2024-10-11 13:25:50 -04:00
parent 5e5b879a68
commit a6fc17dcaa
391 changed files with 6812 additions and 4326 deletions

View File

@@ -587,10 +587,10 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
*/
protected function add_premium_link( WP_Admin_Bar $wp_admin_bar ) {
$sale_percentage = '';
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) {
$sale_percentage = sprintf(
'<span class="admin-bar-premium-promotion">%1$s</span>',
esc_html__( '-30%', 'wordpress-seo' )
esc_html__( '30% OFF', 'wordpress-seo' )
);
}
$wp_admin_bar->add_menu(

View File

@@ -35,11 +35,11 @@ class WPSEO_Content_Images {
}
$content_images = $this->get_img_tags_from_content( $content );
$images = array_map( [ $this, 'get_img_tag_source' ], $content_images );
$images = array_filter( $images );
$images = array_unique( $images );
$images = array_values( $images ); // Reset the array keys.
$images = array_map( [ $this, 'get_img_tag_source' ], $content_images );
$images = array_filter( $images );
$images = array_unique( $images );
$images = array_values( $images ); // Reset the array keys.
return $images;
}

View File

@@ -77,7 +77,6 @@ class WPSEO_Meta {
* Array format:
* (required) 'type' => (string) field type. i.e. text / textarea / checkbox /
* radio / select / multiselect / upload etc.
* (required) 'title' => (string) table row title.
* (recommended) 'default_value' => (string|array) default value for the field.
* IMPORTANT:
* - if the field has options, the default has to be the
@@ -94,11 +93,7 @@ class WPSEO_Meta {
* (optional) 'autocomplete' => (bool) whether autocomplete is on for text fields,
* defaults to true.
* (optional) 'class' => (string) classname(s) to add to the actual <input> tag.
* (optional) 'description' => (string) description to show underneath the field.
* (optional) 'expl' => (string) label for a checkbox.
* (optional) 'help' => (string) help text to show on mouse over ? image.
* (optional) 'rows' => (int) number of rows for a textarea, defaults to 3.
* (optional) 'placeholder' => (string) Currently only used by add-on plugins.
* (optional) 'serialized' => (bool) whether the value is expected to be serialized,
* i.e. an array or object, defaults to false.
* Currently only used by add-on plugins.
@@ -111,105 +106,79 @@ class WPSEO_Meta {
],
'title' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
'help' => '', // Translation added later.
],
'metadesc' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
'class' => 'metadesc',
'rows' => 2,
'description' => '', // Translation added later.
'help' => '', // Translation added later.
],
'linkdex' => [
'type' => 'hidden',
'title' => 'linkdex',
'default_value' => '0',
'description' => '',
],
'content_score' => [
'type' => 'hidden',
'title' => 'content_score',
'default_value' => '0',
'description' => '',
],
'inclusive_language_score' => [
'type' => 'hidden',
'title' => 'inclusive_language_score',
'default_value' => '0',
'description' => '',
],
'is_cornerstone' => [
'type' => 'hidden',
'title' => 'is_cornerstone',
'default_value' => 'false',
'description' => '',
],
],
'advanced' => [
'meta-robots-noindex' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '0', // = post-type default.
'options' => [
'0' => '', // Post type default - translation added later.
'2' => '', // Index - translation added later.
'1' => '', // No-index - translation added later.
'0' => '', // Post type default.
'2' => '', // Index.
'1' => '', // No-index.
],
],
'meta-robots-nofollow' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '0', // = follow.
'options' => [
'0' => '', // Follow - translation added later.
'1' => '', // No-follow - translation added later.
'0' => '', // Follow.
'1' => '', // No-follow.
],
],
'meta-robots-adv' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
'options' => [
'noimageindex' => '', // Translation added later.
'noarchive' => '', // Translation added later.
'nosnippet' => '', // Translation added later.
'noimageindex' => '',
'noarchive' => '',
'nosnippet' => '',
],
],
'bctitle' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
],
'canonical' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
],
'redirect' => [
'type' => 'url',
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
],
],
'social' => [],
'schema' => [
'schema_page_type' => [
'type' => 'hidden',
'title' => '',
'options' => Schema_Types::PAGE_TYPES,
],
'schema_article_type' => [
'type' => 'hidden',
'title' => '',
'hide_on_pages' => true,
'options' => Schema_Types::ARTICLE_TYPES,
],
@@ -275,9 +244,7 @@ class WPSEO_Meta {
foreach ( self::$social_fields as $box => $type ) {
self::$meta_fields['social'][ $network . '-' . $box ] = [
'type' => $type,
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
];
}
}
@@ -367,13 +334,6 @@ class WPSEO_Meta {
return [];
}
/* Adjust the no-index text strings based on the post type. */
$post_type_object = get_post_type_object( $post_type );
$field_defs['meta-robots-noindex']['title'] = sprintf( $field_defs['meta-robots-noindex']['title'], $post_type_object->labels->singular_name );
$field_defs['meta-robots-noindex']['options']['0'] = sprintf( $field_defs['meta-robots-noindex']['options']['0'], ( ( WPSEO_Options::get( 'noindex-' . $post_type, false ) === true ) ? $field_defs['meta-robots-noindex']['options']['1'] : $field_defs['meta-robots-noindex']['options']['2'] ), $post_type_object->label );
$field_defs['meta-robots-nofollow']['title'] = sprintf( $field_defs['meta-robots-nofollow']['title'], $post_type_object->labels->singular_name );
/* Don't show the breadcrumb title field if breadcrumbs aren't enabled. */
if ( WPSEO_Options::get( 'breadcrumbs-enable', false ) !== true && ! current_theme_supports( 'yoast-seo-breadcrumbs' ) ) {
unset( $field_defs['bctitle'] );

View File

@@ -863,9 +863,6 @@ class WPSEO_Utils {
'postTypeNamePlural' => ( $page_type === 'post' ) ? $label_object->label : $label_object->name,
'postTypeNameSingular' => ( $page_type === 'post' ) ? $label_object->labels->singular_name : $label_object->singular_name,
'isBreadcrumbsDisabled' => WPSEO_Options::get( 'breadcrumbs-enable', false ) !== true && ! current_theme_supports( 'yoast-seo-breadcrumbs' ),
// phpcs:ignore Generic.ControlStructures.DisallowYodaConditions -- Bug: squizlabs/PHP_CodeSniffer#2962.
'isPrivateBlog' => ( (string) get_option( 'blog_public' ) ) === '0',
'news_seo_is_active' => ( defined( 'WPSEO_NEWS_FILE' ) ),
'isAiFeatureActive' => (bool) WPSEO_Options::get( 'enable_ai_generator' ),
];

View File

@@ -339,7 +339,7 @@ class WPSEO_Sitemaps_Renderer {
*/
protected function get_xsl_url() {
if ( home_url() !== site_url() ) {
return home_url( 'main-sitemap.xsl' );
return apply_filters( 'wpseo_sitemap_public_url', home_url( 'main-sitemap.xsl' ) );
}
/*