tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
188 stars 18 forks source link

Set 'no_found_rows' => true for GenerateBlocks get_styles() function #1246

Open tdrayson opened 3 weeks ago

tdrayson commented 3 weeks ago

Description

In generateblocks-pro/includes/styles/class-styles.php function: get_styles() you have a posts_per_page argument which is can be modified to a different limit. However since you are not using pagination, the database query will still try and caculate the total number of pages.

To fix this, we can add 'no_found_rows' => true as an argument to the WP Query for better performance

References:

Performant WordPress Queries