Skip to content

Commit

Permalink
update plugins/wordpress-seo
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleBlanchette committed Oct 12, 2024
1 parent 7bd490d commit 0fa9448
Show file tree
Hide file tree
Showing 144 changed files with 1,644 additions and 1,284 deletions.
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 wp-content/plugins/wordpress-seo/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
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
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
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
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
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 wp-content/plugins/wordpress-seo/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
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 wp-content/plugins/wordpress-seo/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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Loading

0 comments on commit 0fa9448

Please sign in to comment.