Hey y’all,
I recently noticed a substantial slow-down on my blog page. I’m fairly new to Wordpress, so do take my findings with a grain of salt, but it does look like using the Loops & Logic plug-in on my front-page - when logged-in to wordpress - causes a massive slow-down. We’re talking over 10 seconds (or 10.24s to be exact) for the page to load. Consistently.
Having recently written my second blog post, I thought the issue correlated with it, but after a bit of investigating, turning the loops and logic plug-in off, reduces the load time to about 215 ms. I’ve turned it on and off 3 times and always matched the slow-down/speed-up with the event.
Surprisingly, this only seems to happen when I’m logged in and I see the WP bar up top. If I just visit the website as a guest, things go fast.
Anything I can do to help confirm or further narrow down, what precisely is causing this?
My template code I use on the page, looks as follows:
<div class="tt-loop">
<!-- By default, child/nested pages aren't looped.
Id 142 is the Projects page, which has all projects as child pages.
-->
<Loop type=Page parent=142 include_children=true orderby=date order=desc>
<div class="tt-item {Field post_class}">
<a href="{Field url}" class="tt-item-wrapper tt-item-link tt-card">
<div class="tt-item-image-panel">
<!-- Below we have some conditional logic that checks whether field=image exists (which is the name of the post's featured image field). If the field contains anything, the featured image gets displayed, if not, a placeholder gets displayed. The placeholder is an asset and can be found in the Assets tab above. -->
<If field=image>
<img src="{Field image_url size=medium}" class="{Field image_post_class}" alt="{Field image_alt}" srcset="{Field image_srcset}" sizes="{Field image_sizes}">
<Else />
<img src="{Get asset=hero_wip field=url}" />
</If>
</div>
<div class="tt-item-content">
<!-- Below is a taxonomy term loop nested within our post loop. WordPress only saves taxonomy term IDs within a post's fields so if we want to display other data from the taxonomy term (like its title or some custom fields), we need to create a taxonomy term loop to grab that data. -->
<Loop type=taxonomy_term post=current taxonomy=category count=1>
<div class="badge"><Field title /></div>
</Loop>
<h2 class="tt-item-title"><Field title /></h2>
<!-- Currently, the div below just displays some plain text on each post. If your posts have a short custom text field on them, try swapping out this text with a tag like <Field my_custom_post_field_name /> to display that custom field. -->
<!-- <div class="tt-item-meta">Some custom field</div> -->
<div class="tt-item-description"><Field excerpt auto=true words=25 />...</div>
</div>
<div class="tt-item-footer">
<button tabindex="-1">Read more</button>
</div>
</a>
</div>
</Loop>
</div>
Thanks in advance,
Gazoo