Skip to content

Commit

Permalink
Merge branch 'release/23.4' of github.com:Yoast/wordpress-seo into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkuu committed Aug 27, 2024
2 parents 72c84bf + e2e4775 commit 4baef28
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"webpack-bundle-analyzer": "^4.9.1"
},
"yoast": {
"pluginVersion": "23.4-RC2"
"pluginVersion": "23.4-RC3"
},
"version": "0.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,25 @@ describe( "a test for excluded elements", function() {
} );
expect( firstParagraph( paper, researcher ).introduction.childNodes[ 0 ].value ).toEqual( "Some other text." );
} );
it( "should not recognize image captions as the introduction if it occurs at the beginning of the post (block editor: classic block)", function() {
// The keyphrase is 'the highland cow Braunvieh', where it is added to the image caption. The first paragraph after the image doesn't contain the keyphrase.
// Hence, this test should return that the keyphrase was not found in the first paragraph.
const paper = new Paper( "<p>[caption id=\"attachment_1425\" align=\"alignnone\" width=\"300\"]<img class=\"size-medium wp-image-1425\"" +
" src=\"https://basic.wordpress.test\" alt=\"\" width=\"300\" height=\"213\"> Braunvieh: the highland cow[/caption]</p>" +
"\n<p>The <b>Braunvieh</b> (German, \"brown cattle\") or <b>Swiss Brown</b> is a breed or group of breeds of domestic cattle originating in Switzerland" +
" and distributed throughout the Alpine region.</p>",
{ keyword: "the highland cow Braunvieh" } );
const researcher = new EnglishResearcher( paper );
researcher.addResearchData( "morphology", morphologyData );
buildTree( paper, researcher );

expect( firstParagraph( paper, researcher ) ).toMatchObject( {
foundInOneSentence: false,
foundInParagraph: false,
keyphraseOrSynonym: "",
} );
expect( firstParagraph( paper, researcher ).introduction.sentences[ 0 ].text ).toEqual( "The Braunvieh (German, \"brown cattle\") or Swiss Brown is a breed or group of breeds of domestic cattle originating in Switzerland and distributed throughout the Alpine region." );
} );
} );

describe( "checks for the content words from the keyphrase in the first paragraph (English)", function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export default function( paper, researcher ) {
const parentNode = getParentNode( paper, paragraph );
return ! ( paragraph.isImplicit && parentNode && parentNode.name === "figcaption" );
} );
// Filter captions from Classic editor.
// Filter captions from Classic editor and from classic block inside Block editor.
paragraphs = paragraphs.filter( paragraph => {
return ! ( paragraph.isImplicit && paragraph.childNodes && paragraph.childNodes[ 0 ] &&
return ! ( paragraph.childNodes && paragraph.childNodes[ 0 ] &&
createShortcodeTagsRegex( [ "caption" ] ).test( paragraph.childNodes[ 0 ].value ) );
} );
const firstParagraph = paragraphs[ 0 ];
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ Release date: 2024-09-03

#### Bugfixes

* Fixes a bug where an image caption inside a classic block would be considered the introduction when using the _keyphrase in introduction_ assessment in the default editor.
* Fixes a bug where the first tag instead of the primary tag would be shown in a permalink when adding a link in the Classic editor.
* Fixes a bug where the Yoast tab would disappear when opening and closing the Site Settings in Elementor.
* Fixes a bug where the Yoast user settings would be wiped out after a user profile update when the respective global settings were disabled.
Expand Down
2 changes: 1 addition & 1 deletion wp-seo-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '23.4-RC2' );
define( 'WPSEO_VERSION', '23.4-RC3' );


if ( ! defined( 'WPSEO_PATH' ) ) {
Expand Down
4 changes: 2 additions & 2 deletions wp-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @wordpress-plugin
* Plugin Name: Yoast SEO
* Version: 23.4-RC2
* Version: 23.4-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
Expand All @@ -20,7 +20,7 @@
* Requires PHP: 7.2.5
*
* WC requires at least: 7.1
* WC tested up to: 9.1
* WC tested up to: 9.2
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down

0 comments on commit 4baef28

Please sign in to comment.