Skip to content

Commit

Permalink
Merge branch 'release/23.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
YoastBot committed Oct 8, 2024
2 parents 7150644 + 6f76e15 commit ec3d84f
Show file tree
Hide file tree
Showing 195 changed files with 6,939 additions and 5,714 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/finish-coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
# NOTE: The ref value should be different when triggered by pull_request event.
# See: https://github.com/lewagon/wait-on-check-action/issues/25.
- name: "Wait on tests (PR)"
uses: lewagon/wait-on-check-action@595dabb3acf442d47e29c9ec9ba44db0c6bdd18f # lewagon/[email protected].3
uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc # lewagon/[email protected].4
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -93,7 +93,7 @@ jobs:

- name: "Wait on tests (push)"
if: github.event_name != 'pull_request'
uses: lewagon/wait-on-check-action@595dabb3acf442d47e29c9ec9ba44db0c6bdd18f # lewagon/[email protected].3
uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc # lewagon/[email protected].4
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
matrix:
include:
- php_version: "7.2"
wp_version: "6.4"
wp_version: "6.5"
multisite: true
coverage: true

Expand All @@ -151,7 +151,7 @@ jobs:
coverage: false

- php_version: "8.0"
wp_version: "6.4"
wp_version: "6.5"
multisite: false
coverage: false

Expand All @@ -161,7 +161,7 @@ jobs:
coverage: false

- php_version: '8.2'
wp_version: '6.4'
wp_version: '6.5'
multisite: true
coverage: false

Expand Down
5 changes: 5 additions & 0 deletions admin/class-admin-asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,11 @@ protected function styles_to_be_registered() {
'src' => 'academy-' . $flat_version,
'deps' => [ self::PREFIX . 'tailwind' ],
],
[
'name' => 'new-dashboard',
'src' => 'new-dashboard-' . $flat_version,
'deps' => [ self::PREFIX . 'tailwind' ],
],
[
'name' => 'support',
'src' => 'support-' . $flat_version,
Expand Down
21 changes: 12 additions & 9 deletions admin/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
*/

use Yoast\WP\SEO\Actions\Alert_Dismissal_Action;
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
use Yoast\WP\SEO\Dashboard\User_Interface\New_Dashboard_Page_Integration;
use Yoast\WP\SEO\Integrations\Academy_Integration;
use Yoast\WP\SEO\Integrations\Settings_Integration;
use Yoast\WP\SEO\Integrations\Support_Integration;
Expand Down Expand Up @@ -50,11 +51,17 @@ public function __construct() {
public function init() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
$page = isset( $_GET['page'] ) && is_string( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
if ( in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE ], true ) ) {

// Don't load the scripts for the following pages.
$page_exceptions = in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE ], true );
// Don't load the scripts for the new dashboard page, but only if the feature flag is enabled.
$new_dashboard_conditional = new New_Dashboard_Ui_Conditional();
$new_dashboard_page = ( $page === New_Dashboard_Page_Integration::PAGE && $new_dashboard_conditional->is_met() );

if ( $page_exceptions || $new_dashboard_page ) {
// Bail, this is managed in the applicable integration.
return;
}

add_action( 'admin_enqueue_scripts', [ $this, 'config_page_scripts' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'config_page_styles' ] );
}
Expand Down Expand Up @@ -89,18 +96,14 @@ public function config_page_scripts() {
wp_enqueue_script( 'dashboard' );
wp_enqueue_script( 'thickbox' );

$alert_dismissal_action = YoastSEO()->classes->get( Alert_Dismissal_Action::class );
$dismissed_alerts = $alert_dismissal_action->all_dismissed();
$woocommerce_conditional = new WooCommerce_Conditional();
$alert_dismissal_action = YoastSEO()->classes->get( Alert_Dismissal_Action::class );
$dismissed_alerts = $alert_dismissal_action->all_dismissed();

$script_data = [
'userLanguageCode' => WPSEO_Language_Utils::get_language( get_user_locale() ),
'dismissedAlerts' => $dismissed_alerts,
'isRtl' => is_rtl(),
'isPremium' => YoastSEO()->helpers->product->is_premium(),
'isWooCommerceActive' => $woocommerce_conditional->is_met(),
'currentPromotions' => YoastSEO()->classes->get( Promotion_Manager::class )->get_current_promotions(),
'webinarIntroSettingsUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/webinar-intro-settings' ),
'webinarIntroFirstTimeConfigUrl' => $this->get_webinar_shortlink(),
'linkParams' => WPSEO_Shortlinker::get_query_params(),
'pluginUrl' => plugins_url( '', WPSEO_FILE ),
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
*/
public const CURRENT_RELEASE = '19.2.0';
public const CURRENT_RELEASE = '19.3.0';

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

/**
* Holds the current version.
Expand Down
6 changes: 3 additions & 3 deletions admin/class-premium-upsell-admin-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function render() {
$class = $this->get_html_class();

/* translators: %s expands to 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__( 'Explore %s now!', 'wordpress-seo' ), 'Yoast SEO Premium' );
$button_text = YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ? esc_html__( 'Upgrade now', 'wordpress-seo' ) : sprintf( esc_html__( 'Explore %s now!', '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 @@ -111,11 +111,11 @@ public function render() {

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

if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-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='black-friday-container'><span>$sale_label</span> <span style='margin-left: auto;'>$bf_label</span> </div>";
}

echo '<div class="' . esc_attr( $class . '--container' ) . '">';
Expand Down
10 changes: 0 additions & 10 deletions admin/formatter/class-metabox-formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,12 @@ public function get_values() {
*/
private function get_defaults() {
$schema_types = new Schema_Types();
$host = YoastSEO()->helpers->url->get_url_host( get_site_url() );

$defaults = [
'author_name' => get_the_author_meta( 'display_name' ),
'sitewide_social_image' => WPSEO_Options::get( 'og_default_image' ),
'keyword_usage' => [],
'title_template' => '',
'metadesc_template' => '',
'showSocial' => [
'facebook' => WPSEO_Options::get( 'opengraph', false ),
'twitter' => WPSEO_Options::get( 'twitter', false ),
],
'schema' => [
'displayFooter' => WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ),
'pageTypeOptions' => $schema_types->get_page_type_options(),
Expand All @@ -73,10 +67,6 @@ private function get_defaults() {
* @param bool $showMarkers Should the markers being enabled. Default = true.
*/
'show_markers' => apply_filters( 'wpseo_enable_assessment_markers', true ),
'getJetpackBoostPrePublishLink' => WPSEO_Shortlinker::get( 'https://yoa.st/jetpack-boost-get-prepublish?domain=' . $host ),
'upgradeJetpackBoostPrePublishLink' => WPSEO_Shortlinker::get( 'https://yoa.st/jetpack-boost-upgrade-prepublish?domain=' . $host ),
'woocommerceUpsellSchemaLink' => WPSEO_Shortlinker::get( 'https://yoa.st/product-schema-metabox' ),
'woocommerceUpsellGooglePreviewLink' => WPSEO_Shortlinker::get( 'https://yoa.st/product-google-preview-metabox' ),
];

$integration_information_repo = YoastSEO()->classes->get( Integration_Information_Repository::class );
Expand Down
6 changes: 5 additions & 1 deletion admin/menu/class-admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @package WPSEO\Admin\Menu
*/

use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
/**
* Registers the admin menu on the left of the admin area.
*/
Expand Down Expand Up @@ -88,7 +89,6 @@ public function get_submenu_pages() {

// Submenu pages.
$submenu_pages = [
$this->get_submenu_page( __( 'General', 'wordpress-seo' ), $this->get_page_identifier() ),
$this->get_submenu_page(
__( 'Search Console', 'wordpress-seo' ),
'wpseo_search_console',
Expand All @@ -98,6 +98,10 @@ public function get_submenu_pages() {
$this->get_submenu_page( $this->get_license_page_title(), 'wpseo_licenses' ),
];

if ( ! ( new New_Dashboard_Ui_Conditional() )->is_met() ) {
array_unshift( $submenu_pages, $this->get_submenu_page( __( 'General', 'wordpress-seo' ), $this->get_page_identifier() ) );
}

/**
* Filter: 'wpseo_submenu_pages' - Collects all submenus that need to be shown.
*
Expand Down
2 changes: 1 addition & 1 deletion admin/menu/class-base-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ protected function get_license_page_title() {
$title = __( 'Upgrades', 'wordpress-seo' );
}

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

Expand Down
21 changes: 5 additions & 16 deletions admin/metabox/class-metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
* @package WPSEO\Admin
*/

use Yoast\WP\SEO\Conditionals\Third_Party\Jetpack_Boost_Active_Conditional;
use Yoast\WP\SEO\Conditionals\Third_Party\Jetpack_Boost_Not_Premium_Conditional;
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
use Yoast\WP\SEO\Editors\Application\Site\Website_Information_Repository;
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter;
use Yoast\WP\SEO\Presenters\Admin\Meta_Fields_Presenter;
Expand Down Expand Up @@ -501,14 +498,17 @@ protected function get_additional_tabs() {
/**
* Adds a line in the meta box.
*
* @todo [JRF] Check if $class is added appropriately everywhere.
* @deprecated 23.5
* @codeCoverageIgnore
*
* @param string[] $meta_field_def Contains the vars based on which output is generated.
* @param string $key Internal key (without prefix).
*
* @return string
*/
public function do_meta_box( $meta_field_def, $key = '' ) {
_deprecated_function( __METHOD__, 'Yoast SEO 23.5' );

$content = '';
$esc_form_key = esc_attr( WPSEO_Meta::$form_prefix . $key );
$meta_value = WPSEO_Meta::get_value( $key, $this->get_metabox_post()->ID );
Expand Down Expand Up @@ -631,7 +631,7 @@ public function do_meta_box( $meta_field_def, $key = '' ) {

$html = '';
if ( $content === '' ) {
$content = apply_filters( 'wpseo_do_meta_box_field_' . $key, $content, $meta_value, $esc_form_key, $meta_field_def, $key );
$content = apply_filters_deprecated( 'wpseo_do_meta_box_field_' . $key, [ $content, $meta_value, $esc_form_key, $meta_field_def, $key ], 'Yoast SEO 23.5', '', 'do_meta_box is deprecated' );
}

if ( $content !== '' ) {
Expand Down Expand Up @@ -879,14 +879,8 @@ public function enqueue() {
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
];

$woocommerce_conditional = new WooCommerce_Conditional();
$woocommerce_active = $woocommerce_conditional->is_met();
$addon_manager = new WPSEO_Addon_Manager();
$woocommerce_seo_active = is_plugin_active( $addon_manager->get_plugin_file( WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ) );

$script_data = [
'metabox' => $this->get_metabox_script_data(),
'userLanguageCode' => WPSEO_Language_Utils::get_language( get_user_locale() ),
'isPost' => true,
'isBlockEditor' => $is_block_editor,
'postId' => $post_id,
Expand All @@ -897,11 +891,6 @@ public function enqueue() {
'plugins' => $plugins_script_data,
'worker' => $worker_script_data,
],
'isJetpackBoostActive' => ( $is_block_editor ) ? YoastSEO()->classes->get( Jetpack_Boost_Active_Conditional::class )->is_met() : false,
'isJetpackBoostNotPremium' => ( $is_block_editor ) ? YoastSEO()->classes->get( Jetpack_Boost_Not_Premium_Conditional::class )->is_met() : false,
'isWooCommerceSeoActive' => $woocommerce_seo_active,
'isWooCommerceActive' => $woocommerce_active,
'woocommerceUpsell' => get_post_type( $post_id ) === 'product' && ! $woocommerce_seo_active && $woocommerce_active,
];

/**
Expand Down
1 change: 0 additions & 1 deletion admin/taxonomy/class-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ public function admin_enqueue_scripts() {
],
],
'metabox' => $this->localize_term_scraper_script( $tag_id ),
'userLanguageCode' => WPSEO_Language_Utils::get_language( get_user_locale() ),
'isTerm' => true,
'postId' => $tag_id,
'termType' => $this->get_taxonomy(),
Expand Down
4 changes: 2 additions & 2 deletions admin/views/licenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@
$sale_badge = '';
$premium_sale_badge = '';

if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) {
/* translators: %1$s expands to opening span, %2$s expands to closing span */
$sale_badge_span = sprintf( esc_html__( '%1$sSALE 30%% OFF!%2$s', 'wordpress-seo' ), '<span>', '</span>' );
$sale_badge_span = sprintf( esc_html__( '%1$s30%% OFF%2$s', 'wordpress-seo' ), '<span>', '</span>' );

$sale_badge = '<div class="yoast-seo-premium-extension-sale-badge">' . $sale_badge_span . '</div>';

Expand Down
8 changes: 5 additions & 3 deletions apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

This folder includes apps for testing purposes. These apps are not published. Apps include:

- [Components](apps/components)
- [Components](components)
- A test application for most `@yoast` packages.
- [Content-analysis](apps/content-analysis)
- A test application for the content analysis.
- [Content analysis](content-analysis)
- A test application for the content analysis in a React environment.
- [Content analysis API](content-analysis-api)
- A test application for the content analysis in a Node.js environment.
2 changes: 1 addition & 1 deletion apps/content-analysis-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"main": "index.js",
"scripts": {
"postinstall": "yarn --cwd node_modules/yoastseo build",
"postinstall": "yarn --cwd node_modules/yoastseo build && yarn --cwd node_modules/yoastseo pretest",
"start": "node index.js"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions apps/content-analysis-api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
sprintf-js "^1.1.1"
tannin "^1.2.0"

"@yoast/feature-flag@^0.5.2":
version "0.5.2"
resolved "https://registry.yarnpkg.com/@yoast/feature-flag/-/feature-flag-0.5.2.tgz#ef4cd8ddb959c5857c5d68639ab09ab75c381508"
integrity sha512-erHel5POEyPpt1B2fToLm8caZPruiOxBRZvn7X9nWqwb0lIbxbOkDp/XQnm168bcvVEL95Dg9JMaPgQwO3rA9w==
"@yoast/feature-flag@^0.6.0-alpha.0":
version "0.6.0-alpha.0"
resolved "https://registry.yarnpkg.com/@yoast/feature-flag/-/feature-flag-0.6.0-alpha.0.tgz#4da6c63ca388fbf0949396e137fdbe64507f9cb5"
integrity sha512-11zClQ9HKjc1rGxrmyE2pb6/BbdAeSc+N3Tn/zVPA5Fn8Bax7fg5RYdIL9dAUfDRT5+eGX3GTZ+ZyfrlfY7VxA==

accepts@~1.3.8:
version "1.3.8"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"Yoast\\WP\\SEO\\Composer\\Actions::check_coding_standards"
],
"check-cs-thresholds": [
"@putenv YOASTCS_THRESHOLD_ERRORS=2482",
"@putenv YOASTCS_THRESHOLD_ERRORS=2480",
"@putenv YOASTCS_THRESHOLD_WARNINGS=252",
"Yoast\\WP\\SEO\\Composer\\Actions::check_cs_thresholds"
],
Expand Down
1 change: 1 addition & 0 deletions config/webpack/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const getEntries = ( sourceDirectory = "./packages/js/src" ) => ( {
settings: `${ sourceDirectory }/settings.js`,
"new-settings": `${ sourceDirectory }/settings/initialize.js`,
academy: `${ sourceDirectory }/academy/initialize.js`,
"new-dashboard": `${ sourceDirectory }/dashboard/initialize.js`,
support: `${ sourceDirectory }/support/initialize.js`,
"how-to-block": `${ sourceDirectory }/structured-data-blocks/how-to/block.js`,
"faq-block": `${ sourceDirectory }/structured-data-blocks/faq/block.js`,
Expand Down
Loading

0 comments on commit ec3d84f

Please sign in to comment.