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

@@ -660,6 +660,11 @@ class WPSEO_Admin_Asset_Manager {
'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,

View File

@@ -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;
@@ -50,11 +51,17 @@ class WPSEO_Admin_Pages {
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' ] );
}
@@ -89,18 +96,14 @@ class WPSEO_Admin_Pages {
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 ),

View File

@@ -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.

View File

@@ -97,7 +97,7 @@ class WPSEO_Premium_Upsell_Admin_Block {
$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>';
@@ -111,11 +111,11 @@ class WPSEO_Premium_Upsell_Admin_Block {
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' ) . '">';

View File

@@ -49,18 +49,12 @@ class WPSEO_Metabox_Formatter {
*/
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(),
@@ -73,10 +67,6 @@ class WPSEO_Metabox_Formatter {
* @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 );

View File

@@ -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.
*/
@@ -88,7 +89,6 @@ class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
// 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',
@@ -98,6 +98,10 @@ class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
$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.
*

View File

@@ -260,7 +260,7 @@ abstract class WPSEO_Base_Menu implements WPSEO_WordPress_Integration {
$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>';
}

View File

@@ -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;
@@ -501,7 +498,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
/**
* 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).
@@ -509,6 +507,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
* @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 );
@@ -631,7 +631,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
$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 !== '' ) {
@@ -879,14 +879,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
'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,
@@ -897,11 +891,6 @@ class WPSEO_Metabox extends WPSEO_Meta {
'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,
];
/**

View File

@@ -182,7 +182,6 @@ class WPSEO_Taxonomy {
],
],
'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(),

View File

@@ -133,9 +133,9 @@ $new_tab_message = sprintf(
$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>';