Skip to content

Add notification#22951

Closed
pls78 wants to merge 3 commits intofeature/schema_aggregatorfrom
add-indexables-disabled-notification
Closed

Add notification#22951
pls78 wants to merge 3 commits intofeature/schema_aggregatorfrom
add-indexables-disabled-notification

Conversation

@pls78
Copy link
Copy Markdown
Member

@pls78 pls78 commented Feb 5, 2026

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds an alert warning the user in case they have the indexables disabled.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Add the following code to your site:
    add_filter( 'Yoast\WP\SEO\should_index_indexables', function( $should_index ) {
      return false;
    }, 10, 1 );
    
    This disables the indexables' creation
  • Go to Yoast SEO -> General -> Notifications
    • Verify you get an alert like the one below
      Screenshot 2026-02-06 at 10 51 36
    • Verify the URL points to https://yoa.st/schema-aggregation-alert/
  • Reset both options and notifications by using the Yoast Test Helper
  • Go to Yoast SEO -> General -> Notifications
    • Verify you don't get the alert anymore (this is because the options reset switched off the schema aggregation feature)
  • Change the code to return true:
    add_filter( 'Yoast\WP\SEO\should_index_indexables', function( $should_index ) {
      return true;
    }, 10, 1 );
    
  • Go to Yoast SEO -> Settings
  • Switch back on the schema aggregation feature
    • Verify you don't get the alert
  • Change the code to return false again:
    add_filter( 'Yoast\WP\SEO\should_index_indexables', function( $should_index ) {
      return false;
    }, 10, 1 );
    
    • Verify you now get the alert

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.

Impact check

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

  • N/A

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.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on 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.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

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 https://github.com/Yoast/reserved-tasks/issues/866

@pls78 pls78 added this to the feature/schema-aggregation milestone Feb 5, 2026
@pls78 pls78 added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Feb 5, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 5, 2026

Pull Request Test Coverage Report for Build a8ab95e0635231d1115cc039709205070799aedf

Details

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

Totals Coverage Status
Change from base Build c4bcef41447bfa3247216f308851fa2c70ea9f9d: 0.06%
Covered Lines: 18609
Relevant Lines: 37163

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

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

Couple of changes.

$short_link = $this->short_link_helper->get( 'https://yoa.st/schema-aggregation-alert/' );
$message = \sprintf(
/* translators: %1$s expands to an opening link tag, %2$s expands to a closing link tag. */
\esc_html__( 'You’ve disabled Yoast content indexation of your site, which can cause the %1$sschema aggregation endpoint%2$s to respond more slowly.', 'wordpress-seo' ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we not have Yoast as a var instead of text normally?

Comment thread PLAN.md
@@ -0,0 +1,31 @@
# Plan: Add Constructor Test for Schema_Aggregator_Indexables_Disabled_Alert
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dont think we need this one :)

*/
public function add_notifications() {
if ( ! $this->schema_aggregator_conditional->is_met() ) {
return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think here we need a remove notif since when I disable the feature the notif stays.
Like in
/src/integrations/watchers/search-engines-discouraged-watcher.php

@pls78
Copy link
Copy Markdown
Member Author

pls78 commented Feb 9, 2026

PR Closed as per this decision.

@pls78 pls78 closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants