diff --git a/package.json b/package.json index 47f3a511459..4ca35eb78e7 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "webpack-bundle-analyzer": "^4.9.1" }, "yoast": { - "pluginVersion": "24.3-RC1" + "pluginVersion": "24.3-RC2" }, "version": "0.0.0" } diff --git a/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js b/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js index e47e8f4cbc4..0d558a1615f 100644 --- a/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js +++ b/packages/yoastseo/spec/worker/AnalysisWebWorkerSpec.js @@ -1790,6 +1790,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 f4079915ab5..1cc7f122105 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(); } 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