-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix long WP Media Folder queries #2233
Comments
Issue: proudcity/wp-proudcity#2233 Removes the new function that creates a huge bottleneck on sites.
@kevindherman @lukefretwell ELGL, Proudcity, and all staging sites have been running a build with the updated plugins from #2231 and the fix detailed here since yesterday morning. I monitored the database and it is running fine. |
@curtismchale @lukefretwell looks good to me but PC.com isn't loading the embedded dashboard for me, tried a few times and works on ELGL and test sites I went to. |
@kevindherman these updates and the dashboard are in entirely different sections of the site code so the updates should have no effect on it. I currently see the dashboard on PC.com as |
@curtismchale sounds good. |
@curtismchale are there particulars I should be looking out for on those sites other than homepage load times and clicking around the media library? |
Deployed with: https://github.com/proudcity/wp-proudcity/releases/tag/2023.04.04.1105 Build: |
Source
CM
Related to the rollback of: #2231
WP Media Folder uses a very slow function called
attachment_url_to_postid()
here. This seems to have an adverse interaction with the usage of Open Graph as seen in this JetPack issue. The crazy long queries we saw in ELGL forced the rollback exactly match the issue above.Either turning off OpenGraph functions in WordPress SEO or commenting out the function in question stops the long queries from showing up locally.
Solutions
Remove long function
We could remove
the_content
filter in WP Media Folder linked above. This function does some parse of the URL provided and determines if it's a video or not. If it's a video it wraps the URL in some extra markup for their iframe. Checking our iframe on the Beta site testing page I don't see this markup at all.Removing this function would mean that we don't get the markup on videos.
JetPack did add a fix to their plugin which I've passed on to WP Media Folder to hopefully get a fix for this. I also noted that they don't escape the URLs provided to their iframe with
esc_url()
as they should.Upon further investigation this function is new between 5.5.4 and 5.5.6 so removing it should have no impact on old content, since it doesn't exist on current sites.
remove_filter( 'the_content', 'wpmfFindImages' )
to remove this new functionTurn off OpenGraph in WordPress SEO
Turning off OpenGraph functions in WordPress SEO also removes the long queries. OpenGraph provides social media sites with metadata so that a social post has an image and a description in it automatically. Turning this off would remove those images/descriptions by default from social media posts.
I don't see anything in the recent release notes to say that WordPress SEO changed their Open Graph setup or that WP Media Folder is doing anything different either.
I suggest removing the function from WP Media Folder.
The text was updated successfully, but these errors were encountered: