Appointments + conflict

I have appointments+ plugin with email notifications. Those notifications are not coming. I have WP Main SMTP plugin for my emails sending and I have set it up to use Gmail API with oauth (as opposed to SMTP).

When I set it to SMTP with login/password, it works, but if I send it to Gmail oauth, it throws an error:

2018/02/02 22:10:47 [error] 2046#2046: *45404 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined method Google_Client::getClassConfig() in /wp-content/plugins/appointments/includes/external/google/Logger/Abstract.php:126
Stack trace:
#0 wp-content/plugins/appointments/includes/gcal/class-app-gcal-logger.php(6): Google_Logger_Abstract->__construct(Object(Google_Client))
#1 /wp-content/plugins/appointments/includes/gcal/class-app-gcal-api-manager.php(58): Appointments_Google_Calendar_Logger->__construct(Object(Google
_Client))
#2 /wp-content/plugins/appointments/includes/gcal/class-app-gcal-api-manager.php(43): Appointments_Google_Calendar_API_Manager->get_client()
#3 wp-content/plugins/appointments/includes/class-app-gcal.php(71): Appointments_Google_Calendar_API_Manager->__construct()
#4 /wp-content/plugin" while reading response header from upstream, client: 71.92.61.85, server: applianceg****com, request: "POST /wp-admin/adm
in-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "applianceg***.com", referrer: "https://applianceg***.com/schedule-appointment/"

the combination of Appointments+ with Gmail oauth does not work, but I still can send test emails and forgot password emails

  • Luís
    • Support

    Hi Evgeny ,

    Hope you're doing well today!

    As we discussed during the live chat, I flagged the SLS team (our code experts :slight_smile: ) to investigate further and get their valuable feedback.

    However, we are still waiting for the staging site to proceed with this, so, please once you get it done, access to your live chat to share the FTP and Wordpress admin access.

    Or, please send it privately through our contact form:

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:
    Subject: "Attn: Luis Lopes"
    - WordPress admin username
    - WordPress admin password
    - Login url
    - FTP credentials (host/username/password)
    - Link back to this thread for reference
    - Any other relevant urls/information

    Cheers, Luís

  • David @ BBS
    • Site Builder, Child of Zeus

    Hi Luís,

    I have the exact same error happing on a test site that I setup for your devs regarding this ticket:
    https://premium.wpmudev.org/forums/topic/appointment-reminders-sent-twice#post-1297884

    Although my original ticket is associated with reminder emails being sent out twice (or more times as it turns out), I wouldn't be surprised if the Google Client fatal error may be a culprit of that as well.

    I have reported the error in my thread, but no answer yet. The test site is literally stripped down to run only the native 2017 theme, Appointments+, an SMTP plugin and Wordfence (just for security). The great news is, since this test site was setup specifically for WPMUDEV, your devs are welcome to log in and play around to see what they find. Ivan Svyrskyi & Predrag Dubajic already have all the login credentials.

    Let me know if I can help in any way!
    David

  • Panos
    • SLS

    Hi Evgeny ,

    This has to do with two plugins calling same class names. If you are not using gcal option in Appointments plugin you can add the following in the wp-config.php file:

    if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}

    If you are using it, you can add the following snippet in a mu-plugin instead:

    add_action( 'init', function(){
    
    	if( ( ! is_admin() || wp_doing_ajax() ) && isset( $_POST['action'] ) && $_POST['action'] == 'post_confirmation' ){
    		if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}
    	}
    
    }, 10 );

    Hope this helps :slight_smile:

    Cheers!

  • David @ BBS
    • Site Builder, Child of Zeus

    Good to know. Thanks! In a bit of a sad update though, as much as the first code (when not using GCal) works fine, the second one (when using it, the one to be placed in a MU plugin) doesn't. The same error is still generated on sending appointment reminders. Thoughts?

  • Panos
    • SLS

    Hey David!

    Sorry I didn't think of the reminders. Using the define in the wp-config.php should fix that, or you can add in the same mu-plugin the following :

    add_filter( 'app_update_time', function( $time ){
    
    		if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}
    
    	return $time;
    }, 10 );

    Thanks!

  • David @ BBS
    • Site Builder, Child of Zeus

    Hmm. Still no go on my end. Here's how the mu-plugin looks like right now:

    <?php
    /*
    Plugin Name: GCal Appointments Double Class Bug Workaround
    Description: Google Calendar library is called multiple times by multiple plugins. BackupBuddy, Gmail SMTP, and Appointments+ all use it. So we skip loading it in Appointments.
    Author: David Bee
    Version: 1.0
    */
    
    // Basic security, prevents file from being loaded directly.
    defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' );
    
    add_action( 'init', function(){
    
    	if( ( ! is_admin() || wp_doing_ajax() ) && isset( $_POST['action'] ) && $_POST['action'] == 'post_confirmation' ){
    		if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}
    	}
    
    }, 10 );
    
    add_filter( 'app_update_time', function( $time ){
    
    		if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}
    
    	return $time;
    }, 10 );

    Thanks!

  • Panos
    • SLS

    Hi David @ BBS ,

    Sorry for delayed reply!

    Hmm. Still no go on my end.

    I tested once again in my test site and it seems ok to me :disappointed: Is it possible that you have already defined
    APP_GCAL_DISABLE
    in your wp-config.php?

    I would need to do some further debugging on your site to see if it is getting defined or not. Could you please send in admin and ftp info so I could have a look? You can send that privately through our contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:Subject: "Attn: Panos Lyrakis"

    - Admin login:
    Admin username
    Admin password
    Login url

    - FTP credentials
    host
    username
    password
    (and port if required)

    - link back to this thread for reference

    I will do some test booking with a testing email account during my tests.

    Thanks!

  • David @ BBS
    • Site Builder, Child of Zeus

    No, there was no additional APP_GCAL_DISABLE defined anywhere. Since the code in the mu-plugin looks like this:

    add_action( 'init', function(){
    
    	if( ( ! is_admin() || wp_doing_ajax() ) && isset( $_POST['action'] ) && $_POST['action'] == 'post_confirmation' ){
    		if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}
    	}
    
    }, 10 );
    
    add_filter( 'app_update_time', function( $time ){
    
    		if( ! defined( 'APP_GCAL_DISABLE' ) ){
    			define( 'APP_GCAL_DISABLE',true );
    		}
    
    	return $time;
    }, 10 );

    is it possible that the action and the filter are being triggered at the same time on one page?

  • Panos
    • SLS

    Hi David @ BBS ,

    Issue reported here is that the confirmation email is no being sent once an appointment is booked and it happens cause of this specific conflict with WP Main SMTP plugin. If it's something different then you'll need to create a new thread and describe your issue.

    If this is the issue you are having, could you please try adding

    if( ! defined( 'APP_GCAL_DISABLE' ) ){
    	define( 'APP_GCAL_DISABLE',true );
    }

    on your wp-config.php file ?

    I can't think of any reason the mu-plugin is not working for you :disappointed: For further investigation could you send admin and ftp credentials as described in previous reply?

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.