Server timeouts with Appointments+

I'm having very slow performance with the plugin, and this was one reason I thought it might be happening. I'm getting this slow error:
slow_errors_common: /www/wp-content/plugins/appointments/includes/class-app-gcal.php:34 __construct() /www/wp-content/plugins/appointments/appointments.php:219 get_gcal_api()

The plugin works as long as I'm looking at the current month, for certain time periods, but as soon as I select longer time periods and advance to the next month, it times out. I'll give you an example:

If you go to "Reserve a Studio", you will get 3 calendars for the 3 studios. If you select a time of "3 hours" from the dropdown, it will take a while to refresh the calendars, but it might work. If you then click "Next Month" you will get a timeout.

My host ran that test and then emailed me the slow error which referred to the appointments plugin and gcal.

  • Dimitris

    Hey there Dennis,

    after our initial conversation in live chat, could you please access your server via FTP, edit the wp-config.php file, find a line like
    define('WP_DEBUG', false);and replace it with the following (if the above line doesn’t exist, simply insert next snippet just above the /* That's all, stop editing! Happy blogging. */ comment)

    // Enable WP_DEBUG mode
    define('WP_DEBUG', true);
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    // Disable display of errors and warnings
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors', 0);

    Then go ahead and try to replicate the timeout error once more.
    By doing so, a /wp-content/debug.log file should be created. Simply download it, rename it to debug.txt and attach it here in your next reply. If size of text file exceeds the 5MB limit of our blog, please use a service like Dropbox and post the shareable link instead.
    Ref: https://premium.wpmudev.org/blog/debugging-wordpress-how-to-use-wp_debug/

    I could also have some more server credentials for our Second Level Support team.
    As this is public forum, you should send us your details through our safe contact form https://premium.wpmudev.org/contact/#i-have-a-different-question using this template:

    Subject: "Attn: Dimitris"
    - WordPress admin (login url/username/password)
    - FTP credentials (host/username/password)
    - cPanel/Plesk credentials for database access (host/username/password)
    - link back to this thread for reference
    - any other relevant urls

    Keep in mind the subject line as ensures that it gets assigned to me.

    Warm regards,
    Dimitris

  • Dennis

    That is a very disappointing response, for a few reasons:

    1. We've been using this plugin for about 2 years, without any problem, with the page designed as it is. It only became unstable recently due to updates to Wordpress and the plugin. If the issue was too many calculations and shortcodes, why did it work so well for 2 years and suddenly stop working?

    2. When I look at the error logs (with my untrained eyes) I see a lot of gcal api slow errors, despite the fact that I have google calendar integration turned off. This doesn't seem right to me.

    3. My page shows a monthly calendar for 3 service providers, but only shows appointments/availability for 1 day at a time. The busiest day of bookings I have might have 1 or 2 bookings per service provider, for a total of 3 to 6 bookings on the day. I'm disappointed if the plugin can't easily calculate and display availability around 6 bookings.

    4. I've been working on this problem for a month and have made many support requests on this issue. If the issue was that my page was designed wrong, I wish I had been told that a month ago and would have fixed it by now. I've had several support people look into the problem and no one has suggested that my page design was too demanding until now.

    If that's the best answer I can get, then I will redesign the page to show only one service provider at a time, but that is not an effective solution for me, so I will have to find another plugin that can display the calendar for 3 or 4 service providers at a time.

    I would hope someone will see this and figure out if there's more going on than just my page has too many calculations.

  • Dennis

    I tried to make a page with fewer shortcodes, so now I have a page that only shows one service provider, for one month at a time. When I switch between two service providers, so, to show the same month for a different service provider, or when I want to change the month, so viewing the same service provider for a different month, the response time to refresh the page is 40 seconds or more, or it times out completely. This occurs during months when there are very few actual reservations.

    I don't think I can make a page much simpler than this, but if there is something I am doing wrong, please tell me so I can try something different. Otherwise, the performance of the plugin is too slow and I don't know how to use it in a way that requires fewer calculations.

  • Ivan

    Hi Dennis !

    1. Could you tell what version of the plugin when this page worked fine? I'll look changes for that version.

    2. You can add the following code to your (wordpress_folder)/wp-config.php file which exclude working of gcal api.

    define( 'APP_GCAL_DISABLE', true );
    before this line

    /* That's all, stop editing! Happy blogging. */

    I tested it on your site - it seems, it doesn't help.

    3. The plugin calculates free slots based working hours, break hours, booking in all available services for the service provider etc.

    Could you write a slug or name of your new page with one service provider?

    Best regards,
    Ivan.

  • Dennis

    1. I'm not sure what version it was when it worked. We started using it a couple of years ago. For a long time, we didn't update anything. We started updating stuff about 6 weeks ago when there was a major update to Wordpress so some plugins stopped working.

    2. If you tested that and it didn't make a difference, I won't try it. I don't want to make things worse.

    The new page that I created (actually I created it when it first stopped working a month ago) is called "Reserve a Studio - March 23, 2017". It's not published, but you'll find it as a draft page. See if there's a way to simplify the calculations there to make it work faster.

  • Dennis

    Without the duration add-on, the plugin can't properly display available time slots. For example, if I want to book a 2 hour appointment, the duration add-on allows my users to start that 2 hour appointment at any available time. Without the duration add-on, the 2 hour appointment can only be started at 12:00, 2:00, 4:00, etc., which isn't useful. The usefulness of the plugin depends on the Duration add-on (which is why I purchased the premium license). If you go to the site now, you will see that I published a simpler page that only shows one service provider at a time, for one day (in one month) at a time. Load time is still 30+ seconds. The site is working, but performance is pretty poor and if I can't improve it without eliminating basic functionality, I'll have to find something else or a very different way of booking appointments.