[Hustle] Hustle dashboard loading every post into memory

I haven't traced through all the code yet to know the reason, but Hustle does a WP_Query to load EVERY post for every post type when you load the dashboard which is a huge memory issue on large sites with tens of thousands of posts. This happens on line 200 of hustle-module-admin.php. Can this somehow be disabled? Is Hustle unusable on large content sites? The only solution to even load the dashboard is to bump up the PHP execution memory required to 1GB and the max execution time to over 120 seconds in production which is not viable.

If there is no workaround, I'll have to patch the plugin or figure something else out to prevent it from loading the entire wp_posts table into memory.

This should impact any WP site with a ton of posts, but my environment is WP 4.9.8 on a LAMP stack with ~50k posts. Yoast SEO and a few basic post meta fields (done in code, not ACF or another plugin) being the only large customizations loaded.

  • CIG

    Ok so looks like it's doing all that just to build a giant array of key-value pairs ID and text for a select2 element to control display options for specific posts. It's also outputting that large array into a localized javascript object to use on the client side. That's a very brute force method of getting that data.

    This should ideally should happen an AJAX call to the post table when searching for post titles, but even just using a straight query for those 2 fields on a properly indexed table would be magnitudes faster than creating a bloated query object and full posts to iterate through just for the title. And then on top of that, dumping it all into a localized JS array....

    Any plans in the works to adjust how this is done?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.