Skip to content

Fix Semrush request limit warning in related keyphrases#22412

Merged
vraja-pro merged 1 commit intorelease/25.5from
22403-warning-message-youve-reached-your-request-limit-for-today-check-back-tomorrow-or-upgrade-your-plan-over-at-semrush-showing-incorrectly
Jul 9, 2025
Merged

Fix Semrush request limit warning in related keyphrases#22412
vraja-pro merged 1 commit intorelease/25.5from
22403-warning-message-youve-reached-your-request-limit-for-today-check-back-tomorrow-or-upgrade-your-plan-over-at-semrush-showing-incorrectly

Conversation

@igorschoester
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester commented Jul 8, 2025

Context

Fixes a refactor mistake from 9a029fc -- not realizing the actual current default was undefined.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where a request limit warning would be shown in the Semrush related keyphrases when no warning was applicable.
  • [@yoast/related-keyphrase-suggestions 0.0.1 bugfix] Fixes a bug where the UserMessage would always result in a message, while the usages did were not made for that.

Relevant technical choices:

Now changing the default to documented null both in the UserMessage and the getUserMessage that supplies the variant.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Open a post after integrating the Semrush account
  • Be sure you have a focus keyphrase
  • Click on the "Get related keyphrases" within the post
  • Verify there is no request limit warning
  • Verify the Semrush report for the related keyphrase is showing

Now lets test some warnings do show up by changing the php file


Here are the possible warnings/messages:

Sorry, there's no data available for that keyphrase/country combination.

image
Code path/variant: requestEmpty

		$data = [
			'results' => [
				'rows' => [],
			],
			'status'  => 200,
		];
You've reached your request limit for today. Check back tomorrow or upgrade your plan over at Semrush.

image
Code path/variant: requestLimitReached

		$data = [
			'error'  => 'TOTAL LIMIT EXCEEDED',
			'status' => 400,
		];
We've encountered a problem trying to get related keyphrases. Please try again later.

image
Code path/variant: requestFailed

		$data = [
			'error'  => 'Some other error',
			'status' => 400,
		];
You've reached the maximum amount of 4 related keyphrases. You can change or remove related keyphrases in the Yoast SEO metabox or sidebar.

image
Code path/variant: maxRelatedKeyphrases

  • Reset the PHP code back to the way it was
  • Ensure you have Premium activated
  • Add the maximum amount of related keyphrases
  • Opening the modal should show this message

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #22403

Fixes a refactor mistake from 9a029fc
Not realizing the actual current default was `undefined`.
Now changing the default to documented `null` both in the UserMessage and the `getUserMessage` that supplies the variant.
@igorschoester igorschoester added this to the 25.5 milestone Jul 8, 2025
@igorschoester igorschoester added the changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog label Jul 8, 2025
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build ef15706ac59e7aa1bb828123961d9cf1d47082f6

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 53.885%

Totals Coverage Status
Change from base Build 123fd646f31d66b0dbd296a98fa92e2e88fac5c7: 0.001%
Covered Lines: 30487
Relevant Lines: 57543

💛 - Coveralls

@igorschoester igorschoester marked this pull request as ready for review July 8, 2025 13:56
@vraja-pro
Copy link
Copy Markdown
Contributor

CR & AC ✅

@vraja-pro vraja-pro merged commit e1bedeb into release/25.5 Jul 9, 2025
28 checks passed
@vraja-pro vraja-pro deleted the 22403-warning-message-youve-reached-your-request-limit-for-today-check-back-tomorrow-or-upgrade-your-plan-over-at-semrush-showing-incorrectly branch July 9, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warning message "You've reached your request limit for today. Check back tomorrow or upgrade your plan over at Semrush." showing incorrectly

3 participants