A+ --> Gcal stopped working after update

Hi there,

Since I've updated A+ to the latest version (yesterday) the integration between Appointment + and Google Calender stopped working.

I didn't changed anything, although I had to upload the private key again.

Can you help? I've granted support access.

  • Adam Czajczyk
    • Support Gorilla

    Hey Frank,

    I hope you're well today and thank you for your question!

    I've took a liberty of accessing your dashboard and checking Appointments+ settings. Everything looks fine there. I've also run a test connection to GC and Appointments+ says it works well. I'm not able though to verify it with your Google Calendar (nor I can't check the connection from GC to your site) as I don't have access to it.

    That said, could you elaborate a bit on this one please? I'd be great if you'd describe what features in particular aren't working and/or what errors are you receiving. Generally, I'd like to know everything that might be considered relevant to the case. Please advise!

    Regards,
    Adam

  • Frank
    • Recruit

    Hi Adam,

    The test connections from to GC are working fine. At the moment, none of the appointments in A+ are automatically exported to Gcal. The strange thing is that the manually export does work. Previously, I've changed the time zone in Google to synchronize it with summer time.

  • Adam Czajczyk
    • Support Gorilla

    Hey Frank,

    I hope you're well today and thank you for your patience here!

    I've checked your settings once again and I've run some tests on my own sandbox install. On clean setup and a new Google API integration - plugin seems to work fine both sites. There are however some changes on Google's side and this might be an issue.

    That being said, could please try to run through the integration steps (as described on the Appointments+ Google Calendar settings page) once again? A few notices regarding the process:

    1. New Google Developer's console looks and works a bit different than described; the important part is a "Credentials" tab
    2. You don't have to enable API again, just follow the part regarding key generation:
    - generate new key
    - download it from Google and upload to the server
    - setup Appointments+ accordingly
    3. You don't have to create a new calendar, it'll be enough to share existing one with a new "person" (an email generated by Google along with the key)

    Try this please and let me know what's the result!

    Cheers,
    Adam

  • Frank
    • Recruit

    Cheered too early!

    Randomly appointments are added to Gcal, some are not. It's quite confusing.

    To rule out any causes related to my hosting, I've tested A+ and Gcal on another WP installation on the same server. This works fine.

    After the new configuration I've tested the connection. Within a minute the test appointment appears in GCal. Besides, when I export appointment manually to GCal they are added!

    It seems that the automatic connection fails (now and then).

    Can somebody have a closer look?

  • Adam Czajczyk
    • Support Gorilla

    Hey Frank,

    I hope you're well today!

    I've conducted some more tests on my test site and although previously everything worked fine for me, now there's also no appointments pushed to the Google Calendar except those made with a "Test Connection". I've also compared my Appointments+ log with yours and I think a little help from the developer will be needed here.

    Having said that, I've notified our 2nd-line support team about this issue and hopefully they'll be able to come up with a solution soon, though I cannot give you any ETA on this at the moment.

    Please keep an eye on this thread for further updates and information!

    Regards,
    Adam

  • Hoang Ngo
    • Code Slayer

    Hi Frank,

    I hope you are well today.

    I've done several tests on my end, but everything seems fine for me. I will need more information for further debug. Can you please send in:

    - Mark to my attention - ATTN: Hoang Ngo
    - Link back to this thread
    - Include admin/network access
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks!!.

    Best regards,
    Hoang

  • Hoang Ngo
    • Code Slayer

    Hi @Frank,

    I hope you are well today and many thanks for your information.

    I has reduce the gCal sync interval to around 5 minutes, can you please try again, does that works for you?

    Also, if it still not work, so does it fine if I use my gCal for testing there?

    Please advise,
    Thanks!!!

    Best regards,
    Hoang

  • Frank
    • Recruit

    Hi Hoang,

    I've tested three appointments, which were successfully synchronized by Gcal.

    I'll keep an eye on the agenda and let you know whether the synchronization will keep working or not.

    Since the agenda (and business) is live, I would rather not use another agenda.

    By the way, did you changed the time settings in Gcal and/or A+? The e-mail notifications contain the wrong time (an hour difference).

    Cheers, Frank

  • Frank
    • Recruit

    Hi @Hoang,

    The first tree appointments were successfully exported, however, afterwards none of the appointments have become visible in GCal.

    I you would like to test with your own GCal, then please do it somewhere between Saturday 3 PM and Monday 9 AM (UTC +1 - Amsterdam, Paris, Berlin, etc.)

    Looking forward to your reply.

  • Hoang Ngo
    • Code Slayer

    Hi @Frank,

    I hope you are well today and I'm sorry for the delay.

    I've just checked the code again, look like currently now, we'll need to export appointments to gCal manually by go to WP Admin->Appointments->Google Calendar and click on the link Export and Update Events to GCal Now
    For automate export, please add this code to your theme functions.php or use mu-plugins

    add_action('update_option_app_last_update', 'export_apps_to_gcal');
    function export_apps_to_gcal()
    {
        global $appointments;
        if (!$appointments->gcal_api) {
            return;
        }
        $export = array();
        if (empty($export)) {
            // Fetching the export appointments, since the cache is empty
            global $wpdb;
            $status = apply_filters('app-gcal-syncable_status', array('paid', 'confirmed'));
            if (is_array($status) && !empty($status)) {
                $clean_stat = "'" . join("','", array_values(array_filter(array_map('trim', $status)))) . "'";
                $export = $wpdb->get_col("SELECT ID FROM {$appointments->app_table} WHERE status IN({$clean_stat})");
            }
        }
        if (!empty($export)) {
            foreach ($export as $app_id) {
                if (is_numeric($app_id)) $appointments->gcal_api->update($app_id);
            }
        }
    }

    Lets see if it works for you :slight_smile:

    Best regards,
    Hoang

  • Frank
    • Recruit

    Hey @Predrag Dubajic and @Hoang,

    I prefer the solution of Hoang. I'd just to implement the code and the synchronisation was working again. Besides, I have only one service, this means I had no services at all.

    So, since I've implemented the code the sync between A+ and Gcal is working again. However, since then some of the appointments have been exported twice or even thrice to Gcal. This happens randomly.

    Can you make sure that appointments are only exported once.

  • Hoang Ngo
    • Code Slayer

    Hi @Frank,

    I hope you are well today.

    This is weird, can you please get the events detail on google calendar, and share here. When export an appointment to Google Calendar, the code will store the gCal ID in database, and when it update, it will check does the event exist or not. So I think this is likely data issue than the code itself.

    Best regards,
    Hoang

  • Frank
    • Recruit

    I see two different Google Developer Accounts. Have you unchecked yours @Hoang Ngo?

    And what do you mean with events detail?

    At 13.00 and 16.30h three appointments isn't possible, since only two service providers are active. For example, at 16.30h both service provider are having an appointment, but is is booked thrice.

  • Hoang Ngo
    • Code Slayer

    Hi @Frank,

    I see two different Google Developer Accounts. Have you unchecked yours @Hoang Ngo?

    I intended to setup an account on your site, but after checked your site, I think it can cause conflict to the current data, so I reconsider and check the code once again, that's why we got the code above :wink:

    Can you please let me know what date when the appointment booked twice, so I can compare with the site data. For the event detail, you can click on the edit appointment, from here, you can see the event details :slight_smile:

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.