A staging, development or local copy of your site can use the same Google app as the live site. You don't need a second app. Only connecting an account needs attention, because Google sends you back to an address that the Google client must know.
A copy of the live site
When you copy the whole live site (its files, including the folder wp-content/use-your-drive-cache, and its database), the copy gets the same Google apps and accounts. The accounts that are connected keep working on the copy; you don't need to connect them again. The plugin notices that the address is different and shows this on the app, on the Dashboard tab of Google Drive → Settings under Your Google apps. You only need to act on that notice when you want to connect an account on the copy.
A copy on https with a public domain
For example staging.example.com, or a staging domain of your host. The plugin shows The address of your site has changed … with the redirect URI of the copy. Choose one:
- Add the new redirect URI to your Google client (Google Auth Platform → Clients → your client → Authorized redirect URIs → Add URI) and click I added it. The client keeps the address of the live site as well. For an External app on another main domain (such as a host's staging domain), also add that domain under Branding → Authorized domains.
- Or click Use the sign-in page of WP Cloud Plugins on this site. Then the copy uses
https://www.wpcloudplugins.com/use-your-drive/index.php. Add that address to the client if it isn't there yet, and for an External app addwpcloudplugins.comunder Authorized domains. This is the easiest choice for a host's staging domain: once the client has this address, every copy works without further changes.
A copy on http, an IP address or a local domain
For example http://mysite.local, http://localhost or http://192.168.1.20. Google doesn't accept most of these addresses as a redirect URI for a website, so the plugin connects accounts through the sign-in page of WP Cloud Plugins on that copy by itself, and shows this on the app. To connect an account there:
- Add
https://www.wpcloudplugins.com/use-your-drive/index.phpto the Authorized redirect URIs of your Google client, if it isn't there yet. - External app: add
wpcloudplugins.comunder Branding → Authorized domains. - Connect the account.
The live site keeps using its own address.
Copying the copy back to the live site
The choice of redirect URI is stored per app in the settings. When you push the database of a staging copy to the live site, open Your Google apps on the live site and check the redirect URI of each app. Both addresses work as long as they are in your Google client.
Personal apps
A personal app has no authorized domains, so you only add the redirect URI. Remember that only the Google account that created the app can connect through it, on every copy of the site.
License
Connecting an account checks the license of the plugin, as before. Which copies need an activation: Production, staging and development sites.