-
Notifications
You must be signed in to change notification settings - Fork 874
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
Make the filter that disables indexable creation, cover also the creation when a post is created and updated #21335
base: feature/plugin-fixes
Are you sure you want to change the base?
Conversation
9808746
to
51ef489
Compare
51ef489
to
b46a7c0
Compare
Pull Request Test Coverage Report for Build 57158dc9f51a708c44a4fcd2369b403aaecd37eeDetails
💛 - Coveralls |
76154d2
to
611d85a
Compare
…ter-doesnt-disable-indexables
…exable should be created
…ter-doesnt-disable-indexables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR 🚧 Some small comments, and once I noticed that we were using the hierarchy with the var name $indexable, so we should probably make tripple sure this is not done elsewhere.
I'm actually not sure what that means, so let's talk if we need to do anything else, other than the above points :) |
…_indexables-filter-doesnt-disable-indexables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR + ACC 👍
Warning
Not to be merged before consulting with QA
Note
Easiest to review commit-by-commit
Context
Yoast\WP\SEO\should_index_indexables
filter (or being on a non-production environment) disables totally the indexable creation. Without this fix, indexables were still getting created, eg. when posts/terms were updated .Summary
This PR can be summarized in the following changelog entry:
Yoast\WP\SEO\should_index_indexables
filter was used to disable such a behavior)Relevant technical choices:
updated_at
column of the indexable (that had already been updated before coming into the function)$indexable->save()
s intact, in the indexable homepage watcher and the indexable static homepage watcher, because they are only triggered if there's an indexable already there, which then gets updated. The reasoning is that:$indexable->save()
does only updates and not creates.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Note: Wherever
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
is mentioned, it can also mean that you are on a non-production site instead (aka, have theWP_ENVIRONMENT_TYPE
constant indicate a staging or local or development site).For created/updated post (or term) (or user):
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.wp_yoast_indexable
,wp_yoast_indexable_hierarchy
,wp_yoast_primary_term
andwp_yoast_seo_links
tablesFor regression test:
main
/released version.wp_yoast_indexable
,wp_yoast_indexable_hierarchy
,wp_yoast_primary_term
andwp_yoast_seo_links
tables.object_last_modified
/updated_at
columns.Also:
object_last_modified
/updated_at
columns.Also:
object_last_modified
/updated_at
columns.Also:
wp_yoast_primary_term
table.wp_yoast_primary_term
table removed.For hierarchy builder:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.wp_yoast_indexable
table and one in thewp_yoast_indexable_hierarchy
one. Manually delete all entries from the hierarchy table, via the DB tool of your choice.wp_yoast_indexable_hierarchy
table.wp_yoast_indexable_hierarchy
table.For the ancestor watcher:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.slug-parent-new
.wp_yoast_indexable
or thewp_yoast_indexable_hierarchy
table.For regression test:
slug-parent
andslug-child
http://domain.com/slug-parent/slug-child
slug-parent-new
.http://domain.com/slug-parent-new/slug-child
.wp_yoast_indexable_hierarchy
table has entries created both for the parent page and the children page (you can understand which entry is for what page, when you check theindexable_id
column and compare it with theid
column of the indexable table)/%category%/%postname%/
in the fieldcat1
cat1-new
http://domain.com/cat1-new/post-title
For the quick edit watcher:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.wp_yoast_indexable
or thewp_yoast_indexable_hierarchy
table.For regression test:
wp_yoast_indexable_hierarchy
tableindexable_id
that is equal to theid
of the post in the indexable table) and confirm that theancestor_id
is pointing to the right category (again by comparing theancestor_id
to theid
in the indexable table)For homepage:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.Search engine visibility
in Settings->ReadingTagline
in Settings->General.wp_yoast_indexable
table.Your homepage displays
setting in Settings->General to a static page, pick a page, save and then change the page and save againwp_yoast_indexable
tablewp_yoast_indexable
table.For regression test:
main
/released version.wp_yoast_indexable
table.created_at
/updated_at
columns.title
anddescription
are controlled by: Title or meta description of the homepage via the Yoast SEO settings->Homepage->Search appearance.open_graph_title
,open_graph_description
andopen_graph_image
are controlled by: Title, description or image of the Yoast SEO settings->Homepage->Social media appearanceSearch engine visibility
in Settings->Reading, so you can ignore that one.description
is also controlled by theTagline
in Settings->General, but only if there's no meta description in Yoast SEO settingsFor post type archives:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.book
CPT via the test helper.title
column in the indexable)description
column in the indexable)is_robots_noindex
column in the indexable)breadcrumb_title
column in the indexable)wp_yoast_indexable
table./my-books/
) and confirm that you don't get any indexables in thewp_yoast_indexable
table.For regression test:
main
/released version.wp_yoast_indexable
table.created_at
/updated_at
columns).For the link builder:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.wp_yoast_seo_links
table.For regression test:
main
/released version.wp_yoast_seo_links
table.For AIOSEO import:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.For regression test:
main
/released version.created_at
/updated_at
columns).For linking actions:
add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' );
filter active somewhere on your site.For regression test:
wp_yoast_seo_links
table all the links you have added in your posts/terms and that theindexable_id
andtarget_indexable_id
columns are populated properly. (If you're unsure of what you'd expect there, you can do the same test with trunk/production version and compare thewp_yoast_seo_links
table after the SEOO.Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
wpseo_should_save_indexable
filterUI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Innovation
innovation
label.Fixes #20335