Google Cloud Storage plugin
Google Cloud Storage plugin allows you to upload media files to a Google Cloud Storage bucket.
Google Cloud Storage plugin allows you to upload media files to a Google Cloud Storage bucket.
- 01Download the plugin and place it in your /wp-content/plugins/ directory.
- 02Enable this plugin in the WordPress admin UI,
- 03Configure your Google Cloud Storage bucket in the plugin setting UI.
- 04In Google Cloud Console, set the default acl of the bucket so that allUsers can read.
Depending on your environment, you may need to configure a Google Service Account to call the APIs.
To run this plugin on Google App Engine for PHP 7.2 , it will work without additional configuration.
To run this plugin on Google Compute Engine or App Engine Flexible , you will need to do the following:
- 05Visit Cloud Console, go to Compute -> instances and select the instance where WordPress is running.
- 06Stop the instance.
- 07Once the instance has stopped, click Edit and you can now modify the scopes under Cloud API access scopes . Change the Storage scope from Read Only to Full .
If you want to run this plugin outside of Google Cloud Platform, you need to configure your service account as follows:
- 08Visit Cloud Console, go to IAM & Admin -> Service accounts and create a service account with Storage Object Admin permission and download the json key file.
- 09Upload the json key file to the hosting server. Don’t put it in a public serving area.
- 10Add the following line to wp-config.php (replace the file path with the real one). putenv('GOOGLE_APPLICATION_CREDENTIALS=/secure-place/my-service-account.json');