If the plugin keeps losing the connection with your cloud accounts, it can no longer use the authorization (token) that was stored when you connected the account. That happens for one of the reasons below. Go through them in this order: the first two are the most common.
- The encryption key was lost or changed
- The authorization file was removed
- License validation issue
- The cloud service no longer accepts the token
Still losing the connection after that? See what to send us.
Cause 1: The encryption key was lost or changed
The plugin encrypts your cloud account tokens with a unique encryption key stored in your WordPress database. If this key is lost or altered — for example by a backup, cleanup, migration or optimization tool that modifies or restores the WordPress options table — the plugin can no longer decrypt the saved tokens, and the cloud connections break.
Solution: define a fixed encryption key in your wp-config.php file, so it no longer depends on the database. Add the line for your plugin somewhere above the line /* That's all, stop editing! Happy publishing. */:
// IMPORTANT: Don't use this exact key, create your own random key of 32 letters and numbers!
// Use-your-Drive (Google Drive)
define('USEYOURDRIVE_AUTH_KEY', 'WLd3q9FJW5J4hrQr7sVHVao7ohx435iH');
// Share-one-Drive (OneDrive & SharePoint)
define('SHAREONEDRIVE_AUTH_KEY', 'WLd3q9FJW5J4hrQr7sVHVao7ohx435iH');
// Out-of-the-Box (Dropbox)
define('OUTOFTHEBOX_AUTH_KEY', 'WLd3q9FJW5J4hrQr7sVHVao7ohx435iH');
// Lets-Box (Box)
define('LETSBOX_AUTH_KEY', 'WLd3q9FJW5J4hrQr7sVHVao7ohx435iH');Only add the line for the plugin(s) you use. After you set the key, reconnect your cloud accounts one last time. From then on, the plugin can no longer lose access because of encryption key problems. Keep the line when you move the site to another server.
Cause 2: The authorization file was removed
The encrypted token is stored as a .access_token file in the plugin's cache folder, for example wp-content/use-your-drive-cache/ (see Settings per plugin). Because that is not a standard WordPress folder, some caching, optimization or security plugins, hosting cleanup tasks, or a backup restore that only restores part of wp-content treat it as disposable and empty it. Without the file, the account is disconnected.
Solution: first check whether one of your tools empties or restores wp-content folders, and exclude the plugin's cache folder there. If you can't find the cause, move the cache folder into the uploads folder, which these tools leave alone. Add these two lines to wp-config.php, for example for Use-your-Drive:
define('USEYOURDRIVE_CACHEDIR', __DIR__.'/wp-content/uploads/use-your-drive-cache/');
define('USEYOURDRIVE_CACHEURL', 'https://www.example.com/wp-content/uploads/use-your-drive-cache/');- Replace
https://www.example.comwith the address of your site. For another plugin, use its prefix and folder name from Settings per plugin. - Keep the slash at the end of both lines.
- The plugin creates the new folder itself; the
uploadsfolder must already exist. - Reconnect your cloud accounts after changing the location.
- On a WordPress Multisite network, please contact us first.
Cause 3: License validation issue
The plugin may lose access if there's a problem verifying your license. Open the plugin's license screen in your WordPress dashboard, deactivate the license, then activate it again. If the issue persists after that, see I get an 'Invalid client' error when authorizing the plugin or contact our support team.
Cause 4: The cloud service no longer accepts the token
The cloud service itself can make a token invalid. The plugin then has to be connected again; there is nothing it can do to prevent this. Common reasons:
- Access was revoked by the account owner (for example in the security settings of the Google, Microsoft, Dropbox or Box account) or by an administrator of the organization.
- The account password was changed, or an administrator signed the account out of all sessions.
- The token was not used for a long time. Make sure the site uses the account now and then, for example through the plugin's cache updates (WP-Cron).
- Too many tokens were issued. Services limit the number of active tokens per account and app. Connecting the same account many times (for example on several sites or staging copies) makes the oldest tokens stop working.
- Google Drive with your own OAuth app: if the app's publishing status in the Google Cloud Console is still Testing, Google lets the tokens expire after seven days. Set the publishing status to In production and reconnect the account.
- Google Workspace: an administrator can require users to sign in again after a set time (Google Cloud session control). The connection then stops at that interval.
Still losing the connection?
Please send us the answers to these questions in a support ticket:
- Does the connection get lost at roughly the same time, or after a fixed interval?
- Do you use a backup, migration, database optimization, security or cleanup tool that restores or changes the database or files in
wp-content? - Is the connection also lost while the site is being used, or mainly after a period without visitors?
Also enable the WordPress debug log, so we can see what happens. Add these lines to wp-config.php above the line /* That's all, stop editing! Happy publishing. */ (or change them if they already exist):
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);When the connection is lost again, open wp-content/debug.log and look for messages of the plugin around that moment, for example New encryption key set, Cannot read the encryption key or errors of the cloud service such as invalid_grant. Send us those lines, after removing anything you don't want to share. When you're done, set WP_DEBUG back to false.
Settings per plugin
Each plugin uses its own prefix for the wp-config.php settings on this page, and its own cache folder:
| Plugin | Cloud service | Prefix | Default cache folder |
|---|---|---|---|
| Use-your-Drive | Google Drive | USEYOURDRIVE |
wp-content/use-your-drive-cache/ |
| Share-one-Drive | OneDrive & SharePoint | SHAREONEDRIVE |
wp-content/share-one-drive-cache/ |
| Out-of-the-Box | Dropbox | OUTOFTHEBOX |
wp-content/out-of-the-box-cache/ |
| Lets-Box | Box | LETSBOX |
wp-content/lets-box-cache/ |