WordPress plugin to detect text in images
Requirements
Create a service account with the required role
gcloud iam service-accounts create mt-website --display-name "mt-website"
id="mt-website@${GCP_PROJECT}.iam.gserviceaccount.com"
gcloud iam service-accounts add-iam-policy-binding "${id}" \
--member="serviceAccount:${id}" \
--role="roles/pubsub.publisher"
Create a key for that service account
gcloud iam service-accounts keys create keyfile.json --iam-account="${id}"
Set the content of the keyfile.json
as constant GCP_APPLICATION_KEY
in the wp-config.php
file
define('GCP_APPLICATION_KEY', '{
"type": "service_account",
[...]
}');
Set the JWT used by the cloud function in the wp-config.php
file
define('GCP_JWT', 'JWT-HERE');
Requirements
Steps
composer install
rsync -r --relative *.php src vendor/autoload.php vendor/composer <host>:<wordpress-dir>/wp-content/plugins/mt-wp-photo-analysis/