dudaster / ele-custom-skin

Create a skin for Elementor Pro Post and Post Archive widgets using Elementor templates
GNU General Public License v3.0
59 stars 10 forks source link

Too many duplicate queries #865

Open Ljuk67 opened 1 year ago

Ljuk67 commented 1 year ago

We are using the PRO version on thewash.online. on the homepage, there are two custom post loops, one shows 12 posts (on the left) and the second 20 posts (sidebar).

On every load, Elementor Custom Skin executes 2-3 alls using WP_Query->get_posts for each posts in this loop, increasing the server load. All the queries are the same:

SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID = 1268900 AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC

only the post ID changes.

The calls are:

ElementorPro\Modules\Posts\Skins\Skin_Posts_ECS->get_template 2 calls ElementorPro\Modules\Posts\Skins\Skin_Posts_ECS->get_settings_for_display 1 call

Is there a way to reduce those? For example check if the >get_template and >get_setting_for_display was loaded and don't execute it again?

thanks Lukas