Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:Yoast/wordpress-seo into releasing…
Browse files Browse the repository at this point in the history
…-yoastseo
  • Loading branch information
FAMarfuaty committed Oct 17, 2023
2 parents 49ba484 + e6375ae commit fb24eab
Show file tree
Hide file tree
Showing 392 changed files with 12,640 additions and 14,181 deletions.
6 changes: 6 additions & 0 deletions admin/class-admin-asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ protected function styles_to_be_registered() {
'src' => 'metabox-' . $flat_version,
'deps' => [
self::PREFIX . 'admin-css',
self::PREFIX . 'tailwind',
'wp-components',
],
],
Expand Down Expand Up @@ -621,6 +622,11 @@ protected function styles_to_be_registered() {
'src' => 'new-settings-' . $flat_version,
'deps' => [ self::PREFIX . 'tailwind' ],
],
[
'name' => 'black-friday-banner',
'src' => 'black-friday-banner-' . $flat_version,
'deps' => [ self::PREFIX . 'tailwind' ],
],
[
'name' => 'academy',
'src' => 'academy-' . $flat_version,
Expand Down
78 changes: 0 additions & 78 deletions admin/class-admin-asset-yoast-components-l10n.php

This file was deleted.

1 change: 1 addition & 0 deletions admin/class-admin-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static function get_install_link( $plugin ) {
public static function get_new_tab_message() {
return sprintf(
'<span class="screen-reader-text">%s</span>',
/* translators: Hidden accessibility text. */
esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' )
);
}
Expand Down
7 changes: 4 additions & 3 deletions admin/class-bulk-editor-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ public function extra_tablenav( $which ) {
printf(
'<label for="%1$s" class="screen-reader-text">%2$s</label>',
esc_attr( 'post-type-filter-' . $instance_type ),
/* translators: Hidden accessibility text. */
esc_html__( 'Filter by content type', 'wordpress-seo' )
);
printf(
Expand Down Expand Up @@ -809,7 +810,7 @@ protected function parse_page_title_column( $rec ) {
$actions['edit'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
esc_url( get_edit_post_link( $rec->ID, true ) ),
/* translators: %s: post title */
/* translators: Hidden accessibility text; %s: post title. */
esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;', 'wordpress-seo' ), $title ) ),
__( 'Edit', 'wordpress-seo' )
);
Expand All @@ -821,7 +822,7 @@ protected function parse_page_title_column( $rec ) {
$actions['view'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
esc_url( add_query_arg( 'preview', 'true', get_permalink( $rec->ID ) ) ),
/* translators: %s: post title */
/* translators: Hidden accessibility text; %s: post title. */
esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;', 'wordpress-seo' ), $title ) ),
__( 'Preview', 'wordpress-seo' )
);
Expand All @@ -831,7 +832,7 @@ protected function parse_page_title_column( $rec ) {
$actions['view'] = sprintf(
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
esc_url( get_permalink( $rec->ID ) ),
/* translators: %s: post title */
/* translators: Hidden accessibility text; %s: post title. */
esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'wordpress-seo' ), $title ) ),
__( 'View', 'wordpress-seo' )
);
Expand Down
3 changes: 2 additions & 1 deletion admin/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ public function config_page_scripts() {
'isRtl' => is_rtl(),
'isPremium' => YoastSEO()->helpers->product->is_premium(),
'isWooCommerceActive' => $woocommerce_conditional->is_met(),
'currentPromotions' => YoastSEO()->classes->get( Yoast\WP\SEO\Promotions\Application\Promotion_Manager::class )->get_current_promotions(),
'webinarIntroSettingsUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/webinar-intro-settings' ),
'blackFridayBlockEditorUrl' => ( YoastSEO()->classes->get( Yoast\WP\SEO\Promotions\Application\Promotion_Manager::class )->is( 'black_friday_2023_checklist' ) ) ? WPSEO_Shortlinker::get( 'https://yoa.st/black-friday-checklist' ) : '',
'webinarIntroFirstTimeConfigUrl' => $this->get_webinar_shortlink(),
'linkParams' => WPSEO_Shortlinker::get_query_params(),
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
];

Expand Down
9 changes: 3 additions & 6 deletions admin/class-expose-shortlinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,24 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
'shortlinks.upsell.social_preview.social' => 'https://yoa.st/social-preview-facebook',
'shortlinks.upsell.social_preview.twitter' => 'https://yoa.st/social-preview-twitter',
'shortlinks.upsell.sidebar.news' => 'https://yoa.st/get-news-sidebar',
'shortlinks.upsell.sidebar.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-sidebar',
'shortlinks.upsell.sidebar.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup-sidebar',
'shortlinks.upsell.sidebar.premium_seo_analysis_button' => 'https://yoa.st/premium-seo-analysis-sidebar',
'shortlinks.upsell.sidebar.focus_keyword_additional_link' => 'https://yoa.st/textlink-keywords-popup-sidebar',
'shortlinks.upsell.sidebar.focus_keyword_additional_button' => 'https://yoa.st/add-keywords-popup-sidebar',
'shortlinks.upsell.sidebar.additional_link' => 'https://yoa.st/textlink-keywords-sidebar',
'shortlinks.upsell.sidebar.additional_button' => 'https://yoa.st/add-keywords-sidebar',
'shortlinks.upsell.sidebar.keyphrase_distribution' => 'https://yoa.st/keyphrase-distribution-sidebar',
'shortlinks.upsell.sidebar.word_complexity' => 'https://yoa.st/word-complexity-sidebar',
'shortlinks.upsell.sidebar.internal_linking_suggestions' => 'https://yoa.st/internal-linking-suggestions-sidebar',
'shortlinks.upsell.metabox.news' => 'https://yoa.st/get-news-metabox',
'shortlinks.upsell.metabox.go_premium' => 'https://yoa.st/pe-premium-page',
'shortlinks.upsell.metabox.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-metabox',
'shortlinks.upsell.metabox.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup',
'shortlinks.upsell.metabox.premium_seo_analysis_button' => 'https://yoa.st/premium-seo-analysis-metabox',
'shortlinks.upsell.metabox.focus_keyword_additional_link' => 'https://yoa.st/textlink-keywords-popup-metabox',
'shortlinks.upsell.metabox.focus_keyword_additional_button' => 'https://yoa.st/add-keywords-popup',
'shortlinks.upsell.metabox.additional_link' => 'https://yoa.st/textlink-keywords-metabox',
'shortlinks.upsell.metabox.additional_button' => 'https://yoa.st/add-keywords-metabox',
'shortlinks.upsell.metabox.keyphrase_distribution' => 'https://yoa.st/keyphrase-distribution-metabox',
'shortlinks.upsell.metabox.word_complexity' => 'https://yoa.st/word-complexity-metabox',
'shortlinks.upsell.metabox.internal_linking_suggestions' => 'https://yoa.st/internal-linking-suggestions-metabox',
'shortlinks.upsell.gsc.create_redirect_button' => 'https://yoa.st/redirects',
'shortlinks.readability_analysis_info' => 'https://yoa.st/readability-analysis',
'shortlinks.inclusive_language_analysis_info' => 'https://yoa.st/inclusive-language-analysis',
Expand Down Expand Up @@ -117,15 +115,14 @@ private function get_shortlinks() {

$shortlinks = $this->shortlinks;

$shortlinks['shortlinks.upsell.metabox.focus_keyword_synonyms_link'] = 'https://yoa.st/textlink-synonyms-popup-metabox-term';
$shortlinks['shortlinks.upsell.metabox.focus_keyword_synonyms_button'] = 'https://yoa.st/keyword-synonyms-popup-term';
$shortlinks['shortlinks.upsell.metabox.focus_keyword_additional_link'] = 'https://yoa.st/textlink-keywords-popup-metabox-term';
$shortlinks['shortlinks.upsell.metabox.focus_keyword_additional_button'] = 'https://yoa.st/add-keywords-popup-term';
$shortlinks['shortlinks.upsell.metabox.additional_link'] = 'https://yoa.st/textlink-keywords-metabox-term';
$shortlinks['shortlinks.upsell.metabox.additional_button'] = 'https://yoa.st/add-keywords-metabox-term';
$shortlinks['shortlinks.upsell.sidebar.morphology_upsell_metabox'] = 'https://yoa.st/morphology-upsell-metabox-term';
$shortlinks['shortlinks.upsell.metabox.keyphrase_distribution'] = 'https://yoa.st/keyphrase-distribution-metabox-term';
$shortlinks['shortlinks.upsell.metabox.word_complexity'] = 'https://yoa.st/word-complexity-metabox-term';
$shortlinks['shortlinks.upsell.metabox.internal_linking_suggestions'] = 'https://yoa.st/internal-linking-suggestions-metabox-term';

return $shortlinks;
}
Expand Down
4 changes: 2 additions & 2 deletions admin/class-gutenberg-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '16.6.0';
const CURRENT_RELEASE = '16.8.1';

/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '16.6.0';
const MINIMUM_SUPPORTED = '16.8.1';

/**
* Holds the current version.
Expand Down
16 changes: 14 additions & 2 deletions admin/class-meta-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,19 @@ public function column_heading( $columns ) {
$added_columns = [];

if ( $this->analysis_seo->is_enabled() ) {
$added_columns['wpseo-score'] = '<span class="yoast-column-seo-score yoast-column-header-has-tooltip" data-tooltip-text="' . esc_attr__( 'SEO score', 'wordpress-seo' ) . '"><span class="screen-reader-text">' . __( 'SEO score', 'wordpress-seo' ) . '</span></span></span>';
$added_columns['wpseo-score'] = '<span class="yoast-column-seo-score yoast-column-header-has-tooltip" data-tooltip-text="' .
esc_attr__( 'SEO score', 'wordpress-seo' ) .
'"><span class="screen-reader-text">' .
__( 'SEO score', 'wordpress-seo' ) .
'</span></span></span>';
}

if ( $this->analysis_readability->is_enabled() ) {
$added_columns['wpseo-score-readability'] = '<span class="yoast-column-readability yoast-column-header-has-tooltip" data-tooltip-text="' . esc_attr__( 'Readability score', 'wordpress-seo' ) . '"><span class="screen-reader-text">' . __( 'Readability score', 'wordpress-seo' ) . '</span></span></span>';
$added_columns['wpseo-score-readability'] = '<span class="yoast-column-readability yoast-column-header-has-tooltip" data-tooltip-text="' .
esc_attr__( 'Readability score', 'wordpress-seo' ) .
'"><span class="screen-reader-text">' .
__( 'Readability score', 'wordpress-seo' ) .
'</span></span></span>';
}

$added_columns['wpseo-title'] = __( 'SEO Title', 'wordpress-seo' );
Expand Down Expand Up @@ -154,6 +162,7 @@ public function column_content( $column_name, $post_id ) {
}
if ( $metadesc_val === '' ) {
echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">',
/* translators: Hidden accessibility text. */
esc_html__( 'Meta description not set.', 'wordpress-seo' ),
'</span>';

Expand All @@ -169,6 +178,7 @@ public function column_content( $column_name, $post_id ) {

if ( $focuskw_val === '' ) {
echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">',
/* translators: Hidden accessibility text. */
esc_html__( 'Focus keyphrase not set.', 'wordpress-seo' ),
'</span>';

Expand Down Expand Up @@ -238,6 +248,7 @@ public function posts_filter_dropdown() {

$ranks = WPSEO_Rank::get_all_ranks();

/* translators: Hidden accessibility text. */
echo '<label class="screen-reader-text" for="wpseo-filter">' . esc_html__( 'Filter by SEO Score', 'wordpress-seo' ) . '</label>';
echo '<select name="seo_filter" id="wpseo-filter">';

Expand Down Expand Up @@ -266,6 +277,7 @@ public function posts_filter_dropdown_readability() {

$ranks = WPSEO_Rank::get_all_readability_ranks();

/* translators: Hidden accessibility text. */
echo '<label class="screen-reader-text" for="wpseo-readability-filter">' . esc_html__( 'Filter by Readability Score', 'wordpress-seo' ) . '</label>';
echo '<select name="readability_filter" id="wpseo-readability-filter">';

Expand Down
3 changes: 2 additions & 1 deletion admin/class-premium-popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public function get_premium_message( $popup = true ) {
$assets_uri = trailingslashit( plugin_dir_url( WPSEO_FILE ) );

/* translators: %s expands to Yoast SEO Premium */
$cta_text = esc_html( sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ) );
$cta_text = esc_html( sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ) );
/* translators: Hidden accessibility text. */
$new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>';
$caret_icon = '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
$classes = '';
Expand Down
14 changes: 12 additions & 2 deletions admin/class-premium-upsell-admin-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WPSEO\Admin
*/

use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;

/**
* Class WPSEO_Premium_Upsell_Admin_Block
*/
Expand Down Expand Up @@ -66,7 +68,8 @@ public function render() {
$class = $this->get_html_class();

/* translators: %s expands to Yoast SEO Premium */
$button_text = sprintf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
$button_text = YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ? \esc_html__( 'Claim your 30% off now!', 'wordpress-seo' ) : sprintf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
/* translators: Hidden accessibility text. */
$button_text .= '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>' .
'<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';

Expand All @@ -79,7 +82,14 @@ public function render() {

echo '<div class="' . esc_attr( $class ) . '">';

echo '<div>';
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
$bf_label = \esc_html__( 'BLACK FRIDAY', 'wordpress-seo' );
$sale_label = \esc_html__( '30% OFF', 'wordpress-seo' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped above.
echo "<div class='black-friday-container'><span>$bf_label</span> <span style='margin-left: auto;'>$sale_label</span> </div>";
}

echo '<div class="' . esc_attr( $class . '--container' ) . '">';
echo '<h2 class="' . esc_attr( $class . '--header' ) . '">' .
sprintf(
/* translators: %s expands to Yoast SEO Premium */
Expand Down
2 changes: 1 addition & 1 deletion admin/class-suggested-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected function create_more_information_link( $url, $name ) {
return sprintf(
'<a href="%s" aria-label="%s" target="_blank" rel="noopener noreferrer">',
$url,
/* translators: %1$s expands to the dependency name. */
/* translators: Hidden accessibility text; %1$s expands to the dependency name */
sprintf( __( 'More information about %1$s', 'wordpress-seo' ), $name )
);
}
Expand Down
9 changes: 7 additions & 2 deletions admin/class-yoast-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,15 @@ public function toggle_switch( $variable, $values, $label, $help = '', $attr = [

$upsell_button = '';
if ( $has_premium_upsell ) {
$upsell_button = '<a class="yoast-button yoast-button--buy yoast-button--small" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href=' . esc_url( $attr['premium_upsell_url'] ) . ' target="_blank">' . esc_html__( 'Unlock with Premium!', 'wordpress-seo' ) . '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>' .
'<span aria-hidden="true" class="yoast-button--buy__caret"></span></a>';
$upsell_button = '<a class="yoast-button yoast-button--buy yoast-button--small" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href=' .
esc_url( $attr['premium_upsell_url'] ) . ' target="_blank">' .
esc_html__( 'Unlock with Premium!', 'wordpress-seo' ) .
/* translators: Hidden accessibility text. */
'<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>' .
'<span aria-hidden="true" class="yoast-button--buy__caret"></span></a>';
}

// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All variable output is escaped above.
echo '<a></a></div></fieldset><div class="clear"></div>' . $upsell_button . '</div>' . PHP_EOL . PHP_EOL;
}

Expand Down
1 change: 1 addition & 0 deletions admin/formatter/class-metabox-formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ private function get_content_analysis_component_translations() {
'content-analysis.highlight' => __( 'Highlight this result in the text', 'wordpress-seo' ),
'content-analysis.nohighlight' => __( 'Remove highlight from the text', 'wordpress-seo' ),
'content-analysis.disabledButton' => __( 'Marks are disabled in current view', 'wordpress-seo' ),
/* translators: Hidden accessibility text. */
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
];
}
Expand Down
6 changes: 2 additions & 4 deletions admin/menu/class-admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ protected function get_notification_counter() {
$notification_count = $notification_center->get_notification_count();

// Add main page.
/* translators: %s: number of notifications */
/* translators: Hidden accessibility text; %s: number of notifications. */
$notifications = sprintf( _n( '%s notification', '%s notifications', $notification_count, 'wordpress-seo' ), number_format_i18n( $notification_count ) );

$counter = sprintf( '<span class="update-plugins count-%1$d"><span class="plugin-count" aria-hidden="true">%1$d</span><span class="screen-reader-text">%2$s</span></span>', $notification_count, $notifications );

return $counter;
return sprintf( '<span class="update-plugins count-%1$d"><span class="plugin-count" aria-hidden="true">%1$d</span><span class="screen-reader-text">%2$s</span></span>', $notification_count, $notifications );
}

/**
Expand Down
6 changes: 6 additions & 0 deletions admin/menu/class-base-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WPSEO\Admin\Menu
*/

use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;

/**
* Admin menu base class.
*/
Expand Down Expand Up @@ -258,6 +260,10 @@ protected function get_license_page_title() {
$title = __( 'Premium', 'wordpress-seo' );
}

if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) && ! YoastSEO()->helpers->product->is_premium() ) {
$title = __( 'Premium', 'wordpress-seo' ) . '<span class="yoast-menu-bf-sale-badge">' . __( '30% OFF', 'wordpress-seo' ) . '</span>';
}

return $title;
}

Expand Down
Loading

0 comments on commit fb24eab

Please sign in to comment.