ConvertKit / convertkit-wpforms

GNU General Public License v2.0
2 stars 0 forks source link

API authentication failed with version 1.7.1 and higher #61

Open billerickson opened 2 months ago

billerickson commented 2 months ago

Over the past few weeks I've had clients report that their email signups are no longer making it to ConvertKit.

It says it is "Connected" in WPForms > Settings > Integrations:

screenshot

But when I enable logging, it shows the API authentication failed:

screenshot

Clients have noted that the forms were working up until around July 16th, which seems to coincide with the 1.7.1 release.

Our solution so far has been to:

At a minimum, can the plugin display an error message in the WP backend telling clients that their ConvertKit connection doesn't work and encourages them to reconnect it.

Preferably, could the plugin fix whatever issue is causing this without requiring publishers to reconnect to ConvertKit and reconnect all their forms?

[edit] Could this have something to do with the new API token expiry?

screenshot

n7studios commented 2 months ago

@billerickson The convertkit_api_refresh_token should be fired when our API class detects the access token expired (tokens have a life of ~ 3 days, I believe), and our tests suggest this works - but it looks like this isn't happening, resulting in the log errors and needing to re-connect.

I'll review and advise when resolved, hopefully by the end of Tuesday. Thanks!

n7studios commented 2 months ago

@billerickson On sites where you're seeing this issue, is the same ConvertKit account connected to multiple, different WordPress sites using this Plugin?

billerickson commented 2 months ago

@n7studios No, on all the sites that have had this issue, it's a single ConvertKit account connected to a single website.

n7studios commented 2 months ago

@billerickson And none of the affected sites have a staging/development copy? Apologies if this seems an obvious question - this may be due to how tokens are assigned to redirect URI's, so trying to figure out where a fix might need to be applied here. Thanks!

billerickson commented 2 months ago

Yes, the affected sites have staging environments. I'm not sure if they are being actively used, but all our clients have staging environments for when we're testing theme changes.

n7studios commented 1 month ago

1.7.4, released today, will only automatically refresh an expired access token on a production site (using wp_get_environment_type). There may still be an issue where the same ConvertKit creator account is used across two or more production sites, which is something we're aware of and looking at. Thanks!