plugin updates

This commit is contained in:
Tony Volpe
2024-11-15 13:53:04 -05:00
parent 1293d604ca
commit 0238f0c4ca
2009 changed files with 163492 additions and 89543 deletions

View File

@@ -88,14 +88,21 @@ class WPSEO_Admin_Asset_Manager {
* @return void
*/
public function register_script( WPSEO_Admin_Asset $script ) {
$url = $script->get_src() ? $this->get_url( $script, WPSEO_Admin_Asset::TYPE_JS ) : false;
$url = $script->get_src() ? $this->get_url( $script, WPSEO_Admin_Asset::TYPE_JS ) : false;
$args = [
'in_footer' => $script->is_in_footer(),
];
if ( $script->get_strategy() !== '' ) {
$args['strategy'] = $script->get_strategy();
}
wp_register_script(
$this->prefix . $script->get_name(),
$url,
$script->get_deps(),
$script->get_version(),
$script->is_in_footer()
$args
);
if ( in_array( 'wp-i18n', $script->get_deps(), true ) ) {
@@ -313,7 +320,7 @@ class WPSEO_Admin_Asset_Manager {
self::PREFIX . 'externals-contexts',
self::PREFIX . 'externals-redux',
],
'new-dashboard' => [
'general-page' => [
self::PREFIX . 'api-client',
],
];
@@ -664,8 +671,8 @@ class WPSEO_Admin_Asset_Manager {
'deps' => [ self::PREFIX . 'tailwind' ],
],
[
'name' => 'new-dashboard',
'src' => 'new-dashboard-' . $flat_version,
'name' => 'general-page',
'src' => 'general-page-' . $flat_version,
'deps' => [ self::PREFIX . 'tailwind' ],
],
[

View File

@@ -5,7 +5,6 @@
* @package WPSEO\Admin
*/
use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
use Yoast\WP\SEO\Integrations\Settings_Integration;
/**
@@ -242,7 +241,7 @@ class WPSEO_Admin {
$configuration_title = ( ! $first_time_configuration_notice_helper->should_show_alternate_message() ) ? 'first-time configuration' : 'SEO configuration';
/* translators: CTA to finish the first time configuration. %s: Either first-time SEO configuration or SEO configuration. */
$message = sprintf( __( 'Finish your %s', 'wordpress-seo' ), $configuration_title );
$ftc_page = ( ( new New_Dashboard_Ui_Conditional() )->is_met() ) ? 'admin.php?page=wpseo_dashboard#/first-time-configuration' : 'admin.php?page=wpseo_dashboard#top#first-time-configuration';
$ftc_page = 'admin.php?page=wpseo_dashboard#/first-time-configuration';
$ftc_link = '<a href="' . esc_url( admin_url( $ftc_page ) ) . '" target="_blank">' . $message . '</a>';
array_unshift( $links, $ftc_link );
}

View File

@@ -121,6 +121,13 @@ class WPSEO_Admin_Asset {
*/
protected $in_footer;
/**
* For JS Assets. The script's async/defer strategy.
*
* @var string
*/
protected $strategy;
/**
* For CSS Assets. Whether this stylesheet is a right-to-left stylesheet.
*
@@ -147,6 +154,7 @@ class WPSEO_Admin_Asset {
'media' => 'all',
'version' => '',
'suffix' => '',
'strategy' => '',
];
/**
@@ -173,6 +181,7 @@ class WPSEO_Admin_Asset {
$this->version = $args['version'];
$this->media = $args['media'];
$this->in_footer = $args['in_footer'];
$this->strategy = $args['strategy'];
$this->rtl = $args['rtl'];
$this->suffix = $args['suffix'];
}
@@ -235,6 +244,15 @@ class WPSEO_Admin_Asset {
return $this->in_footer;
}
/**
* Returns the script asset's async/defer loading strategy.
*
* @return string
*/
public function get_strategy() {
return $this->strategy;
}
/**
* Returns whether this CSS has a RTL counterpart.
*

View File

@@ -6,8 +6,7 @@
*/
use Yoast\WP\SEO\Actions\Alert_Dismissal_Action;
use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
use Yoast\WP\SEO\Dashboard\User_Interface\New_Dashboard_Page_Integration;
use Yoast\WP\SEO\General\User_Interface\General_Page_Integration;
use Yoast\WP\SEO\Integrations\Academy_Integration;
use Yoast\WP\SEO\Integrations\Settings_Integration;
use Yoast\WP\SEO\Integrations\Support_Integration;
@@ -53,11 +52,8 @@ class WPSEO_Admin_Pages {
$page = isset( $_GET['page'] ) && is_string( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
// 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() );
$page_exceptions = in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE ], true );
$new_dashboard_page = ( $page === General_Page_Integration::PAGE && ! is_network_admin() );
if ( $page_exceptions || $new_dashboard_page ) {
// Bail, this is managed in the applicable integration.
return;

View File

@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
public const CURRENT_RELEASE = '19.4.0';
public const CURRENT_RELEASE = '19.5.0';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
public const MINIMUM_SUPPORTED = '19.4.0';
public const MINIMUM_SUPPORTED = '19.5.0';
/**
* Holds the current version.

View File

@@ -5,7 +5,6 @@
* @package WPSEO\Admin\Menu
*/
use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
/**
* Registers the admin menu on the left of the admin area.
*/
@@ -98,10 +97,6 @@ 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

@@ -5,8 +5,6 @@
* @package WPSEO\Admin\Views
*/
use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
@@ -102,7 +100,7 @@ function wpseo_import_external_select( $name, $plugins ) {
<h3><?php esc_html_e( 'Step 4: Go through the first time configuration', 'wordpress-seo' ); ?></h3>
<p>
<?php
$ftc_page = ( ( new New_Dashboard_Ui_Conditional() )->is_met() ) ? 'admin.php?page=wpseo_dashboard#/first-time-configuration' : 'admin.php?page=wpseo_dashboard#top#first-time-configuration';
$ftc_page = 'admin.php?page=wpseo_dashboard#/first-time-configuration';
printf(
/* translators: 1: Link start tag to the First time configuration tab in the General page, 2: Link closing tag. */
esc_html__( 'You should finish the %1$sfirst time configuration%2$s to make sure your SEO data has been optimized and youve set the essential Yoast SEO settings for your site.', 'wordpress-seo' ),