Help Desk

Event pages load very slowly when the Pro calendar plugin is activated

  • Posts: 13 Topics: 1
    | Permalink

    I have a client that is having me investigate a slow site issue and my investigation has pointed to the events calendar pro plugin. It’s the only plugin who’s deactivation lets the events pages load in a reasonable amount of time.

    I’m unable to update the events calendar plugins on their main site because it’s live and the last time they did that they lost a ton of events and had to recreate them. So I was going to try to update it on a staging site we have setup for them but I don’t have an extra pro license to install in order to let me update the plugin to the latest version, I could potentially deactivate it on the live site and switch it to the staging site but that may not work for the client if there are any reasons to fear potential data loss due to said license moving temporarily to the different domain.

    I’ve already ran Query Monitor to check how long the queries are as I saw it was suggested in another post. When the pro calendar plugin is activated there are four select statements that exactly match word for word the select statement on the test where the pro plugin was activated. Even though the select statements match exactly, the test with the plugin deactivated takes 0.2061 seconds to load the first query and 17.1148 to load it on the test I ran where the events calendar pro plugin was activated. I will reply with a private response with the actual select statement itself. The same occurs for the three other get_posts queries.

    Two things. First, what can I do to get this resolved? Do I need to not use the pro addon until you get the performance updates released? Is there any cleaning of the database that will help?

    Secondly, if I was to deactivate the pro plugin would that cause any data loss? Similarly if I was to move the license over to the staging domain temporarily so I can see if the existing updates resolve this do I have any reason to think there would be data loss in that situation as well?

    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 1128
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 1128
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 1128
    | Permalink

    Hi again,

    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!

    Best,

    Shelby 🙂

    Posts: 13 Topics: 1
    | Permalink

    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.

    Posts: 1128
    | Permalink

    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?

    Thanks!

    Shelby 🙂

    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 1128
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink

    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.

    Posts: 6230 Topics: 17
    | Permalink

    Hi Nathan!

    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.

    Best,
    Victor

    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink

    Hi Nathan!

    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.

    Best,
    Victor

    Posts: 13 Topics: 1
    | Permalink
    This reply has been marked as private.
    Posts: 6230 Topics: 17
    | Permalink
    This reply has been marked as private.
    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Hi Jeremy/Nathan,

    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:

    wp-content/themes/YOUR_THEME/tribe-events/single-event.php

    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.

    Posts: 6230 Topics: 17
    | Permalink

    Hi There!

    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.

    Find out more about this release → https://theeventscalendar.com/maintenance-release-week-5-march-2018/

    Please update the plugins and let us know if you encounter any problems.

    Best,
    Victor

The topic ‘Event pages load very slowly when the Pro calendar plugin is activated’ is closed to new replies.