Hi there
I completely understand how frustrating this can be, especially when the disconnection isn’t immediately obvious and only surfaces once an order fails.
To assist you further, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:
- System Status Report which you can find via WooCommerce > Status
- Fatal error logs (if any) under WooCommerce > Status > Logs.
Please use https://pastebin.com/ or https://gist.github.com/ and share a link to that paste in reply here. Once we have more information, we’ll be able to assist you further.
In the meantime, Here’s what I’d recommend:
1. Check if any security plugins or server-level firewalls (like from your host) are expiring auth tokens or blocking outgoing requests to Square. Sometimes, token refresh requests can silently fail due to firewall rules or caching.
2. Make sure WP-Cron is running properly. WooCommerce Square relies on scheduled background tasks to refresh the connection. If cron jobs are blocked or inconsistent (common on some hosts), disconnections can occur.
Thank you. Let us know what you find out.
I apologize for the delayed reply. Squared has yet to time out this time as this has always been intermittent. But here is some of the information as requested.
WC Logs: You can view the WC Logs that actually existed before the connected timed out here – https://pastebin.com/Qt05E5B4
Fatal Error: There was a WC Fatal Error that happened before then that you can view here as well – https://pastebin.com/guamgQA6
We do have a security plugin installed where I would say the Firewall settings are at their default. And it’s nothing out of the ordinary. Now, the default WP Cron is disabled so that it does not run on every single user visit, but the cron is set to run on 5 minute intervals.
Again, this issue is extremely intermittent. It will be find for a few weeks, or even months. Then all of a sudden the connection disconnects and want us to re-login into Stripe.
Please advise.
Hi @dcteamdevs,
Thanks so much for sharing the logs. This is very helpful.
After reviewing both the logs and the fatal error you provided, here’s what I’m seeing so far:
- Your Square connection relies on scheduled background tasks to refresh the OAuth token. In your logs, I’m seeing repeated
401 and 403 responses from Square’s API before the disconnection occurs. This typically means the plugin attempted to refresh the token, but Square rejected the request. This can happen when a firewall or security plugin blocks or alters outgoing requests, the token refresh request is delayed or missed due to cron timing, or Square invalidates the token after repeated failed refresh attempts.
- The fatal error is coming from a separate WooCommerce process and does not appear to be the cause of the Square disconnect. It’s good to have it documented, but it doesn’t seem to be directly tied to the Square issue.
Since you’re using WP Defender with default firewall settings, even “default” rules can sometimes block or throttle OAuth refresh calls, especially if the plugin has:
- Rate limiting
- Bot protection
- Outbound request filtering
Please whitelist the following Square endpoints, as these are used during token refresh:
connect.squareup.com
connect.squareupsandbox.com (if applicable)
If your security plugin has logs, check whether any outgoing requests to Square were blocked around the times the connection dropped.
- WP-Cron is disabled and replaced with a 5‑minute server cron, which is generally fine, but intermittent issues can occur if the job doesn’t run consistently, overlaps with long-running tasks, or the server temporarily suspends cron execution during high load. Square token refreshes are time‑sensitive. If the refresh window is missed even once, Square invalidates the token and forces a reconnect. To confirm this, please check:
WooCommerce → Status → Scheduled Actions → Pending / Failed
Filter for actions containing:
square
oauth
refresh
If you see failed or overdue actions, that would explain the intermittent disconnects.
- If possible, temporarily enable WP-Cron for a few days to see if the issue stops occurring. You can run this test on a staging environment just to be safe.
- Let us know if you see any blocked requests in your security plugin logs.
If the issue continues, please also include the System Status Report. This will help us pinpoint whether the issue is coming from the hosting environment, the security layer, or the Square API itself.
I hope that helps. Keep us updated!
Thanks for reaching out and for your patience while we looked into this! I really appreciate you taking the time to report this—it genuinely helps us improve.
We’ve not heard from you in a while, so I am going to mark this as resolved to keep things tidy.
Don’t hesitate to reach out if you still need help with this.