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
{{ message }}
Repository navigation
This script times out on installs with large number of attachments #134
I used this script a few months ago on an install with somewhere around 12k attachments. I updated the theme and needed to resize all of my images. I initially used Regenerate Thumbnails but that timed out my login session and failed after a while. I then used this script which went a little faster but ultimately timed out and failed. I didn't think much of it then and kept running the script to see if I could make it all the way through my images.
Now that I am building a command for another client and using this script as an example, I am starting to think more about the WP_Query that gets all posts. To make this more scalable, should this query be changed to a paged query inside a foreach loop based on the number of total posts for this post type?
Activity
danielbachhuber commentedon Oct 11, 2023
Thanks for the suggestion, @claytoncollie
I think I'd avoid a full refactoring and simply add some memory management while it's iterating through attachments.
oxyc commentedon Feb 14, 2024
I got 500k attachments :) guess ill just write a wrapper then
danielbachhuber commentedon Feb 21, 2024
🔨