From b582a4bd43194b40320f61fad247efb0266fea07 Mon Sep 17 00:00:00 2001 From: Igor <35524806+igorschoester@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:06:35 +0200 Subject: [PATCH 01/31] API: expose the KeywordInputComponent Formerly this is the KeywordInput from `yoast-components`. We'd still like to use it in Premium, but now from this new location. Therefor, this commit puts it on the window via our editor modules. --- packages/js/src/editor-modules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/js/src/editor-modules.js b/packages/js/src/editor-modules.js index 5b46a7ea784..f2f3eded531 100644 --- a/packages/js/src/editor-modules.js +++ b/packages/js/src/editor-modules.js @@ -6,6 +6,7 @@ import getL10nObject from "./analysis/getL10nObject"; import isZapierConnected from "./analysis/isZapierConnected"; import isZapierIntegrationActive from "./analysis/isZapierIntegrationActive"; import * as refreshAnalysis from "./analysis/refreshAnalysis"; +import KeywordInput from "./components/contentAnalysis/KeywordInputComponent"; import * as mapResults from "./components/contentAnalysis/mapResults"; import HelpLink from "./components/HelpLink"; import withYoastSidebarPriority from "./components/higherorder/withYoastSidebarPriority"; @@ -29,7 +30,7 @@ import * as i18n from "./helpers/i18n"; import isBlockEditor from "./helpers/isBlockEditor"; import * as replacementVariableHelpers from "./helpers/replacementVariableHelpers"; import { update as updateAdminBar } from "./ui/adminBar"; -import { updateScore, createScoresInPublishBox, scrollToCollapsible } from "./ui/publishBox"; +import { createScoresInPublishBox, scrollToCollapsible, updateScore } from "./ui/publishBox"; import { update as updateTrafficLight } from "./ui/trafficLight"; window.yoast = window.yoast || {}; @@ -50,6 +51,7 @@ window.yoast.editorModules = { withYoastSidebarPriority, }, contentAnalysis: { + KeywordInput, mapResults, }, contexts: { From 2ed421f411bad52b4c88a7b116c65997a40236e9 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Thu, 19 Oct 2023 11:25:37 +0200 Subject: [PATCH 02/31] Sets the WordPress tested up to version to 6.4 --- readme.txt | 2 +- tests/unit/bootstrap.php | 2 +- wp-seo-main.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 23438907800..85b88076940 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://yoa.st/1up License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html Tags: SEO, XML sitemap, Content analysis, Readability, Schema -Tested up to: 6.3 +Tested up to: 6.4 Stable tag: 21.4 Requires PHP: 7.2.5 diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php index 4538a077a9d..4fc6bfb17b0 100644 --- a/tests/unit/bootstrap.php +++ b/tests/unit/bootstrap.php @@ -36,7 +36,7 @@ define( 'YOAST_VENDOR_PREFIX_DIRECTORY', 'vendor_prefixed' ); define( 'YOAST_SEO_PHP_REQUIRED', '7.2.5' ); -define( 'YOAST_SEO_WP_TESTED', '6.3.2' ); +define( 'YOAST_SEO_WP_TESTED', '6.4' ); define( 'YOAST_SEO_WP_REQUIRED', '6.2' ); if ( ! defined( 'WPSEO_NAMESPACES' ) ) { diff --git a/wp-seo-main.php b/wp-seo-main.php index 7b58f3505fd..87f6f3781fc 100644 --- a/wp-seo-main.php +++ b/wp-seo-main.php @@ -35,7 +35,7 @@ define( 'YOAST_VENDOR_PREFIX_DIRECTORY', 'vendor_prefixed' ); define( 'YOAST_SEO_PHP_REQUIRED', '7.2.5' ); -define( 'YOAST_SEO_WP_TESTED', '6.3.2' ); +define( 'YOAST_SEO_WP_TESTED', '6.4' ); define( 'YOAST_SEO_WP_REQUIRED', '6.2' ); if ( ! defined( 'WPSEO_NAMESPACES' ) ) { From 13c136e2356ff7f20c8e98ba700dc72c90ab8f36 Mon Sep 17 00:00:00 2001 From: manuelaugustin Date: Thu, 19 Oct 2023 13:13:30 +0200 Subject: [PATCH 03/31] Update readme.txt --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 85b88076940..246f1d698c2 100644 --- a/readme.txt +++ b/readme.txt @@ -366,7 +366,7 @@ Release date: 2023-10-31 * Adds indexation exclusion for Gutenberg Patterns taxonomy. * Improves the FAQ block description by removing any reference to the previous restriction of one block per post. -* Improves the inline documentation for the `WPSEO_Option` class. Props to @costdev. +* Improves the inline documentation for the `WPSEO_Option` class. Props to [costdev](https://github.com/costdev). * Leverages Script Strategy feature to add the async attribute to the `wordproof` script in case WordPress version is 6.3 or higher. Props to [adamsilverstein](https://github.com/adamsilverstein). = 21.4 = From 74353ce46a03803be5b1ad5d714578f61acad263 Mon Sep 17 00:00:00 2001 From: manuelaugustin Date: Thu, 19 Oct 2023 16:40:06 +0200 Subject: [PATCH 04/31] Update readme.txt --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 246f1d698c2..ab987d7fc1b 100644 --- a/readme.txt +++ b/readme.txt @@ -360,7 +360,7 @@ Release date: 2023-10-31 #### Bugfixes -* Specifies the correct prop type for props that can contain an interpolated string. +* Fixes a bug where console warnings about incorrect prop types would be shown on the integrations page. #### Other From e4d2459a6a38c393ee2592f8b207745efb563ac2 Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Thu, 19 Oct 2023 16:59:56 +0200 Subject: [PATCH 05/31] Deprecate unused classes. These two classes were used in the old 'Integration' tab, and were kept because ithe 'integration' tab is still used in multisites. However, they refer to functionalities that are unavailable in multisites. --- .../deprecated-classes.php | 4 + .../src}/integrations/third-party/wincher.php | 72 +++----- .../wordproof-integration-toggle.php | 60 ++----- .../integrations/third-party/wincher-test.php | 168 ------------------ 4 files changed, 47 insertions(+), 257 deletions(-) rename src/{ => deprecated/src}/integrations/third-party/wincher.php (53%) rename src/{ => deprecated/src}/integrations/third-party/wordproof-integration-toggle.php (63%) delete mode 100644 tests/unit/integrations/third-party/wincher-test.php diff --git a/config/dependency-injection/deprecated-classes.php b/config/dependency-injection/deprecated-classes.php index 0a20094b0f6..f731d54932b 100644 --- a/config/dependency-injection/deprecated-classes.php +++ b/config/dependency-injection/deprecated-classes.php @@ -35,6 +35,8 @@ use Yoast\WP\SEO\Integrations\Schema_Blocks; use Yoast\WP\SEO\Integrations\Third_Party\CoAuthors_Plus; use Yoast\WP\SEO\Integrations\Third_Party\The_Events_Calendar; +use Yoast\WP\SEO\Integrations\Third_Party\Wincher; +use Yoast\WP\SEO\Integrations\Third_Party\Wordproof_Integration_Toggle; use Yoast\WP\SEO\Routes\Indexables_Page_Route; use Yoast\WP\SEO\Schema_Templates\Assets\Icons; @@ -56,6 +58,8 @@ Schema_Blocks::class => '20.5', Icons::class => '20.5', Old_Premium_Integration::class => '20.10', + Wincher::class => '21.6', + Wordproof_Integration_Toggle::class => '21.6', ]; foreach ( $deprecated_classes as $original_class => $version ) { diff --git a/src/integrations/third-party/wincher.php b/src/deprecated/src/integrations/third-party/wincher.php similarity index 53% rename from src/integrations/third-party/wincher.php rename to src/deprecated/src/integrations/third-party/wincher.php index 6ce08e9f323..a4e02e258bb 100644 --- a/src/integrations/third-party/wincher.php +++ b/src/deprecated/src/integrations/third-party/wincher.php @@ -9,6 +9,9 @@ /** * Adds the Wincher integration. + * + * @deprecated 21.6 + * @codeCoverageIgnore */ class Wincher implements Integration_Interface { @@ -22,6 +25,9 @@ class Wincher implements Integration_Interface { /** * The Wincher integration toggle constructor. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @param Wincher_Helper $wincher The Wincher helper instance. */ public function __construct( Wincher_Helper $wincher ) { @@ -31,23 +37,21 @@ public function __construct( Wincher_Helper $wincher ) { /** * Initializes the integration. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @return void */ public function register_hooks() { - /** - * Called by Yoast_Integration_Toggles to add extra toggles to the ones defined there. - */ - \add_filter( 'wpseo_integration_toggles', [ $this, 'add_integration_toggle' ] ); - - /** - * Add extra text after the network integration toggle if the toggle is disabled. - */ - \add_action( 'Yoast\WP\SEO\admin_network_integration_after', [ $this, 'after_network_integration_toggle' ] ); + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); } /** * Returns the conditionals based in which this loadable should be active. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @return array The conditionals. */ public static function get_conditionals() { @@ -57,25 +61,15 @@ public static function get_conditionals() { /** * Adds the Wincher integration toggle to the $integration_toggles array. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @param array $integration_toggles The integration toggles array. * * @return array The updated integration toggles array. */ public function add_integration_toggle( $integration_toggles ) { - if ( \is_array( $integration_toggles ) ) { - $integration_toggles[] = (object) [ - /* translators: %s: 'Wincher' */ - 'name' => \sprintf( \__( '%s integration', 'wordpress-seo' ), 'Wincher' ), - 'setting' => 'wincher_integration_active', - 'label' => \sprintf( - /* translators: %s: 'Wincher' */ - \__( 'The %s integration offers the option to track specific keyphrases and gain insights in their positions.', 'wordpress-seo' ), - 'Wincher' - ), - 'order' => 11, - 'disabled' => \is_multisite(), - ]; - } + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); return $integration_toggles; } @@ -83,43 +77,27 @@ public function add_integration_toggle( $integration_toggles ) { /** * Adds the disabled note when the integration toggle is disabled. * - * @deprecated 20.3 + * @deprecated 21.6 * @codeCoverageIgnore * * @param Yoast_Feature_Toggle $integration The integration toggle class. */ public function after_integration_toggle( $integration ) { - \_deprecated_function( __METHOD__, 'Yoast SEO 20.3' ); - if ( $integration->setting === 'wincher_integration_active' ) { - if ( \is_multisite() ) { - $this->get_disabled_note(); - } - } + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); + } /** * Adds the disabled note to the network integration toggle. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @param Yoast_Feature_Toggle $integration The integration toggle class. */ public function after_network_integration_toggle( $integration ) { - if ( $integration->setting === 'wincher_integration_active' ) { - $this->get_disabled_note(); - } - } + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); - /** - * Outputs the disabled note. - * - * @codeCoverageIgnore - * - * @return void - */ - protected function get_disabled_note() { - echo '

', \sprintf( - /* translators: %s expands to Wincher */ - \esc_html__( 'Currently, the %s integration is not available for multisites.', 'wordpress-seo' ), - 'Wincher' - ), '

'; } + } diff --git a/src/integrations/third-party/wordproof-integration-toggle.php b/src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php similarity index 63% rename from src/integrations/third-party/wordproof-integration-toggle.php rename to src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php index d352e7f9045..7494268e589 100644 --- a/src/integrations/third-party/wordproof-integration-toggle.php +++ b/src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php @@ -10,10 +10,12 @@ /** * Class WordProofIntegrationToggle. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @package Yoast\WP\SEO\Integrations\Third_Party */ class Wordproof_Integration_Toggle implements Integration_Interface { - /** * The WordProof helper instance. * @@ -24,6 +26,9 @@ class Wordproof_Integration_Toggle implements Integration_Interface { /** * The WordProof integration toggle constructor. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @param Wordproof_Helper $wordproof The WordProof helper instance. */ public function __construct( Wordproof_Helper $wordproof ) { @@ -33,6 +38,9 @@ public function __construct( Wordproof_Helper $wordproof ) { /** * Returns the conditionals based in which this loadable should be active. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @return array */ public static function get_conditionals() { @@ -44,51 +52,27 @@ public static function get_conditionals() { * * This is the place to register hooks and filters. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @return void */ public function register_hooks() { - /** - * Called by Yoast_Integration_Toggles to add extra toggles to the ones defined there. - */ - \add_filter( 'wpseo_integration_toggles', [ $this, 'add_integration_toggle' ] ); - - /** - * Update the default wordproof_integration_active depending if the integration is disabled or not. - */ - \add_filter( 'wpseo_option_wpseo_defaults', [ $this, 'default_values' ] ); - - /** - * Add extra text after the network integration toggle if the toggle is disabled. - */ - \add_action( 'Yoast\WP\SEO\admin_network_integration_after', [ $this, 'after_network_integration_toggle' ] ); + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); } /** * Adds the WordProof integration toggle to the array. * + * @deprecated 21.6 + * @codeCoverageIgnore + * * @param array $integration_toggles The integration toggles array. * * @return array The updated integration toggles array. */ public function add_integration_toggle( $integration_toggles ) { - if ( \is_array( $integration_toggles ) ) { - $integration_toggles[] = (object) [ - /* translators: %s expands to WordProof */ - 'name' => \sprintf( \__( '%s integration', 'wordpress-seo' ), 'WordProof' ), - 'setting' => 'wordproof_integration_active', - 'label' => \sprintf( - /* translators: %s expands to WordProof */ - \__( '%1$s can be used to timestamp your privacy page.', 'wordpress-seo' ), - 'WordProof' - ), - /* translators: %s expands to WordProof */ - 'read_more_label' => \sprintf( \__( 'Read more about how %s works.', 'wordpress-seo' ), 'WordProof ' ), - 'read_more_url' => 'https://yoa.st/wordproof-integration', - 'order' => 16, - 'disabled' => $this->wordproof->integration_is_disabled(), - 'new' => true, - ]; - } + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); return $integration_toggles; } @@ -144,14 +128,6 @@ public function after_integration_toggle( $integration ) { * @param Yoast_Feature_Toggle $integration The integration toggle class. */ public function after_network_integration_toggle( $integration ) { - if ( $integration->setting === 'wordproof_integration_active' ) { - if ( $integration->disabled ) { - echo '

' . \sprintf( - /* translators: %s expands to WordProof */ - \esc_html__( 'Currently, the %s integration is not available for multisites.', 'wordpress-seo' ), - 'WordProof' - ) . '

'; - } - } + \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); } } diff --git a/tests/unit/integrations/third-party/wincher-test.php b/tests/unit/integrations/third-party/wincher-test.php deleted file mode 100644 index 0d2308f2ac7..00000000000 --- a/tests/unit/integrations/third-party/wincher-test.php +++ /dev/null @@ -1,168 +0,0 @@ -stubEscapeFunctions(); - $this->stubTranslationFunctions(); - - $this->wincher = Mockery::mock( Wincher_Helper::class ); - $this->instance = Mockery::mock( Wincher::class, [ $this->wincher ] ) - ->makePartial() - ->shouldAllowMockingProtectedMethods(); - } - - /** - * Tests if given dependencies are set as expected. - * - * @covers ::__construct - */ - public function test_constructor() { - $this->assertInstanceOf( Wincher::class, $this->instance ); - $this->assertInstanceOf( - Wincher_Helper::class, - $this->getPropertyValue( $this->instance, 'wincher' ) - ); - } - - /** - * Tests if the expected conditionals are in place. - * - * @covers ::get_conditionals - */ - public function test_get_conditionals() { - $this->assertEquals( - [ - Admin_Conditional::class, - ], - Wincher::get_conditionals() - ); - } - - /** - * Tests the registration of the hooks. - * - * @covers ::register_hooks - */ - public function test_register_hooks() { - $this->instance->register_hooks(); - - $this->assertNotFalse( Monkey\Filters\has( 'wpseo_integration_toggles', [ $this->instance, 'add_integration_toggle' ] ) ); - } - - /** - * Tests the add_integration_toggle request function. - * - * @covers ::add_integration_toggle - */ - public function test_add_integration_toggle() { - $result = $this->instance->add_integration_toggle( $this->get_integration_toggles() ); - $this->assertEquals( - (object) [ - 'name' => 'Wincher integration', - 'setting' => 'wincher_integration_active', - 'label' => 'The Wincher integration offers the option to track specific keyphrases and gain insights in their positions.', - 'order' => 11, - 'disabled' => false, - ], - $result[2] - ); - } - - /** - * Tests the disabled add_integration_toggle request function. - * - * @covers ::add_integration_toggle - */ - public function test_add_integration_toggle_disabled() { - Monkey\Functions\stubs( [ 'is_multisite' => true ] ); - - $result = $this->instance->add_integration_toggle( $this->get_integration_toggles() ); - $this->assertEquals( - (object) [ - 'name' => 'Wincher integration', - 'setting' => 'wincher_integration_active', - 'label' => 'The Wincher integration offers the option to track specific keyphrases and gain insights in their positions.', - 'order' => 11, - 'disabled' => true, - ], - $result[2] - ); - } - - /** - * Tests the after_network_integration_toggle method. - * - * @covers ::after_network_integration_toggle - */ - public function test_after_network_integration_toggle() { - - $wincher_integration_toggle = (object) [ - 'setting' => 'wincher_integration_active', - 'disabled' => true, - ]; - - $this->instance->expects( 'get_disabled_note' )->once(); - - $this->instance->after_network_integration_toggle( $wincher_integration_toggle ); - } - - /** - * The integration toggles to test with. - * - * @return array The integration toggles. - */ - private function get_integration_toggles() { - return [ - (object) [ - 'name' => 'Semrush integration', - 'setting' => 'semrush_integration_active', - 'label' => 'The Semrush integration offers suggestions and insights for keywords related to the entered focus keyphrase.', - 'order' => 10, - ], - (object) [ - 'name' => 'Ryte integration', - 'setting' => 'ryte_indexability', - 'label' => 'Ryte will check weekly if your site is still indexable by search engines and Yoast SEO will notify you when this is not the case.', - 'read_more_label' => 'Read more about how Ryte works.', - 'read_more_url' => 'https://yoa.st/2an', - 'order' => 15, - ], - ]; - } -} From 6056e54c10acb7aac6ddcbb8cf8ea5df620c1efe Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Thu, 19 Oct 2023 17:02:33 +0200 Subject: [PATCH 06/31] Remove dead code. This code was used by the Wincher toggle in the old 'integrations' tab, which has now been deprecated. --- packages/js/src/initializers/admin.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/js/src/initializers/admin.js b/packages/js/src/initializers/admin.js index 8aaf8617ae3..2b329b414f5 100644 --- a/packages/js/src/initializers/admin.js +++ b/packages/js/src/initializers/admin.js @@ -313,14 +313,6 @@ export default function initAdmin( jQuery ) { } } ).trigger( "change" ); - // Toggle the Wincher section. - jQuery( "#wincher_integration_active input[type='radio']" ).change( function() { - // The value on is enabled, off is disabled. - if ( jQuery( this ).is( ":checked" ) ) { - jQuery( "#wincher-connection" ).toggle( jQuery( this ).val() === "on" ); - } - } ).change(); - // Handle the settings pages tabs. jQuery( "#wpseo-tabs" ).find( "a" ).on( "click", function( event ) { var canChangeTab = true; From f6ccfd27b88c4ae9640a0b8c1a41fb83a7c1fb33 Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Fri, 20 Oct 2023 10:17:12 +0200 Subject: [PATCH 07/31] Fix cs --- .../src/integrations/third-party/wincher.php | 3 --- .../third-party/wordproof-integration-toggle.php | 11 ++++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/deprecated/src/integrations/third-party/wincher.php b/src/deprecated/src/integrations/third-party/wincher.php index a4e02e258bb..a9f09d493a1 100644 --- a/src/deprecated/src/integrations/third-party/wincher.php +++ b/src/deprecated/src/integrations/third-party/wincher.php @@ -84,7 +84,6 @@ public function add_integration_toggle( $integration_toggles ) { */ public function after_integration_toggle( $integration ) { \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); - } /** @@ -97,7 +96,5 @@ public function after_integration_toggle( $integration ) { */ public function after_network_integration_toggle( $integration ) { \_deprecated_function( __METHOD__, 'Yoast SEO 21.6' ); - } - } diff --git a/src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php b/src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php index 7494268e589..7c8074f5cb9 100644 --- a/src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php +++ b/src/deprecated/src/integrations/third-party/wordproof-integration-toggle.php @@ -16,6 +16,7 @@ * @package Yoast\WP\SEO\Integrations\Third_Party */ class Wordproof_Integration_Toggle implements Integration_Interface { + /** * The WordProof helper instance. * @@ -27,7 +28,7 @@ class Wordproof_Integration_Toggle implements Integration_Interface { * The WordProof integration toggle constructor. * * @deprecated 21.6 - * @codeCoverageIgnore + * @codeCoverageIgnore * * @param Wordproof_Helper $wordproof The WordProof helper instance. */ @@ -39,7 +40,7 @@ public function __construct( Wordproof_Helper $wordproof ) { * Returns the conditionals based in which this loadable should be active. * * @deprecated 21.6 - * @codeCoverageIgnore + * @codeCoverageIgnore * * @return array */ @@ -53,7 +54,7 @@ public static function get_conditionals() { * This is the place to register hooks and filters. * * @deprecated 21.6 - * @codeCoverageIgnore + * @codeCoverageIgnore * * @return void */ @@ -65,8 +66,8 @@ public function register_hooks() { * Adds the WordProof integration toggle to the array. * * @deprecated 21.6 - * @codeCoverageIgnore - * + * @codeCoverageIgnore + * * @param array $integration_toggles The integration toggles array. * * @return array The updated integration toggles array. From fef9071c2ffc14f34302aac92aaa8893f0dff3ad Mon Sep 17 00:00:00 2001 From: vraja-pro Date: Fri, 20 Oct 2023 16:14:32 +0200 Subject: [PATCH 08/31] fix introduction modal background --- css/src/introductions.css | 4 ++++ packages/js/src/ai-generator/initialize.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/css/src/introductions.css b/css/src/introductions.css index a047f9f9d91..2a702524f83 100644 --- a/css/src/introductions.css +++ b/css/src/introductions.css @@ -6,4 +6,8 @@ focus:yst-outline-none focus:yst-ring-offset-0; } + .yst-introduction-modal-panel { + background: rgb(237,210,225); + background: linear-gradient(180deg, rgba(237,210,225,1) 10%, rgb(255, 255, 255) 60%); + } } diff --git a/packages/js/src/ai-generator/initialize.js b/packages/js/src/ai-generator/initialize.js index 974645e9661..e048379933e 100644 --- a/packages/js/src/ai-generator/initialize.js +++ b/packages/js/src/ai-generator/initialize.js @@ -32,7 +32,7 @@ const AiGeneratorUpsell = ( { fieldId } ) => { { __( "Use AI", "wordpress-seo" ) } - + From 8705ee9f7735022f956d26be0662f80414eb5a17 Mon Sep 17 00:00:00 2001 From: vraja-pro Date: Fri, 20 Oct 2023 16:14:53 +0200 Subject: [PATCH 09/31] fix letter spacing --- .../components/ai-generate-titles-and-descriptions-upsell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js b/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js index f6a7c74b349..f2ac9aaea0b 100644 --- a/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js +++ b/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js @@ -27,7 +27,7 @@ export const AiGenerateTitlesAndDescriptionsUpsell = ( { learnMoreLink, upsellLi Beta
- + { sprintf( /* translators: %1$s expands to Yoast SEO Premium. */ __( "New to %1$s", "wordpress-seo" ), From 808d65be88c58937f365b52a15fd9f3444b9229e Mon Sep 17 00:00:00 2001 From: vraja-pro Date: Fri, 20 Oct 2023 16:15:13 +0200 Subject: [PATCH 10/31] fix copy of upsell button --- .../ai-generate-titles-and-descriptions-upsell.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js b/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js index f2ac9aaea0b..9b557d1159b 100644 --- a/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js +++ b/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js @@ -76,7 +76,11 @@ export const AiGenerateTitlesAndDescriptionsUpsell = ( { learnMoreLink, upsellLi ref={ initialFocus } > - { __( "Unlock with Premium", "wordpress-seo" ) } + { sprintf( + /* translators: %1$s expands to Yoast SEO Premium. */ + __( "Unlock with %1$s", "wordpress-seo" ), + "Yoast SEO Premium" + ) } { /* translators: Hidden accessibility text. */ From 9c368a66903973ab6ef44d1a99a0da07739c7a55 Mon Sep 17 00:00:00 2001 From: Vraja Das Date: Fri, 20 Oct 2023 16:44:48 +0200 Subject: [PATCH 11/31] fix new line styling --- css/src/introductions.css | 4 ++++ .../components/ai-generate-titles-and-descriptions-upsell.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/css/src/introductions.css b/css/src/introductions.css index 2a702524f83..41a4e6e71db 100644 --- a/css/src/introductions.css +++ b/css/src/introductions.css @@ -10,4 +10,8 @@ background: rgb(237,210,225); background: linear-gradient(180deg, rgba(237,210,225,1) 10%, rgb(255, 255, 255) 60%); } + .yst-introduction-modal-uppercase{ + letter-spacing: 0.8px; + @apply yst-uppercase yst-text-slate-500; + } } diff --git a/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js b/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js index 9b557d1159b..6d8be224bf4 100644 --- a/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js +++ b/packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js @@ -27,7 +27,7 @@ export const AiGenerateTitlesAndDescriptionsUpsell = ( { learnMoreLink, upsellLi Beta
- + { sprintf( /* translators: %1$s expands to Yoast SEO Premium. */ __( "New to %1$s", "wordpress-seo" ), From ebaf17ec16b6e0cde3d49d05983f305252e1b386 Mon Sep 17 00:00:00 2001 From: vraja-pro Date: Mon, 23 Oct 2023 15:53:12 +0200 Subject: [PATCH 12/31] fix css --- css/src/introductions.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/css/src/introductions.css b/css/src/introductions.css index 41a4e6e71db..aa72b205234 100644 --- a/css/src/introductions.css +++ b/css/src/introductions.css @@ -7,8 +7,7 @@ focus:yst-ring-offset-0; } .yst-introduction-modal-panel { - background: rgb(237,210,225); - background: linear-gradient(180deg, rgba(237,210,225,1) 10%, rgb(255, 255, 255) 60%); + background-image: linear-gradient(180deg, rgba(166, 30, 105, 0.25) 10%, rgba(255, 255, 255, 0.25) 50%); } .yst-introduction-modal-uppercase{ letter-spacing: 0.8px; From 49e3e543a42a4a72a6ef2e6f8347c39a1062c78b Mon Sep 17 00:00:00 2001 From: vraja-pro Date: Mon, 23 Oct 2023 17:18:12 +0200 Subject: [PATCH 13/31] add introduction modal style to user profile page --- .../user-profiles-additions-ui.php | 43 ++++++++++++- .../user-profiles-additions-ui-test.php | 61 ++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/src/user-profiles-additions/user-interface/user-profiles-additions-ui.php b/src/user-profiles-additions/user-interface/user-profiles-additions-ui.php index e58d64ca8e8..4c9c9789ea9 100644 --- a/src/user-profiles-additions/user-interface/user-profiles-additions-ui.php +++ b/src/user-profiles-additions/user-interface/user-profiles-additions-ui.php @@ -2,6 +2,8 @@ namespace Yoast\WP\SEO\User_Profiles_Additions\User_Interface; +use WPSEO_Admin_Asset_Manager; +use Yoast\WP\SEO\Helpers\Product_Helper; use Yoast\WP\SEO\Conditionals\User_Profile_Conditional; use Yoast\WP\SEO\Integrations\Integration_Interface; @@ -10,6 +12,34 @@ */ class User_Profiles_Additions_Ui implements Integration_Interface { + /** + * Holds the Product_Helper. + * + * @var Product_Helper + */ + private $product_helper; + + /** + * Holds the WPSEO_Admin_Asset_Manager. + * + * @var WPSEO_Admin_Asset_Manager + */ + private $asset_manager; + + /** + * Constructs Academy_Integration. + * + * @param WPSEO_Admin_Asset_Manager $asset_manager The WPSEO_Admin_Asset_Manager. + * @param Product_Helper $product_helper The Product_Helper. + */ + public function __construct( + WPSEO_Admin_Asset_Manager $asset_manager, + Product_Helper $product_helper + ) { + $this->asset_manager = $asset_manager; + $this->product_helper = $product_helper; + } + /** * Returns the conditionals based in which this loadable should be active. * @@ -31,13 +61,24 @@ public function register_hooks() { \add_action( 'edit_user_profile', [ $this, 'add_hook_to_user_profile' ] ); } + /** + * Enqueues the assets needed for this integration. + * + * @return void + */ + public function enqueue_assets() { + if ( $this->product_helper->is_premium() ) { + $this->asset_manager->enqueue_style( 'introductions' ); + } + } + /** * Add the inputs needed for SEO values to the User Profile page. * * @param WP_User $user User instance to output for. */ public function add_hook_to_user_profile( $user ) { - + $this->enqueue_assets(); echo '
'; /** diff --git a/tests/unit/user-profiles-additions/user-interface/user-profiles-additions-ui-test.php b/tests/unit/user-profiles-additions/user-interface/user-profiles-additions-ui-test.php index 8f200078a33..41358e6c81b 100644 --- a/tests/unit/user-profiles-additions/user-interface/user-profiles-additions-ui-test.php +++ b/tests/unit/user-profiles-additions/user-interface/user-profiles-additions-ui-test.php @@ -4,6 +4,8 @@ use Brain\Monkey; use Mockery; +use WPSEO_Admin_Asset_Manager; +use Yoast\WP\SEO\Helpers\Product_Helper; use Yoast\WP\SEO\Conditionals\User_Profile_Conditional; use Yoast\WP\SEO\Tests\Unit\TestCase; use Yoast\WP\SEO\User_Profiles_Additions\User_Interface\User_Profiles_Additions_Ui; @@ -18,6 +20,20 @@ */ class User_Profiles_Additions_Ui_Test extends TestCase { + /** + * The mocked asset manager. + * + * @var Mockery\MockInterface|WPSEO_Admin_Asset_Manager + */ + protected $asset_manager; + + /** + * The mocked asset product helper. + * + * @var Mockery\MockInterface|Product_Helper + */ + protected $product_helper; + /** * The User_Profiles_Additions_Ui. * @@ -30,8 +46,26 @@ class User_Profiles_Additions_Ui_Test extends TestCase { */ protected function set_up() { parent::set_up(); + $this->asset_manager = Mockery::mock( 'WPSEO_Admin_Asset_Manager' ); + $this->product_helper = Mockery::mock( 'Yoast\WP\SEO\Helpers\Product_Helper' ); + + $this->instance = new User_Profiles_Additions_Ui( $this->asset_manager, $this->product_helper ); + } - $this->instance = new User_Profiles_Additions_Ui(); + /** + * Test construct method. + * + * @covers ::__construct + */ + public function test_construct() { + $this->assertInstanceOf( + WPSEO_Admin_Asset_Manager::class, + $this->getPropertyValue( $this->instance, 'asset_manager' ) + ); + $this->assertInstanceOf( + Product_Helper::class, + $this->getPropertyValue( $this->instance, 'product_helper' ) + ); } /** @@ -46,6 +80,26 @@ public function test_get_conditionals() { ); } + /** + * Test enqueue_assets method. + * + * @covers ::enqueue_assets + */ + public function test_enqueue_assets() { + + $this->product_helper + ->expects( 'is_premium' ) + ->once() + ->andReturn( true ); + + $this->asset_manager + ->expects( 'enqueue_style' ) + ->with( 'introductions' ) + ->once(); + + $this->instance->enqueue_assets(); + } + /** * Tests the registration of the hooks. * @@ -67,6 +121,11 @@ public function test_add_hook_to_user_profile() { $user = Mockery::mock( \WP_User::class ); + $this->product_helper + ->expects( 'is_premium' ) + ->once() + ->andReturn( false ); + Monkey\Actions\expectDone( 'wpseo_user_profile_additions' ) ->once() ->with( $user ); From 99aeca8e50c2c4ec51c8503b40ed77701e2e6262 Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Tue, 24 Oct 2023 12:21:38 +0200 Subject: [PATCH 14/31] Fix scrollable upsell modal. * The max-width has been increased (before it was the Wordpress default) * We now use the WordPress heading bottom border instead of adding our own --- css/src/modal.css | 5 +++++ packages/js/src/components/UpsellBox.js | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/css/src/modal.css b/css/src/modal.css index 714ac12d7ec..19993dd31a5 100644 --- a/css/src/modal.css +++ b/css/src/modal.css @@ -64,6 +64,7 @@ @media (min-width: 600px) { border-radius: 8px; + max-height: calc( 100% - 48px ); } } @@ -80,6 +81,10 @@ margin: 0; } +.yoast-gutenberg-modal .components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header { + border-bottom-color: #e2e8f0; +} + .yoast-gutenberg-modal .components-modal__icon-container { display: inline-flex; } diff --git a/packages/js/src/components/UpsellBox.js b/packages/js/src/components/UpsellBox.js index 1340bf12617..6fc8bd6e47a 100644 --- a/packages/js/src/components/UpsellBox.js +++ b/packages/js/src/components/UpsellBox.js @@ -117,7 +117,6 @@ class UpsellBox extends Component { const price = newPrice ? newPrice : defaultPrice; return ( -
{ isBlackFriday &&
{ __( "BLACK FRIDAY", "wordpress-seo" ) }
From c7fc4f6fbb11d977a9567d092dbb5889973c320f Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Tue, 24 Oct 2023 12:28:02 +0200 Subject: [PATCH 15/31] Revert "Fix scrollable upsell modal." This reverts commit 99aeca8e50c2c4ec51c8503b40ed77701e2e6262. --- css/src/modal.css | 5 ----- packages/js/src/components/UpsellBox.js | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/css/src/modal.css b/css/src/modal.css index 19993dd31a5..714ac12d7ec 100644 --- a/css/src/modal.css +++ b/css/src/modal.css @@ -64,7 +64,6 @@ @media (min-width: 600px) { border-radius: 8px; - max-height: calc( 100% - 48px ); } } @@ -81,10 +80,6 @@ margin: 0; } -.yoast-gutenberg-modal .components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header { - border-bottom-color: #e2e8f0; -} - .yoast-gutenberg-modal .components-modal__icon-container { display: inline-flex; } diff --git a/packages/js/src/components/UpsellBox.js b/packages/js/src/components/UpsellBox.js index 6fc8bd6e47a..1340bf12617 100644 --- a/packages/js/src/components/UpsellBox.js +++ b/packages/js/src/components/UpsellBox.js @@ -117,6 +117,7 @@ class UpsellBox extends Component { const price = newPrice ? newPrice : defaultPrice; return ( +
{ isBlackFriday &&
{ __( "BLACK FRIDAY", "wordpress-seo" ) }
From a90390d60da4c9a32187df44e2ba716c705b262e Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Tue, 24 Oct 2023 12:32:51 +0200 Subject: [PATCH 16/31] Fix scrollable upsell modal. * The max-width has been increased (before it was the Wordpress default) * We now use the WordPress heading bottom border instead of adding our own --- css/src/modal.css | 5 +++++ packages/js/src/components/UpsellBox.js | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/css/src/modal.css b/css/src/modal.css index 714ac12d7ec..19993dd31a5 100644 --- a/css/src/modal.css +++ b/css/src/modal.css @@ -64,6 +64,7 @@ @media (min-width: 600px) { border-radius: 8px; + max-height: calc( 100% - 48px ); } } @@ -80,6 +81,10 @@ margin: 0; } +.yoast-gutenberg-modal .components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header { + border-bottom-color: #e2e8f0; +} + .yoast-gutenberg-modal .components-modal__icon-container { display: inline-flex; } diff --git a/packages/js/src/components/UpsellBox.js b/packages/js/src/components/UpsellBox.js index 1340bf12617..6fc8bd6e47a 100644 --- a/packages/js/src/components/UpsellBox.js +++ b/packages/js/src/components/UpsellBox.js @@ -117,7 +117,6 @@ class UpsellBox extends Component { const price = newPrice ? newPrice : defaultPrice; return ( -
{ isBlackFriday &&
{ __( "BLACK FRIDAY", "wordpress-seo" ) }
From 50c5a7077350a5b4c5e1407e2758fa635d006cda Mon Sep 17 00:00:00 2001 From: "Paolo L. Scala" <68744851+pls78@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:49:30 +0200 Subject: [PATCH 17/31] Update css/src/modal.css Co-authored-by: Igor <35524806+igorschoester@users.noreply.github.com> --- css/src/modal.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/src/modal.css b/css/src/modal.css index 19993dd31a5..98ba438b8e1 100644 --- a/css/src/modal.css +++ b/css/src/modal.css @@ -81,8 +81,8 @@ margin: 0; } -.yoast-gutenberg-modal .components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header { - border-bottom-color: #e2e8f0; +.yoast-gutenberg-modal .components-modal__content .components-modal__header { + border-bottom-color: #e2e8f0 !important; } .yoast-gutenberg-modal .components-modal__icon-container { From 810e900af6b542dc859740ec10018afc1c3a62a2 Mon Sep 17 00:00:00 2001 From: YoastBot Date: Tue, 24 Oct 2023 13:09:41 +0000 Subject: [PATCH 18/31] Add changelog --- readme.txt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/readme.txt b/readme.txt index ab987d7fc1b..e15c962e1cf 100644 --- a/readme.txt +++ b/readme.txt @@ -348,19 +348,11 @@ Release date: 2023-10-31 * Adds support for the new `wp_attachment_pages_enabled` option introduced by WordPress 6.4, reducing the chances of inconsistencies with Yoast SEO's own \"Enable media pages\" setting. * Improves the _inclusive language_ analysis by making the feedback more clear and consistent, refining the list of targeted phrases, and adding more alternatives for some of the non-inclusive phrases. Specifically, this includes the following changes: - * Aligns the traffic light color and written feedback for all phrases. - * Makes some feedback strings more accurate by replacing the word ‘overgeneralizing’ with ‘harmful’. - * Adds ‘Rom’ and ‘Roma’ as additional alternatives to ‘gypsy’. - * Adds additional alternatives to ‘homosexuals’. - * Improves the feedback shown for the phrases ‘abnormal behaviour’, ‘behaviourally normal’, and ‘behaviourally abnormal’. - * Improves the feedback shown for the word ‘minorities’. - * Removes ‘narcissistic’ as a targeted phrase when followed by ‘personality disorder’. - * Removes ‘Ebonics’ and ‘normal behaviour’ from the list of targeted phrases. * Removes the automatic `rel=nofollow` attribute for links in the RSS feed. #### Bugfixes -* Fixes a bug where console warnings about incorrect prop types would be shown on the integrations page. +* Fixes a bug where console warnings about incorrect prop types would be shown on the integrations page. #### Other @@ -368,6 +360,7 @@ Release date: 2023-10-31 * Improves the FAQ block description by removing any reference to the previous restriction of one block per post. * Improves the inline documentation for the `WPSEO_Option` class. Props to [costdev](https://github.com/costdev). * Leverages Script Strategy feature to add the async attribute to the `wordproof` script in case WordPress version is 6.3 or higher. Props to [adamsilverstein](https://github.com/adamsilverstein). +* Sets the WordPress tested up to version to 6.4. = 21.4 = From 12aa01767af4407c98dfeb0a2981476be9b578cc Mon Sep 17 00:00:00 2001 From: YoastBot Date: Tue, 24 Oct 2023 13:09:47 +0000 Subject: [PATCH 19/31] Bump version to 21.5-RC3 --- package.json | 2 +- wp-seo-main.php | 2 +- wp-seo.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b616d41a26d..97b608e0254 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "typescript": "^4.2.4" }, "yoast": { - "pluginVersion": "21.5-RC2" + "pluginVersion": "21.5-RC3" }, "version": "0.0.0" } diff --git a/wp-seo-main.php b/wp-seo-main.php index 87f6f3781fc..ccfe2889477 100644 --- a/wp-seo-main.php +++ b/wp-seo-main.php @@ -15,7 +15,7 @@ * {@internal Nobody should be able to overrule the real version number as this can cause * serious issues with the options, so no if ( ! defined() ).}} */ -define( 'WPSEO_VERSION', '21.5-RC2' ); +define( 'WPSEO_VERSION', '21.5-RC3' ); if ( ! defined( 'WPSEO_PATH' ) ) { diff --git a/wp-seo.php b/wp-seo.php index 851f64c1f6d..146d3cd7c56 100644 --- a/wp-seo.php +++ b/wp-seo.php @@ -8,7 +8,7 @@ * * @wordpress-plugin * Plugin Name: Yoast SEO - * Version: 21.5-RC2 + * Version: 21.5-RC3 * Plugin URI: https://yoa.st/1uj * Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more. * Author: Team Yoast From 93b4a9dd7a6166e76e4897fd20b045fce2148f3b Mon Sep 17 00:00:00 2001 From: Igor <35524806+igorschoester@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:27:30 +0200 Subject: [PATCH 20/31] Fix changelog --- readme.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.txt b/readme.txt index e15c962e1cf..b3aa22aad99 100644 --- a/readme.txt +++ b/readme.txt @@ -348,6 +348,14 @@ Release date: 2023-10-31 * Adds support for the new `wp_attachment_pages_enabled` option introduced by WordPress 6.4, reducing the chances of inconsistencies with Yoast SEO's own \"Enable media pages\" setting. * Improves the _inclusive language_ analysis by making the feedback more clear and consistent, refining the list of targeted phrases, and adding more alternatives for some of the non-inclusive phrases. Specifically, this includes the following changes: + * Aligns the traffic light color and written feedback for all phrases. + * Makes some feedback strings more accurate by replacing the word ‘overgeneralizing’ with ‘harmful’. + * Adds ‘Rom’ and ‘Roma’ as additional alternatives to ‘gypsy’. + * Adds additional alternatives to ‘homosexuals’. + * Improves the feedback shown for the phrases ‘abnormal behaviour’, ‘behaviourally normal’, and ‘behaviourally abnormal’. + * Improves the feedback shown for the word ‘minorities’. + * Removes ‘narcissistic’ as a targeted phrase when followed by ‘personality disorder’. + * Removes ‘Ebonics’ and ‘normal behaviour’ from the list of targeted phrases. * Removes the automatic `rel=nofollow` attribute for links in the RSS feed. #### Bugfixes From cf3a4a8c83e196967f7883d3d988116a4fc1ea8a Mon Sep 17 00:00:00 2001 From: Igor <35524806+igorschoester@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:00:22 +0200 Subject: [PATCH 21/31] Fix redirects upsell link --- admin/views/redirects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/views/redirects.php b/admin/views/redirects.php index f37a264bfa9..bae929682f4 100644 --- a/admin/views/redirects.php +++ b/admin/views/redirects.php @@ -17,7 +17,7 @@

- + Date: Tue, 24 Oct 2023 16:16:48 +0200 Subject: [PATCH 22/31] Remove makePublic from non-public classes We do not retrieve these classes via our YoastSEO helper. Therefor, we have no reason to expose them. By not exposing we are making it easier for ourselves to maintain code without BC breaking in the future. Although this technically counts as BC break, the code itself is rather new. --- .../ai-generate-titles-and-descriptions-introduction-upsell.php | 2 -- src/introductions/application/introductions-collector.php | 2 -- .../user-interface/wistia-embed-permission-route.php | 2 -- src/promotions/application/promotion-manager-interface.php | 2 -- src/promotions/domain/black-friday-checklist-promotion.php | 2 -- src/promotions/domain/black-friday-promotion.php | 2 -- 6 files changed, 12 deletions(-) diff --git a/src/introductions/application/ai-generate-titles-and-descriptions-introduction-upsell.php b/src/introductions/application/ai-generate-titles-and-descriptions-introduction-upsell.php index fd99ebc96a2..14932c2b9c1 100644 --- a/src/introductions/application/ai-generate-titles-and-descriptions-introduction-upsell.php +++ b/src/introductions/application/ai-generate-titles-and-descriptions-introduction-upsell.php @@ -10,8 +10,6 @@ * Represents the introduction for the AI generate titles and introduction upsell. * * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded - * - * @makePublic */ class Ai_Generate_Titles_And_Descriptions_Introduction_Upsell implements Introduction_Interface { diff --git a/src/introductions/application/introductions-collector.php b/src/introductions/application/introductions-collector.php index d0d4fd5efb4..a1361efac5a 100644 --- a/src/introductions/application/introductions-collector.php +++ b/src/introductions/application/introductions-collector.php @@ -8,8 +8,6 @@ /** * Manages the collection of introductions. - * - * @makePublic */ class Introductions_Collector { diff --git a/src/introductions/user-interface/wistia-embed-permission-route.php b/src/introductions/user-interface/wistia-embed-permission-route.php index 40ccfce0634..6ada268deea 100644 --- a/src/introductions/user-interface/wistia-embed-permission-route.php +++ b/src/introductions/user-interface/wistia-embed-permission-route.php @@ -14,8 +14,6 @@ /** * Registers a route to offer get/set of the wistia embed permission for a user. - * - * @makePublic */ class Wistia_Embed_Permission_Route implements Route_Interface { diff --git a/src/promotions/application/promotion-manager-interface.php b/src/promotions/application/promotion-manager-interface.php index 0b244c9e7bb..a2ef7a3b5dc 100644 --- a/src/promotions/application/promotion-manager-interface.php +++ b/src/promotions/application/promotion-manager-interface.php @@ -4,8 +4,6 @@ /** * Interface for the promotion manager. - * - * @makePublic */ interface Promotion_Manager_Interface { diff --git a/src/promotions/domain/black-friday-checklist-promotion.php b/src/promotions/domain/black-friday-checklist-promotion.php index 8ef4e6dd661..55a4c0be44b 100644 --- a/src/promotions/domain/black-friday-checklist-promotion.php +++ b/src/promotions/domain/black-friday-checklist-promotion.php @@ -4,8 +4,6 @@ /** * Class to manage the Black Friday checklist promotion. - * - * @makePublic */ class Black_Friday_Checklist_Promotion extends Abstract_Promotion implements Promotion_Interface { diff --git a/src/promotions/domain/black-friday-promotion.php b/src/promotions/domain/black-friday-promotion.php index 1693d315350..4fabea28650 100644 --- a/src/promotions/domain/black-friday-promotion.php +++ b/src/promotions/domain/black-friday-promotion.php @@ -4,8 +4,6 @@ /** * Class to manage the Black Friday promotion. - * - * @makePublic */ class Black_Friday_Promotion extends Abstract_Promotion implements Promotion_Interface { From 36974a90ad8bc51d9f9d0f87934df3c025663025 Mon Sep 17 00:00:00 2001 From: Vraja Das Date: Wed, 25 Oct 2023 10:43:14 +0200 Subject: [PATCH 23/31] fix header border bottom in product page upsell modal --- css/src/modal.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/src/modal.css b/css/src/modal.css index 98ba438b8e1..e3484058d3e 100644 --- a/css/src/modal.css +++ b/css/src/modal.css @@ -82,7 +82,7 @@ } .yoast-gutenberg-modal .components-modal__content .components-modal__header { - border-bottom-color: #e2e8f0 !important; + border-bottom: 1px solid #e2e8f0 !important; } .yoast-gutenberg-modal .components-modal__icon-container { From bff46c85a3d5d31f4a949740a49160fffe12d137 Mon Sep 17 00:00:00 2001 From: YoastBot Date: Wed, 25 Oct 2023 09:15:22 +0000 Subject: [PATCH 24/31] Add changelog --- readme.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/readme.txt b/readme.txt index b3aa22aad99..e15c962e1cf 100644 --- a/readme.txt +++ b/readme.txt @@ -348,14 +348,6 @@ Release date: 2023-10-31 * Adds support for the new `wp_attachment_pages_enabled` option introduced by WordPress 6.4, reducing the chances of inconsistencies with Yoast SEO's own \"Enable media pages\" setting. * Improves the _inclusive language_ analysis by making the feedback more clear and consistent, refining the list of targeted phrases, and adding more alternatives for some of the non-inclusive phrases. Specifically, this includes the following changes: - * Aligns the traffic light color and written feedback for all phrases. - * Makes some feedback strings more accurate by replacing the word ‘overgeneralizing’ with ‘harmful’. - * Adds ‘Rom’ and ‘Roma’ as additional alternatives to ‘gypsy’. - * Adds additional alternatives to ‘homosexuals’. - * Improves the feedback shown for the phrases ‘abnormal behaviour’, ‘behaviourally normal’, and ‘behaviourally abnormal’. - * Improves the feedback shown for the word ‘minorities’. - * Removes ‘narcissistic’ as a targeted phrase when followed by ‘personality disorder’. - * Removes ‘Ebonics’ and ‘normal behaviour’ from the list of targeted phrases. * Removes the automatic `rel=nofollow` attribute for links in the RSS feed. #### Bugfixes From ae581aa5cf9467f0f47611c09b63a8fcc2449ca8 Mon Sep 17 00:00:00 2001 From: YoastBot Date: Wed, 25 Oct 2023 09:15:27 +0000 Subject: [PATCH 25/31] Bump version to 21.5-RC4 --- package.json | 2 +- wp-seo-main.php | 2 +- wp-seo.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 97b608e0254..4ec7ed46108 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "typescript": "^4.2.4" }, "yoast": { - "pluginVersion": "21.5-RC3" + "pluginVersion": "21.5-RC4" }, "version": "0.0.0" } diff --git a/wp-seo-main.php b/wp-seo-main.php index ccfe2889477..34bf056e95a 100644 --- a/wp-seo-main.php +++ b/wp-seo-main.php @@ -15,7 +15,7 @@ * {@internal Nobody should be able to overrule the real version number as this can cause * serious issues with the options, so no if ( ! defined() ).}} */ -define( 'WPSEO_VERSION', '21.5-RC3' ); +define( 'WPSEO_VERSION', '21.5-RC4' ); if ( ! defined( 'WPSEO_PATH' ) ) { diff --git a/wp-seo.php b/wp-seo.php index 146d3cd7c56..e1cfb103a6d 100644 --- a/wp-seo.php +++ b/wp-seo.php @@ -8,7 +8,7 @@ * * @wordpress-plugin * Plugin Name: Yoast SEO - * Version: 21.5-RC3 + * Version: 21.5-RC4 * Plugin URI: https://yoa.st/1uj * Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more. * Author: Team Yoast From 82181b6c13f2523e6c726c6f4b713c87254a6e44 Mon Sep 17 00:00:00 2001 From: Igor <35524806+igorschoester@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:53:47 +0200 Subject: [PATCH 26/31] Revert "Add changelog" This reverts commit bff46c85a3d5d31f4a949740a49160fffe12d137. --- readme.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.txt b/readme.txt index e15c962e1cf..b3aa22aad99 100644 --- a/readme.txt +++ b/readme.txt @@ -348,6 +348,14 @@ Release date: 2023-10-31 * Adds support for the new `wp_attachment_pages_enabled` option introduced by WordPress 6.4, reducing the chances of inconsistencies with Yoast SEO's own \"Enable media pages\" setting. * Improves the _inclusive language_ analysis by making the feedback more clear and consistent, refining the list of targeted phrases, and adding more alternatives for some of the non-inclusive phrases. Specifically, this includes the following changes: + * Aligns the traffic light color and written feedback for all phrases. + * Makes some feedback strings more accurate by replacing the word ‘overgeneralizing’ with ‘harmful’. + * Adds ‘Rom’ and ‘Roma’ as additional alternatives to ‘gypsy’. + * Adds additional alternatives to ‘homosexuals’. + * Improves the feedback shown for the phrases ‘abnormal behaviour’, ‘behaviourally normal’, and ‘behaviourally abnormal’. + * Improves the feedback shown for the word ‘minorities’. + * Removes ‘narcissistic’ as a targeted phrase when followed by ‘personality disorder’. + * Removes ‘Ebonics’ and ‘normal behaviour’ from the list of targeted phrases. * Removes the automatic `rel=nofollow` attribute for links in the RSS feed. #### Bugfixes From f26657d629810e2a103d35f39a2d62611773bfbf Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Wed, 25 Oct 2023 16:15:05 +0200 Subject: [PATCH 27/31] Avoid storing the full WP_User object in db. * Store only the user ID in the db. * Fix unit tests to take into account accessing the ID attribute of the WP_User object. --- admin/class-yoast-notification.php | 25 ++++++++++++++---------- tests/unit/admin/admin-features-test.php | 9 ++++++--- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/admin/class-yoast-notification.php b/admin/class-yoast-notification.php index d4b1ea7090b..6f54226b9ee 100644 --- a/admin/class-yoast-notification.php +++ b/admin/class-yoast-notification.php @@ -72,7 +72,7 @@ class Yoast_Notification { private $defaults = [ 'type' => self::UPDATED, 'id' => '', - 'user' => null, + 'user_id' => null, 'nonce' => null, 'priority' => 0.5, 'data_json' => [], @@ -110,12 +110,12 @@ public function get_id() { } /** - * Retrieve the user to show the notification for. + * Retrieve the id of the user to show the notification for. * - * @return WP_User The user to show this notification for. + * @return int The user id. */ public function get_user() { - return $this->options['user']; + return $this->options['user_id']; } /** @@ -127,7 +127,7 @@ public function get_user() { */ public function get_user_id() { if ( $this->get_user() !== null ) { - return $this->get_user()->ID; + return $this->get_user(); } return get_current_user_id(); } @@ -220,7 +220,7 @@ public function display_for_current_user() { */ public function match_capabilities() { // Super Admin can do anything. - if ( is_multisite() && is_super_admin( $this->options['user']->ID ) ) { + if ( is_multisite() && is_super_admin( $this->options['user_id'] ) ) { return true; } @@ -280,7 +280,11 @@ public function match_capabilities() { * @return bool */ private function has_capability( $capability ) { - $user = $this->options['user']; + $user_id = $this->options['user_id']; + if ( ! is_numeric( $user_id ) ) { + return false; + } + $user = get_user_by( 'id', $user_id ); return $user->has_cap( $capability ); } @@ -396,9 +400,10 @@ private function normalize_options( $options ) { $options['capabilities'] = [ 'wpseo_manage_options' ]; } - // Set to the current user if not supplied. - if ( $options['user'] === null ) { - $options['user'] = wp_get_current_user(); + // Set to the id of the current user if not supplied. + if ( $options['user_id'] === null ) { + $user = wp_get_current_user(); + $options['user_id'] = $user->ID; } return $options; diff --git a/tests/unit/admin/admin-features-test.php b/tests/unit/admin/admin-features-test.php index 9763e2de3c4..80ef0eee2fd 100644 --- a/tests/unit/admin/admin-features-test.php +++ b/tests/unit/admin/admin-features-test.php @@ -38,9 +38,12 @@ private function get_admin_with_expectations() { ->with( 'https://example.org', 'dismiss-5star-upsell' ) ->andReturn( 'https://example.org?_wpnonce=test-nonce' ); - Monkey\Functions\expect( 'wp_get_current_user' ) - ->once() - ->andReturn( Mockery::mock( WP_User::class ) ); + $admin_user = Mockery::mock( WP_User::class ); + $admin_user->ID = 1; + + Monkey\Functions\expect( 'wp_get_current_user' ) + ->once() + ->andReturn( $admin_user ); return new WPSEO_Admin(); } From 11276f9d668775675d76f3a0b41b1f720a948516 Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Wed, 25 Oct 2023 16:29:53 +0200 Subject: [PATCH 28/31] Add upgrade routine. The routine will unset the 'user' field in yoast_notifications user meta and add a new 'user_id' field with the user ID. --- inc/class-upgrade.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/inc/class-upgrade.php b/inc/class-upgrade.php index 1dc29a93d2d..b99876f535e 100644 --- a/inc/class-upgrade.php +++ b/inc/class-upgrade.php @@ -89,6 +89,7 @@ public function __construct() { '20.5-RC0' => 'upgrade_205', '20.7-RC0' => 'upgrade_207', '20.8-RC0' => 'upgrade_208', + '21.6-rc0' => 'upgrade_216' ]; array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version ); @@ -1013,6 +1014,46 @@ private function upgrade_208() { } } + /** + * Performs the 21.6 upgrade routine. + * Avoid storing the full WP_User object in each notification and saves just the user id instead. + */ + private function upgrade_216() { + add_action( 'init', [ $this, 'update_notifications_user_id_for_216' ] ); + } + + protected function update_notifications_user_id_for_216() { + global $wpdb; + $meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY; + + $usermetas = $wpdb->get_results( + $wpdb->prepare( + ' + SELECT user_id, meta_value + FROM ' . $wpdb->usermeta . ' + WHERE meta_key = %s + ', + $meta_key + ), + ARRAY_A + ); + + if ( empty( $usermetas ) ) { + return; + } + + foreach ( $usermetas as $usermeta ) { + $notifications = maybe_unserialize( $usermeta['meta_value'] ); + + foreach ( $notifications as $notification ) { + if ( ! empty( $notification['options']['user'] ) ) { + unset( $notification['options']['user'] ); + $notification['options']['user_id'] = $usermeta['user_id']; + } + } + update_user_meta( $usermeta['user_id'], Yoast_Notification_Center::STORAGE_KEY, $notifications ); + } + } /** * Sets the home_url option for the 15.1 upgrade routine. * From 21550f4d4dae0cff39be5496e3233c2bf51ea0bd Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Wed, 25 Oct 2023 16:34:35 +0200 Subject: [PATCH 29/31] Revert "Add upgrade routine." This reverts commit 11276f9d668775675d76f3a0b41b1f720a948516. --- inc/class-upgrade.php | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/inc/class-upgrade.php b/inc/class-upgrade.php index b99876f535e..1dc29a93d2d 100644 --- a/inc/class-upgrade.php +++ b/inc/class-upgrade.php @@ -89,7 +89,6 @@ public function __construct() { '20.5-RC0' => 'upgrade_205', '20.7-RC0' => 'upgrade_207', '20.8-RC0' => 'upgrade_208', - '21.6-rc0' => 'upgrade_216' ]; array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version ); @@ -1014,46 +1013,6 @@ private function upgrade_208() { } } - /** - * Performs the 21.6 upgrade routine. - * Avoid storing the full WP_User object in each notification and saves just the user id instead. - */ - private function upgrade_216() { - add_action( 'init', [ $this, 'update_notifications_user_id_for_216' ] ); - } - - protected function update_notifications_user_id_for_216() { - global $wpdb; - $meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY; - - $usermetas = $wpdb->get_results( - $wpdb->prepare( - ' - SELECT user_id, meta_value - FROM ' . $wpdb->usermeta . ' - WHERE meta_key = %s - ', - $meta_key - ), - ARRAY_A - ); - - if ( empty( $usermetas ) ) { - return; - } - - foreach ( $usermetas as $usermeta ) { - $notifications = maybe_unserialize( $usermeta['meta_value'] ); - - foreach ( $notifications as $notification ) { - if ( ! empty( $notification['options']['user'] ) ) { - unset( $notification['options']['user'] ); - $notification['options']['user_id'] = $usermeta['user_id']; - } - } - update_user_meta( $usermeta['user_id'], Yoast_Notification_Center::STORAGE_KEY, $notifications ); - } - } /** * Sets the home_url option for the 15.1 upgrade routine. * From 0bc4b30b9a035a8145ee6533f7a58b8cd6596f86 Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Wed, 25 Oct 2023 16:34:51 +0200 Subject: [PATCH 30/31] Revert "Avoid storing the full WP_User object in db." This reverts commit f26657d629810e2a103d35f39a2d62611773bfbf. --- admin/class-yoast-notification.php | 25 ++++++++++-------------- tests/unit/admin/admin-features-test.php | 9 +++------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/admin/class-yoast-notification.php b/admin/class-yoast-notification.php index 6f54226b9ee..d4b1ea7090b 100644 --- a/admin/class-yoast-notification.php +++ b/admin/class-yoast-notification.php @@ -72,7 +72,7 @@ class Yoast_Notification { private $defaults = [ 'type' => self::UPDATED, 'id' => '', - 'user_id' => null, + 'user' => null, 'nonce' => null, 'priority' => 0.5, 'data_json' => [], @@ -110,12 +110,12 @@ public function get_id() { } /** - * Retrieve the id of the user to show the notification for. + * Retrieve the user to show the notification for. * - * @return int The user id. + * @return WP_User The user to show this notification for. */ public function get_user() { - return $this->options['user_id']; + return $this->options['user']; } /** @@ -127,7 +127,7 @@ public function get_user() { */ public function get_user_id() { if ( $this->get_user() !== null ) { - return $this->get_user(); + return $this->get_user()->ID; } return get_current_user_id(); } @@ -220,7 +220,7 @@ public function display_for_current_user() { */ public function match_capabilities() { // Super Admin can do anything. - if ( is_multisite() && is_super_admin( $this->options['user_id'] ) ) { + if ( is_multisite() && is_super_admin( $this->options['user']->ID ) ) { return true; } @@ -280,11 +280,7 @@ public function match_capabilities() { * @return bool */ private function has_capability( $capability ) { - $user_id = $this->options['user_id']; - if ( ! is_numeric( $user_id ) ) { - return false; - } - $user = get_user_by( 'id', $user_id ); + $user = $this->options['user']; return $user->has_cap( $capability ); } @@ -400,10 +396,9 @@ private function normalize_options( $options ) { $options['capabilities'] = [ 'wpseo_manage_options' ]; } - // Set to the id of the current user if not supplied. - if ( $options['user_id'] === null ) { - $user = wp_get_current_user(); - $options['user_id'] = $user->ID; + // Set to the current user if not supplied. + if ( $options['user'] === null ) { + $options['user'] = wp_get_current_user(); } return $options; diff --git a/tests/unit/admin/admin-features-test.php b/tests/unit/admin/admin-features-test.php index 80ef0eee2fd..9763e2de3c4 100644 --- a/tests/unit/admin/admin-features-test.php +++ b/tests/unit/admin/admin-features-test.php @@ -38,12 +38,9 @@ private function get_admin_with_expectations() { ->with( 'https://example.org', 'dismiss-5star-upsell' ) ->andReturn( 'https://example.org?_wpnonce=test-nonce' ); - $admin_user = Mockery::mock( WP_User::class ); - $admin_user->ID = 1; - - Monkey\Functions\expect( 'wp_get_current_user' ) - ->once() - ->andReturn( $admin_user ); + Monkey\Functions\expect( 'wp_get_current_user' ) + ->once() + ->andReturn( Mockery::mock( WP_User::class ) ); return new WPSEO_Admin(); } From 9870aab7ebc7f7ce86e382946f406de92c5aa52e Mon Sep 17 00:00:00 2001 From: Igor <35524806+igorschoester@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:38:42 +0200 Subject: [PATCH 31/31] Remove unused Jenkins config It appears this was a test to build a zip via Jenkins: https://github.com/Yoast/wordpress-seo/pull/17208 However, I'm told this is not how we do things now: clean up time! --- config/jenkins/Jenkinsfile_artifact | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 config/jenkins/Jenkinsfile_artifact diff --git a/config/jenkins/Jenkinsfile_artifact b/config/jenkins/Jenkinsfile_artifact deleted file mode 100644 index e4d13330bc7..00000000000 --- a/config/jenkins/Jenkinsfile_artifact +++ /dev/null @@ -1,25 +0,0 @@ -node( 'docker-agent' ) { - checkout scm - env.GIT_COMMIT = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'") - docker.withServer( 'tcp://172.17.0.1:2375' ) { - def ubuntu = docker.image( 'yoastseo/docker-php-composer-node' ) - ubuntu.pull() - ubuntu.inside() { - stage( 'Set Version'){ - // sed using '#' as separators. overwriting php files with the new plugin name. - sh "SEARCH_STRING=\"[Pp]lugin [Nn]ame.*\" && REPLACE_STRING=\'* Plugin Name: Yoast SEO (beta) | ${env.BRANCH_NAME} | ${env.GIT_COMMIT}\' && sed -i \"s#\$SEARCH_STRING#\$REPLACE_STRING#\" wp-seo.php" - } - stage( 'Build' ){ - sh 'composer install' - sh 'yarn' - sh 'grunt build' - sh 'grunt artifact' - } - stage( 'Expose Artifact' ) { - def BRANCH_NAME = sh(returnStdout: true, script: "echo ${env.BRANCH_NAME} | sed -e s#/#-# | tr --delete '\n'") - sh "mv artifact.zip wordpress-seo-${BRANCH_NAME}.zip" - archiveArtifacts artifacts: "wordpress-seo-${BRANCH_NAME}.zip", fingerprint: true - } - } - } -} \ No newline at end of file