Skip to content

Conversation

Jordi-PV
Copy link

@Jordi-PV Jordi-PV commented Jun 27, 2024

Summary

This PR documents the errors that the Yoast AI features display.

Relevant technical choices

Technical choices that affect more than this issue:

None.

Test instructions

This PR can be acceptance tested by following these steps:

  1. Open up https://document-ai-error-messages.yoast-developer.pages.dev/features/ai/ai-errors/
  2. Read through and confirm everything is covered / readable.

Quality assurance

  • Security - I have thought about any security implications this code might add.
  • Performance - I have checked that this code doesn't impact performance (greatly).
  • Caching - I have analyzed the caching methods that this code touches and have added instructions to deal with those.
  • Tested - I have tested this code to the best of my abilities.
  • Automated tests - I have added unit tests to verify the code works as intended.
  • Testability - I have added unique ids to elements, so they can be located in automated testing.
  • I have altered a filename.
    • I have adjusted the ID property accordingly and updated all internal links.
    • I have added the redirect to the _redirects file in the root of the project.

@Jordi-PV Jordi-PV marked this pull request as draft June 27, 2024 15:26
Copy link

cloudflare-workers-and-pages bot commented Jun 27, 2024

Deploying yoast-developer with  Cloudflare Pages  Cloudflare Pages

Latest commit: b76c57f
Status: ✅  Deploy successful!
Preview URL: https://108d0bcc.yoast-developer.pages.dev
Branch Preview URL: https://document-ai-error-messages.yoast-developer.pages.dev

View logs

@Jordi-PV Jordi-PV marked this pull request as ready for review June 28, 2024 08:35
@Jordi-PV Jordi-PV marked this pull request as draft July 2, 2024 09:18
Copy link
Contributor

@mhkuu mhkuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see some documentation for this! 🎉 Here are some initial suggestions.

I would love to see more information on other possible errors:

  • site unreachable
  • inactive license
  • generic errors
  • ... basically every error listed in assets/js/src/ai-generator/components/errors

@mhkuu mhkuu marked this pull request as ready for review July 24, 2024 11:56
@marinakoleva marinakoleva requested review from marinakoleva and removed request for marinakoleva August 1, 2024 06:36
@marinakoleva marinakoleva self-assigned this Aug 1, 2024
@marinakoleva
Copy link

  • Swapped all mentions of "alert" or "alert modal" to "error message" (slack thread)
  • We could add slightly bigger images so that the error text is easier to read. I changed the first image as an example.
  • We could also add the text of the error to make it possible to copy it when needed, or to help with reading it. Again, an example was added to the first error.
  • Because the text of some error messages seems a bit unclear/ unhelpful, another task was created to improve them: Update copy and links of error messages
  • Crucially, I wonder whether this page is necessary to exist, given that we already have the page Common AI feature problems and errors on yoast.com. What we could do instead, is revamp the yoast.com page, and add the information and images on this page there.

@marinakoleva
Copy link

marinakoleva commented Mar 3, 2025

  • Whenever there are changes to the developer article in the future, Anne/ the person responsible for the Help centre should be informed so they can update the help article Common AI feature problems and errors.

@marinakoleva
Copy link

@mhkuu The plan is to have any relevant information that is mentioned in the article about Common AI feature problems and errors and is missing from the developer page added to the developer page.
Could you double check if the information in the yoast.com article is correct? Especially the following points:

  • The fact that the error "Something went wrong" (not sure if this refers to the WP request error or the generic error) could be caused by:
    • site language and content language are different
    • Site language is a formal language
    • connection timeout -- is it possible to get this error instead of the Request timeout error?
  • Yoast AI cannot reach your site: the solutions mentioned

@mhkuu
Copy link
Contributor

mhkuu commented Mar 21, 2025

Everything regarding these errors/resolutions the help article is correct, except that the "something went wrong" error is not going to be shown on connection timeout, that line can be removed. You will see the connection timeout error instead.

@marinakoleva marinakoleva removed their assignment Sep 17, 2025
@JorPV JorPV self-requested a review September 17, 2025 09:11
### Rate limit error
The use of Yoast AI comes with rate limits to ensure fair use. Moreover, we are in the process of introducing a subscription-based limit on the amount of AI generations per month. Please refer to [this page](https://yoa.st/ai-generator-rate-limit-help) to understand the rate limits that are applicable.

This error message is displayed when you surpass the Yoast AI rate limit for a specific time frame, or (in the future) your Yoast AI sparks limit.
Copy link

@JorPV JorPV Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to update this documentation once the AI features are tight to the use of sparks? Otherwise, maybe is better to remove the part within the parenthesis (in the future) ?

## Mocking these errors

### In WordPress
If you need to display these errors without actually triggering them (e.g., displaying the rate limit error without actually reaching the rate limit), you can do so by editing the function `get_suggestions` in `src/ai-generator/user-interface/get-suggestions-route.php` in the Yoast SEO repository.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the link to the repository https://github.com/Yoast/wordpress-seo


### In WordPress
If you need to display these errors without actually triggering them (e.g., displaying the rate limit error without actually reaching the rate limit), you can do so by editing the function `get_suggestions` in `src/ai-generator/user-interface/get-suggestions-route.php` in the Yoast SEO repository.
Replace the content of the `throw` block with one of the errors below. Also, replace the variable in the following `catch` block with the name of the error (e.g. `Bad_Request_Exception`), and add the error to the imports (e.g. `use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Bad_Request_Exception;`).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to reproduce this steps 🤔 https://github.com/Yoast/wordpress-seo/blob/trunk/src/ai-generator/user-interface/get-suggestions-route.php

  1. I don't see any throw block.
  2. There are two catch blocks in the get_suggestions function. Because there is no throw block, it is unclear which catch should be edited.

Copy link

@JorPV JorPV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @marinakoleva 👏🏼 I really like the tabs to display the errors information.

I've added some considerations to look at! 🙂

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

Successfully merging this pull request may close these issues.

4 participants