How to Connect a Google Cloud Storage Bucket with WPHOOP Offload Media
Follow these steps to connect your Google Cloud Storage (GCS) bucket with WPHOOP Offload Media for efficient file storage and delivery:
1. Generate Access Credentials #
- Log in to the Google Cloud Console.
- Navigate to the IAM & Admin section and select Service Accounts.
- Click Create Service Account and:
- Provide a name and description for the service account.
- Click Create and Continue.
- Assign permissions to the service account:
- Select the Storage Admin role to allow full access to manage your storage bucket.
- Click Done to finish.
- Under the Keys tab of the created service account, click Add Key → Create New Key and select JSON.
- Download the JSON key file and keep it secure. You’ll need it for the plugin configuration.
2. Create a Google Cloud Storage Bucket #
- Go to the Cloud Storage section in the Google Cloud Console.
- Click Create Bucket and:
- Enter a unique bucket name.
- Select the desired location (region or multi-region).
- Choose a storage class (e.g., Standard, Nearline, or Coldline).
- Configure bucket settings:
- Set access control to either Uniform or Fine-grained.
- Enable additional features like versioning, if needed.
- Click Create to finish.
3. Install and Activate WP Cloud Media #
- Install WP Cloud Media on your WordPress site.
- Activate the plugin and your license.
4. Configure WP Cloud Media for Google Cloud Storage #
Step 4.1: Select Provider #
Go to the plugin settings and select Google Cloud Storage as your provider.
Step 4.2: Choose Connection Type #
Define Key File Path in wp-config.php (Recommended):
Upload the JSON key file to your hosting server, then define its path in your wp-config.php:
php
Copy code
define( ‘WPHOOP_CLOUD_MEDIA_CONFIG’, [
‘provider’ => ‘gcp_storage’,
‘key-file-location’ => ‘/path/to/key-file.json’,
]);
- Store Access Keys in the Database (Not Recommended):
Upload the JSON key file directly in the plugin settings interface.
5. Select Storage Bucket #
After adding credentials, the plugin will fetch a list of your existing GCS buckets. Select the bucket you created earlier from the dropdown menu.
6. Set File Settings and Start Sync #
- Configure Bucket Path, Auto Upload, Deliver From, and Rewrite URL in File Settings.
- Use Sync Options to upload media and static files to the bucket.
Your Google Cloud Storage bucket is now connected, and WP Cloud Media is ready to optimize your file delivery and website performance.