Skip to content

PC 735 do not show seo optimization button in first time configuration when amount of unindexed indexables falls below threshold#19050

Open
hdvos wants to merge 6 commits intofeature/SEO-optimization-thresholdfrom
PC-735-do-not-show-seo-optimization-button-in-first-time-configuration-when-amount-of-unindexed-indexables-falls-below-threshold
Open

PC 735 do not show seo optimization button in first time configuration when amount of unindexed indexables falls below threshold#19050
hdvos wants to merge 6 commits intofeature/SEO-optimization-thresholdfrom
PC-735-do-not-show-seo-optimization-button-in-first-time-configuration-when-amount-of-unindexed-indexables-falls-below-threshold

Conversation

@hdvos
Copy link
Copy Markdown
Contributor

@hdvos hdvos commented Oct 12, 2022

Context

  • Hide the "SEO Data Optimization button" when number of unindexed indexables is below the threshold.
  • The threshold is less than 10 indexables or less than 4% of the indexables (whichever is higher).

Summary

This PR can be summarized in the following changelog entry:

  • Hides the "SEO Data Optimization button" when number of unindexed indexables is lower than 10 or 4% of indexables (whichever is higher).

Relevant technical choices:

  • Instead of hiding the button (removing the html) I chose to set the indexingStatus to completed. This has the same effect in the end.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Prep
  • Documentation on how to un-index an indexable can be found here. NOTE: this documentation has been updated recently, so If you tested indexables before, make sure to look at it again.

  • Make sure to install the yoast test helper

  • An easy way to add posts in bulk if you want is the FakerPress plugin

  • Make sure YoastSEO is NOT activated.

Scenario 0: Fresh installation, less than 25 indexables.
  • Have fewer than 25 indexables (this is easiest to achieve in the standalone development docker, see documentation)
  • (Install and) Activate Yoast
  • Go to Yoast SEO -> General -> First Time Configuration
  • Make sure you get a green alert with the following message

We've already successfully analyzed your site. You can move on to the next step.

  • Check the database that all indexables are indexed.
Scenario 0.5: Fresh installation, more than 25 indexables.
  • Make sure all posts are unindexed: Go to: yoast test helper. Click Reset Indexables tables & migrations
  • Have more than 25 indexables (add them with FakerPress)
  • click Reset First time configuration progress in the yoast test helper.
  • Go to Yoast SEO -> General -> First Time Configuration
  • Make sure you get the Start SEO data optimization-button
  • Click it to make sure that everything is indexed for the next steps.

Make sure that YoastSEO free is installed and activated.

Scenario 1: less than 10 unindexed indexables
  • In the yoast test helper, click the Reset First time configuration progress button
  • Un-index less than 10 posts
  • Go to Yoast SEO -> General -> First Time Configuration
  • Make sure you get a green alert with the following feedback

We've successfully analyzed your site!

  • Refresh the database (see screenshot) and check that the unindexed posts are indexed automatically on the background (they appear in the database again).
    Screenshot 2022-11-01 at 12 06 20
Scenario 2: more than 10 unindexed indexables
  • In the yoast test helper, click the Reset First time configuration progress button
  • Un-index more than 10 posts. (also make sure it is more than 4% of all indexables)
  • Go to Yoast SEO -> General and start the First-time SEO configuration by clicking on the link in the banner
  • Make sure you get the Start SEO data optimization button.
  • Click the button to make sure all is indexed for the next step.
Scenario 3: less than 4% of the indexables (but more than 10 indexables) unindexed
  • Make sure your site has at least 500 indexables (you can do so by using Generate Dummy posts, or by generating posts with FakerPress) and make sure that all posts are indexed.

  • In the yoast test helper, click the Reset First time configuration progress button

  • Un-index between 10 and 20 posts.

  • Go to Yoast SEO -> General -> First Time Configuration

  • Make sure you get a green alert with the following feedback

We've already successfully analyzed your site. You can move on to the next step.

Scenario 4: Premium
  • Make sure you have at least 500 posts on your website (use fakerPress)
  • In the yoast test helper, click the Reset First time configuration progress button
  • Make sure all posts are indexed
    • Un-index an above threshold number of posts
    • Go to Yoast SEO -> General -> First Time Configuration
    • Make sure you get the Start SEO data optimization button.
    • Click the button to make sure all is indexed.
  • install and activate Yoast SEO premium
  • Make sure you get the Start SEO data optimization button.
  • Click the button to make sure all is indexed for the next step.
  • Repeat Scenario 1-3 with premium. NOTE: use unindexing method 2 from the documentation.
Scenario 5: Change permalink structure
  • Make sure all posts are indexed
  • Change the permalink structure (Settings -> Permalinks -> select another option -> hit save)
  • Go to Yoast SEO -> General -> First Time Configuration
  • Make sure that the Start SEO data optimization-button appears
Scenario 6: upgrade from previous version.
  • Install and activate a previous version of YoastSEO (e.g. main)
  • Make sure all your posts are indexed.
  • Upgrade to a version with this PR.
  • Go to Yoast SEO -> General -> First Time Configuration
  • Make sure that the Start SEO data optimization-button does not appear.

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 (Block/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.

Quality assurance

  • I have tested this code to the best of my abilities
  • 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.

Fixes #

@hdvos hdvos added UI change PRs that result in a change in the UI changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog labels Oct 12, 2022
@hdvos hdvos changed the title implement fix PC 735 do not show seo optimization button in first time configuration when amount of unindexed indexables falls below threshold Oct 12, 2022
@hdvos hdvos marked this pull request as ready for review October 12, 2022 14:05
@FAMarfuaty
Copy link
Copy Markdown
Contributor

I removed the changelog item for yoastseo package:

  • [yoastseo] Hides the "SEO Data Optimization button" when number of unindexed indexables is lower than 10 or 4% of indexables (whichever is higher).

It's not necessary since there is no changes at all in yoastseo package in this PR.

Copy link
Copy Markdown
Contributor

@FAMarfuaty FAMarfuaty left a comment

Choose a reason for hiding this comment

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

CR: I think the code looks really nice! 🙌

I just have one suggestion, that I thought might be a better approach. It's the same check, just done more centrally. Would you mind taking a look? I can also check if it works as expected :)

Comment thread packages/js/src/first-time-configuration/first-time-configuration-steps.js Outdated
@FAMarfuaty
Copy link
Copy Markdown
Contributor

Tested until Scenario 2: more than 10 unindexed indexables

…show-seo-optimization-button-in-first-time-configuration-when-amount-of-unindexed-indexables-falls-below-threshold
@hdvos
Copy link
Copy Markdown
Contributor Author

hdvos commented Nov 1, 2022

Aida already tested everything. Only scenario 4 needs to be re-tested. I did not change anything since she last tested it except finding a better way to test premium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog UI change PRs that result in a change in the UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants