Appointments+ not syncing both ways with Gcal

I have had many problems with App+ since the update to 1.7 and then 1.8.1. Some have tried to help (via other tickets) but none have followed through and I'm left hanging. Any tutorials or videos are old and outdated.

Appointments+ is creating appointments in Gcal but times reserved in Gcal are showing up as available in the front-end calendar and should not. I have it set to A+ <-> Gcal (Synchronization). How can this be fixed?

  • Ivan Shulev

    Hey Guy ,

    I hope you are having a nice day so far!

    I am sorry for the inconvenience the plugin has been causing and will directly flag our SLS team (coding experts) to tackle this issue.

    I see you have other issues with the plugin and will try to sum them up, so the developers can address them all.

    Again, I am sorry for these issues and hope that they will get resolved as soon as possible.

    I wish you an awesome day ahead!

    Ivan

  • Ivan Shulev

    Hey Guy ,

    The GCal -> A + sync is happening in different intervals of time and it might not appear instantly. If you want to force an update, you can go to WP Admin > Appointments > Settings > Google Calendar => Import and Update and press the Import and Update Events from GCal button:

    Please try changing a time / add an appointment in your GCal, then go to your site and press the aforementioned button and see if any appointments are updated. Please look both in your WP Admin > Appointments > Appointments => Reserved by GCal and the front-end calendar.

    I also see the latest imported appointments from GCal are from the 21st of April. Were there more appointments after that date, which did not get imported?

    I hope this helps and I wish you an awesome day ahead!

    Ivan

  • Guy

    Hi Ivan,

    Yes there were later appointments from gcal not imported after the 21st. I updated on the 21st and that's when things fell apart. On the 21st I went up to version 1.7 and had to do a new integration and then had problems, and then was advised to update to 1.8.1 but still no synchronization, just one way. I've tested and retested and any appointments from gcal do not block off appointment times in appointments+. Please continue to help find a solution.

    Guy

  • Ivan Shulev

    Hey Guy ,

    I took the liberty of syncing your site with GCal, in the aforementioned way, and got 60 updated appointments and 5 new inserted.

    They also appear in your WP Admin > Appointments > Appointments => Reserved by GCal tab.

    Please correct me if I'm wrong, but that seems like appropriate behavior to me.

    There still might be problems with auto sync between GCal and your site, but manual seems to be working.

    Ivan

  • Guy

    Hi Ivan,

    Thank you for trying and letting me know. When I was about to try, it gave me a warning that stopped me from going forward as I anticipated it would cause more problems I don't have the time or patience to fix.

    The auto sync is the most important and crucial element and is considered mandatory. Otherwise I might as well use the admin to put appointments/events into my gcal so as to block off the time. When will this be fixed? This is very important. And there are still other issues that are not yet fixed (please see our other conversations/emails).

    Please keep me posted.

    Thanks,
    Guy

  • Ivan Shulev

    Hey Guy ,

    I understand the importance of the auto-sync and we will do our best to get to the root of this issue.

    NOTE: Before doing any of the following, please backup your site (https://premium.wpmudev.org/project/snapshot/ is a great tool for the job).

    In order to investigate further, I will have to ask you to install and enable the following plugin - https://wordpress.org/plugins/core-control/ This will allow me to have an overview of the GCal sync cron job (a rather tricky part of WordPress) and control it manually.

    I might also need access to PHP error logs, which can be provided by your hosting company. Please share a way to monitor them or paste contents of the file (you only need messages after the 21st of April).

    Thank you and I wish you an awesome day ahead!

    Ivan

  • Guy

    Hi Ivan,

    Thanks for your continued support.

    I'm running a snapshot right now. I've installed core control for you.

    I have access logs but not sure about php error logs. Let me know if you absolutely need them and I'll contact the hosting company.

    I trust you'll figure out what's wrong and it'll start working again and hopefully it helps you/wpmudev to help others in case this happens to them. It all started after the new api / integration.

    Please keep me posted.

    Guy

  • Ivan Shulev

    Hey Guy ,

    There function, responsible for generating the time for the sync was not doing its' job and I believe there was a missing server configuration or maybe it was due to the current PHP version of your site (5.4.38).

    I (and also wordpress - https://wordpress.org/about/requirements/) would recommend you ask your hosting provider to update the PHP version of your site.

    Either way, I altered the aforementioned function and now the GCal sync job seems to be scheduling properly.

    Please make a change to your GCal and see if it is updated on your site. The time for the GCal sync job is every 10 minutes and you can see the exact schedule at WP Admin > Tools > Core Control > Cron Jobs => appointments_gcal_sync and look at the Due Time. It looks like so:

    Thank you for checking if it is working and I wish you an awesome day ahead!

    Ivan

  • Guy

    Hi Ivan,

    I tested it and it's not working. I've waited over an hour and the site still shows the time available.

    Where did you modify the function? From what code to what code?

    I'll check in with my host but doubt they'll change the php version. I believe they roll those out on their own schedule.

    I'd love to have this resolved and working smoothly as I don't want to leave wpmudev. I think what you had, though it took a while to set up and customize, worked fantastically and I hope things get back on track soon.

    Guy

  • Ivan Shulev

    Hey Guy ,

    Where did you modify the function? From what code to what code?

    I've made changes to /wp-content/plugins/appointments/includes/class-app-gcal.php. There is a function called "current_time". I changed it from

    current_time( 'timestamp' ) to current_time( 'timestamp', true )

    There is something odd about the way these timing functions behave on your server and I am not certain why.

    I'll check in with my host but doubt they'll change the php version.

    It should not be such a bother for your hosting company.

    I am afraid I will need to ask you for those PHP error log files. Depending on your hosting company, you might be able to find them through your Control Panel and not need to contact them.

    Thank you and I wish you an awesome day ahead!

    Ivan

  • Guy

    Hi Ivan,

    I've updated to PHP 5.6.
    I cannot get error log files from the past as they were all grouped in with the entire server. But now that I've upgraded to 5.6, I can have them written to a log file in my own directory. The thing is, none have been written as of yet.
    I've tried more tests to add items to gcal and wait to see if they're updated in the front-end but to no avail.
    I really need to get this working. Is there anything else you can do or shall I start searching for another plugin? Thoughts?

    Guy

  • Ivan Shulev

    Hey Guy ,

    I hope you are having a nice day so far!

    I've followed the sync process right to the core and I believe I managed to fix the issue.

    There were problems with scheduling the sync event and then with executing the underlying function. Now that function is firing and I see new appointments from this day.

    However, please make a test to confirm.

    I hope it is working now and I wish you an awesome day ahead!

    Ivan

  • Guy

    Hi Ivan,

    My front end is messed up now. Home page looks ok. Inner pages have a white space between top menu and header/banner area. And nothing shows at all on mobile.

    Please undo whatever you've done to see if that fixes the issues.

    I'm glad you got the core. I did a test and it worked. Thank you very much - I will have questions about it later to help understand what happened and how it can be prevented in the future. I would be a lot happier and appreciative right now if my site wasn't messed up as a result. Please address this asap.

    Thanks,

    Guy

  • Ivan Shulev

    Hey Guy ,

    My sincerest apologies! It was a typo I left out in your themes' functions.php.

    Now the white line is gone and mobile looks good, but please confirm.

    Regarding how to keep the sync issue from happening in the future, I added the following code to your current (divichild) themes' functions.php:

    include_once(WP_PLUGIN_DIR . '/appointments/includes/class-app-gcal.php');
    $gcal = new Appointments_Google_Calendar();
    add_filter( 'appointments_gcal_sync', $gcal->maybe_sync );

    I will move this code to a plugin, so you can freely change your theme in the future and this is not the most accurate way of doing what I wanted to do, but it fixed the issue. I will move the code in one of the following days.

    I am glad the sync is working and again, I am sorry for the typo I made while fixing it.

    I wish you an awesome day ahead!

    Ivan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.