Closed Ipstenu closed 7 months ago
Hi @Ipstenu
Thanks for using the Yoast SEO plugin and for creating this issue.
When viewing the author page, I can replicate the duplicate calls you mentioned for the Yoast\WP\SEO\Repositories\SEO_Links_Repository->find_one_by_url()
. So, I have escalated this to our development team to take a closer look at this. We will be sure to keep you posted with the updates.
Maybe start in src/helpers/open-graph/image-helper.php
@thijsoo Would that also cover why it's searching for gravatar URLs? That was the part that confounded me. I could understand a double search if the avatar was called for multiple sizes, but the whole calling a remote URL to search locally didn't make any logical sense to me.
Update: I tested with local avatars ( https://wordpress.org/plugins/simple-local-avatars/ ) and I get the same two duplicate queries:
SELECT `target_post_id`
FROM `wp_yoast_seo_links`
WHERE `url` = 'http://example.com/wp-content/uploads/2024/02/cropped-drawing.jpeg?quality=65&strip=all'
LIMIT 1
They're both slow as well.
Please give us a description of what happened
When using YoastSEO there are double queries where it's looking for gravatar images via
find_one_by_url
In some cases, this can cause nearly a second of slowness, depending on the size of databases. For a very large DB with a lot of images, it was half a second for each query which, ultimately, found nothing.
I was able to reproduce this on two different hosting platforms.
To Reproduce
Step-by-step reproduction instructions
Expected results
Actual results
find_one_by_url
Screenshots, screen recording, code snippet
Technical info
Used versions
CoAuthors Plus (latest release)