From 25f56a1e22d352baa8cd07a88687f7651b8f815e Mon Sep 17 00:00:00 2001 From: aidamarfuaty Date: Tue, 7 Jan 2025 15:06:16 +0100 Subject: [PATCH 1/2] Also update readability analysis if the list of blocks change, including their client IDs --- .../yoastseo/spec/worker/AnalysisWebWorkerSpec.js | 13 +++++++++++++ packages/yoastseo/src/worker/AnalysisWebWorker.js | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js b/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js index 964d4d83977..e648398747c 100644 --- a/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js +++ b/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js @@ -1792,6 +1792,19 @@ describe( "AnalysisWebWorker", () => { worker._paper = new Paper( "This is the content.", { keyword: "dogs" } ); expect( worker.shouldReadabilityUpdate( paper ) ).toBe( true ); } ); + + test( "returns true when the client IDs of the blocks inside attributes changes", () => { + const paper = new Paper( "This is the content.", { wpBlocks: [ + { name: "block1", clientId: "1234" }, + { name: "block2", clientId: "5678" }, + ] } ); + + worker._paper = new Paper( "This is the content.", { wpBlocks: [ + { name: "block1", clientId: "6783" }, + { name: "block2", clientId: "0636" }, + ] } ); + expect( worker.shouldReadabilityUpdate( paper ) ).toBe( true ); + } ); } ); describe( "shouldSeoUpdate", () => { diff --git a/packages/yoastseo/src/worker/AnalysisWebWorker.js b/packages/yoastseo/src/worker/AnalysisWebWorker.js index 42efb800333..3c33e46680c 100644 --- a/packages/yoastseo/src/worker/AnalysisWebWorker.js +++ b/packages/yoastseo/src/worker/AnalysisWebWorker.js @@ -2,7 +2,7 @@ // External dependencies. import { enableFeatures } from "@yoast/feature-flag"; import { __, setLocaleData, sprintf } from "@wordpress/i18n"; -import { forEach, has, includes, isEmpty, isNull, isObject, isString, isUndefined, merge, pickBy } from "lodash"; +import { forEach, has, includes, isEmpty, isEqual, isNull, isObject, isString, isUndefined, merge, pickBy } from "lodash"; import { getLogger } from "loglevel"; // Internal dependencies. @@ -954,6 +954,12 @@ export default class AnalysisWebWorker { return true; } + // Perform deep comparison between the list of Gutenberg blocks as we want to update the readability analysis + // if the client IDs of the blocks inside `wpBlocks` change. + if ( ! isEqual( this._paper._attributes.wpBlocks, paper._attributes.wpBlocks ) ) { + return true; + } + return this._paper.getLocale() !== paper.getLocale(); } From 14d1986c175a13b59a830d4cb8912ff5cda8ac8e Mon Sep 17 00:00:00 2001 From: YoastBot Date: Wed, 8 Jan 2025 13:27:56 +0000 Subject: [PATCH 2/2] Bump version to 24.3-RC2 --- 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 ec27e693477..012feb7c475 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "webpack-bundle-analyzer": "^4.9.1" }, "yoast": { - "pluginVersion": "24.3-RC1" + "pluginVersion": "24.3-RC2" }, "version": "0.0.0" } diff --git a/wp-seo-main.php b/wp-seo-main.php index 083ca8737ad..b237f2a40a9 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', '24.3-RC1' ); +define( 'WPSEO_VERSION', '24.3-RC2' ); if ( ! defined( 'WPSEO_PATH' ) ) { diff --git a/wp-seo.php b/wp-seo.php index a073a7de0df..37c4e413e9e 100644 --- a/wp-seo.php +++ b/wp-seo.php @@ -8,7 +8,7 @@ * * @wordpress-plugin * Plugin Name: Yoast SEO - * Version: 24.3-RC1 + * Version: 24.3-RC2 * 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