Event pages load very slowly when the Pro calendar plugin is activated
So the fact that you’re getting an error about the page not existing when it’s just our plugins and Twenty-Seventeen is a huge red flag. Everything should be operational when you do this for sure. Could you go back to that state and reset your permalinks and tell me if everything works after that please? 🙂
Let me know if you need any help with that!
So I updated the plugins to the newest versions again and set my theme back to 2017 and the event pages load now. I hadn’t reset my permalinks yet so I’m not sure what caused that issue but as of right now I’m using just the event calendar plugins and the 2017 theme and the individual event still takes a long time to load.
Hey again Nathan,
Thanks for the updates here. 🙂
Can you please let me know who you host with and the specifics of your hosting package? I think this may be host-related because the Twenty-Seventeen theme with up to date plugins should run relatively quickly.
Also, how many events do you currently have on your site?
I was able to make a complete backup of the clients site and update the plugins, everything is now visible but we’re stuck with the first issue still, the event pages themselves loading super slow. I’m going to see about getting that backup to you so you can try figuring out that part of things. I made them with Updraft, is that a plugin you are fine with using to restore them or should I try and produce a different kind of backup for you guys.
Thanks for following up with this.
It’s good to know the calendar is visible again. Thanks for letting me know.
I’m really sorry you are still experiencing the slowdown in performance. That might be frustrating.
I will only need you to send us a copy of your database and your active theme. But, if you want to send us a backup of your site using Updraft then feel free to do so and I’ll try to get it working in my local environment to run some tests. Just remember to send it in a private reply.
Thanks for following up with this.
I could reproduce the 504 error in your site for an event. I can’t see any error in the debug.log file that would indicate the source of the problem.
It might be that it is exceeding the max_execution_time of 30 seconds that is set for your site. But I’m not really sure as I don’t have any errors logged in the debug.log file. Did you enable WP_DEBUG_LOG in your site?
I’d recommend you get in touch with your hosting provider about this error to see if they can help determine why it’s happening. They can probably send you some logs about it.
With the number of posts/events for your site, it might be that your hosting environment does not have the necessary resources to run your site.
Also tried setting the events to clear out after three months and to only generate for three months into the future but I noticed that won’t affect current events so I don’t think that’s going to help now either.
You can apply these changes by editing the existing events and saving them. This will re-generate the recurring instances to accomodate for 3 months into the future.
Let me know how it goes.
I’m sorry it took us so long to follow up on this one.
There’s certainly some work for us to do here to speed up performance and I’m going to attach this forum topic to the relevant bug ticket so we can provide a further update later on, once we’ve found a way to address this substantively.
I did want to share a couple of ideas, though, that might provide some sort of short-term relief (though it may be you’ve got some workarounds of your own in place at this point).
The first is setting up a custom template override for the single-event.php template. This is basically a copy of the default template for single events that you can safely modify by adding it to the following location within your theme:
Here is the code I recommend you place in there – as noted in the comments, the key change is that it only triggers the queries used to find the previous and next events once.
Beyond that, the database dump you shared did contain a number of historic events and while – for recurring events – those should be periodically cleaned up automatically, according to the rules defined in your event settings page, it may be worth triggering a manual cleanup with a SQL query like this one, if you’re happy working at this level:
DELETE wp_posts, wp_postmeta FROM wp_posts JOIN wp_postmeta ON post_id = ID WHERE post_parent > 0 AND post_type = 'tribe_events' AND meta_key = '_EventStartDate' AND meta_value < CURDATE()
Please do take a database backup before running that, though, and consider testing it on a staging site first. I found it was able to shave off a few hundred events, though. That and the efficiency saving the template override provide may help you through the worst of these issues until we can get a substantive solution together within The Events Calendar itself.
Thanks again and let me know if you have any questions on this.
Just wanted to share with you that a new maintenance release (for the Week of 5 March 2018) is out, where we shipped a fix to prevent the tribe_get_prev_event_link() and tribe_get_next_event_link() queries from running more times than necessary on single-event views, which improves performance.
Please update the plugins and let us know if you encounter any problems.