Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference in wordCount schema output for Apostrophe (') U+0027 in PHP 8.0 and PHP 8.1 #20643

Open
5 of 11 tasks
michaelbriantina opened this issue Sep 15, 2023 · 1 comment
Open
5 of 11 tasks

Comments

@michaelbriantina
Copy link

michaelbriantina commented Sep 15, 2023

  • I've read and understood the contribution guidelines.
  • 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

  1. Install and activate Yoast SEO (free) and Classic Editor plugins on a site with PHP 8.0.x
  2. Go to Admin > Yoast SEO > Settings > General > Site Representation
  3. Enter an Organization name and a logo
  4. Click 'Save Changes'
  5. Go to Admin > Posts > Add New
  6. Add a post title (e.g. Test)
  7. Switch to code/text editor
  8. Copy and paste the content from below
  9. Preview the post on the frontend
  10. View the source code and check (wordCount schema output is 8)
  11. Repeat the above steps on a site with PHP 8.1.x (wordCount schema output is 9)
  12. 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

  1. That the wordCount would be consistent across PHP 8.0 and PHP 8.1

Actual results

  1. 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.

image

image

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:
@michaelbriantina
Copy link
Author

Please inform the customer of conversation # 1055955 when this conversation has been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant