You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened
In the Yoast SEO schema output, there's a wordCount schema graph piece. When you use the apostrophe (') U+0027 in the content (such as a word like doesn't), there's a difference in the output depending on if it's PHP 8.0 (wordCount is considered as 1) or PHP 8.1 (wordCount is considered as 2).
To Reproduce
Step-by-step reproduction instructions
Install and activate Yoast SEO (free) and Classic Editor plugins on a site with PHP 8.0.x
Go to Admin > Yoast SEO > Settings > General > Site Representation
Enter an Organization name and a logo
Click 'Save Changes'
Go to Admin > Posts > Add New
Add a post title (e.g. Test)
Switch to code/text editor
Copy and paste the content from below
Preview the post on the frontend
View the source code and check (wordCount schema output is 8)
Repeat the above steps on a site with PHP 8.1.x (wordCount schema output is 9)
Compare the 'wordcount' in the source code and see the counts are different
Content to be added:
<!-- wp:paragraph -->
<p>Doesn’t is counted</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Doesn't is counted</p>
<!-- /wp:paragraph -->
Please take note that the first paragraph uses (’) RIGHT SINGLE QUOTATION MARK U+2019 (and this doesn't affect the wordCount at all).
Please take note that the second paragraph uses (') APOSTROPHE U+0027 (and this affects the wordCount schema output).
Expected results
That the wordCount would be consistent across PHP 8.0 and PHP 8.1
Actual results
The wordCount schema output differs depending on if you're using PHP 8.0 and PHP 8.1, for the Apostrophe (') U+0027.
I'm not sure what should be the expected behavior if this should be what should be the correct behavior for PHP 8.1. The 'text length' assessment in the Yoast SEO analysis is just 6 words, so it appears to be consistent there and just seems to be isolated to the wordCount schema output.
Screenshots, screen recording, code snippet
If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.
Technical info
If relevant, which editor is affected (or editors):
Block Editor
Gutenberg Editor
Elementor Editor
Classic Editor
Other:
Which browser is affected (or browsers):
Chrome
Firefox
Safari
Other:
Used versions
Device you are using: MacBook M1 Pro
Operating system: MacOS
PHP version: 8.0 & 8.1
WordPress version: 6.3.1
WordPress Theme:
Yoast SEO version: 21.1
Gutenberg plugin version:
Elementor plugin version:
Classic Editor plugin version: 1.6.3
Relevant plugins in case of a bug:
The text was updated successfully, but these errors were encountered:
Please give us a description of what happened
In the Yoast SEO schema output, there's a
wordCount
schema graph piece. When you use the apostrophe (') U+0027 in the content (such as a word like doesn't), there's a difference in the output depending on if it's PHP 8.0 (wordCount is considered as 1) or PHP 8.1 (wordCount is considered as 2).To Reproduce
Step-by-step reproduction instructions
Content to be added:
Please take note that the first paragraph uses (’) RIGHT SINGLE QUOTATION MARK U+2019 (and this doesn't affect the wordCount at all).
Please take note that the second paragraph uses (') APOSTROPHE U+0027 (and this affects the wordCount schema output).
Expected results
Actual results
I'm not sure what should be the expected behavior if this should be what should be the correct behavior for PHP 8.1. The 'text length' assessment in the Yoast SEO analysis is just 6 words, so it appears to be consistent there and just seems to be isolated to the wordCount schema output.
Screenshots, screen recording, code snippet
If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.
Technical info
Used versions
The text was updated successfully, but these errors were encountered: