You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should document this somewhere easily accessible:
If the site is using Co-Authors Plus and has a large database, you may run into issues with heavier than usual queries. You can work around this by disabling compat mode and force it to use simpler, tax-only queries by adding the following to your theme:
// Use simple tax queries for CAP to improve performance
add_filter( 'coauthors_plus_should_query_post_author', '__return_false' );
Note that this requires the site(s) to have proper terms set up for all users. You can do this with the following wp-cli command:
# This is pretty long-running and can be expensive; be careful!
$ wp --url=example.com co-authors-plus create-terms-for-posts
Co-Authors Plus creates a matching term for each author on the site and when you assign an author to a post, you're associating that authors term with the post. However, by default, the plugin defaults queries to lookup using both the term AND the post_author column. This is to catch any posts that were added before the plugin was enabled and may not the proper author terms associated. The downside to this is that the queries tend to be very expensive. These are typically only in the admin and on author archives, which don't get a lot of traffic. But for sites that do traffic author archives more heavily or run author queries in other places start to see a slowdown in query performance as the sites grows.
The workaround noted in this ticket switches to term-only queries using the filter. The script can go and backfill terms for older posts so that they're included in results.
For large sites, where visibility of older posts on author archives and other author queries is not an issue, it's suggested to enable the filter immediately and then run the backfill script off-hours. If visibility for those posts is important, the script should be run before the filter is added.
The text was updated successfully, but these errors were encountered:
This may hit what appears to be a larger issue, that the readme.txt appears to be bloated. Should this be broken into README.md, CONTRIB.md, CHANGELOG.md, and INSTALL.md. Then this specific issue would be noted in INSTALL.md.
We should document this somewhere easily accessible:
Some background in #111. More details below:
Co-Authors Plus creates a matching term for each author on the site and when you assign an author to a post, you're associating that authors term with the post. However, by default, the plugin defaults queries to lookup using both the term AND the post_author column. This is to catch any posts that were added before the plugin was enabled and may not the proper author terms associated. The downside to this is that the queries tend to be very expensive. These are typically only in the admin and on author archives, which don't get a lot of traffic. But for sites that do traffic author archives more heavily or run author queries in other places start to see a slowdown in query performance as the sites grows.
The workaround noted in this ticket switches to term-only queries using the filter. The script can go and backfill terms for older posts so that they're included in results.
For large sites, where visibility of older posts on author archives and other author queries is not an issue, it's suggested to enable the filter immediately and then run the backfill script off-hours. If visibility for those posts is important, the script should be run before the filter is added.
The text was updated successfully, but these errors were encountered: