• Resolved websupporter

    (@websupporter)


    I can’t really connect.

    I click connect, I fill in my credentials in the popup window. After this, nothing happens.

    Opening the browser console:
    The POST-Request to https://woocommerce.mailchimpapp.com/api/status/api_***** returns {status:"accepted"}

    The POST-Request to https://shop.tld/wp-admin/admin-ajax.php errors with
    Error calling OAuth finish endpoint. Basically the response from the wp_remote_post() which is triggered with this ajax request returns with the response code 405: "Method Not Allowed"

    When I look into mailchimp.com/account/api/ I see the Authorized application.

    But in the wp-admin, when I go to Mailchimp, I still need to Connect, because the plugin was not able to receive the credentials and store them I guess.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ryanhungate

    (@ryanhungate)

    @websupporter thanks for reporting. We’ve seen this come up a few times, and it doesn’t make sense on the surface but it might have something to do with the wp_remote_post altering the METHOD… Can you please try this again now and let us know what happens?

    Plugin Author ryanhungate

    (@ryanhungate)

    @websupporter we’ve also just updated the plugin version to 2.3 just today – if you could please update and let us know if the problem is resolved that would be great.

    Thread Starter websupporter

    (@websupporter)

    Hi @ryanhungate
    thanks for coming back. I tried it.After the update: Now I get a fatal error at the same stage. Reason: wp_remote_post() returns now a WP_Error (“Too many redirects”), while the plugin does not check, if the response is a WP_Error. I tried quickly just to raise the number of allowed redirects to 100, but it still runs into the same problem.

    > but it might have something to do with the wp_remote_post altering the METHOD

    I tested it now locally too, where I do have the same problem:
    Basically this is the response I am getting:

    
    HTTP/1.1 302 Found
    Server: nginx
    Content-Type: text/html; charset=UTF-8
    Transfer-Encoding: chunked
    Connection: close
    Cache-Control: no-cache, private
    Date: Fri, 01 Nov 2019 07:36:56 GMT
    Location: https://woocommerce.mailchimpapp.com/api/finish
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET
    Access-Control-Allow-Headers: Content-Type, Authorization
    
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8" />
            <meta http-equiv="refresh" content="0;url=https://woocommerce.mailchimpapp.com/api/finish" />
    
            <title>Redirecting to https://woocommerce.mailchimpapp.com/api/finish</title>
        </head>
        <body>
            Redirecting to <a href="https://woocommerce.mailchimpapp.com/api/finish">https://woocommerce.mailchimpapp.com/api/finish</a>.
        </body>
    </html>
    

    Using xDebug, as far as I can see it I am doing a post request as I stop here: https://github.com/WordPress/WordPress/blob/3caaa40fc6aa67a655d8bf714717901a8ab8373e/wp-includes/Requests/Transport/cURL.php#L335
    The redirects then of course are GET-Requests.

    I hope this helps you. To me the question seems to be why the server responses with this redirect instead of returning the requested data.

    Plugin Author ryanhungate

    (@ryanhungate)

    @websupporter this is really strange – do you have any idea if you’re doing anything to overwrite anything in the curl requests? For instance there is a http_api_curl action that allows overrides to be made. Since you’re working locally on stuff, I assume you’ve got a code editor that you could do a search for that word and see if another plugin is doing something there?

    Plugin Author ryanhungate

    (@ryanhungate)

    @websupporter we’ll go ahead and close this out – assuming you’ve been able to connect. If you’re still experiencing this issue, please do reach back out we would like to figure out why this is happening for you.

    Thread Starter websupporter

    (@websupporter)

    Hi @ryanhungate,
    sorry I didn’t came back. To be honest, I didn’t figure it out, but as there was some time pressure, we went with another solution.

    Thanks for your good support!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problems connecting’ is closed to new replies.