Conflict with EDD PayPal Pro and PayPal Express payment gateway

4 Replies ·

  1. Hello! My EDD checkout page was not rendering properly using their PayPal Pro and Express gateway with Members Admin Access installed and activated. EDD support noted the following:

    When not logged in the following error appears in the console (causing our issue):

    Uncaught Error: PayPal Checkout Integration Script with same version (4.0.199) already loaded on page
    at Object../src/load.js (load.js:13)
    at webpack_require (bootstrap 0385992054072b262da6:19)
    at ./node_modules/Base64/base64.js (bootstrap 0385992054072b262da6:62)
    at bootstrap 0385992054072b262da6:62

    For some reason the script is being loaded twice.

    It was subsequently determined that deactivating Members Admin Access resolved this problem and that the checkout page now renders normally again. I would like to continue using Members Admin Access with this payment gateway if possible. Please let me know if any further info would be helpful in sorting this out.

    Thank you!

  2. Justin Tadlock

    Nothing in the error you posted points toward the Admin Access plugin or really tells me much. It being a JS issue hints at it possibly being related to Ajax, but the issue you described doesn’t sound like an Ajax issue.

    On line 29 of members-admin-access/app/functions-admin.php, you might try changing this line:

    if ( ! current_user_has_access() )

    To this:

    if ( ! current_user_has_access() && ! wp_doing_ajax() )

    That would rule out an Ajax issue.

    If the EDD add-on is attempting to access anything via the admin (Ajax requests are sent through the admin), it’ll get blocked with this plugin for users who don’t have access.

    Other than the toolbar, that bit of code above is literally the only thing in the plugin that touches anything in the “global” WP space that could possibly mess with other plugins.

    I can’t think of any reason their plugin’s script was being loaded twice (due to any other plugin) unless they were doing something non-standard. Admin Access loads no scripts of its own either.

    I do want to note that, per Theme Hybrid’s terms, I cannot guarantee that plugins won’t conflict with third-party software. But, I’ll try to help the best I can.

  3. Rob Davis

    Thank you, Justin! Changing that line of code fixed the problem. If I understand correctly, then, this implies that the plugin conflict is due to an Ajax issue. Is this adjustment I made something that I should leave in place and/or will it be pushed to future versions of Members Admin Access?

    Best regards,

  4. Rob Davis

    Thank you very much for the quick fix and for your numerous contributions to the WordPress community!

    Best regards,