项目作者: MirosTruckstop

项目描述 :
WordPress plugin to detect text in images
高级语言: PHP
项目地址: git://github.com/MirosTruckstop/mt-wp-photo-analysis-plugin.git


MT WordPress Photo Analysis Plugin

Build Status

Setup

Requirements

  1. Create a service account with the required role

    1. gcloud iam service-accounts create mt-website --display-name "mt-website"
    2. id="mt-website@${GCP_PROJECT}.iam.gserviceaccount.com"
    3. gcloud iam service-accounts add-iam-policy-binding "${id}" \
    4. --member="serviceAccount:${id}" \
    5. --role="roles/pubsub.publisher"
  2. Create a key for that service account

    1. gcloud iam service-accounts keys create keyfile.json --iam-account="${id}"
  3. Set the content of the keyfile.json as constant GCP_APPLICATION_KEY in the wp-config.php file

    1. define('GCP_APPLICATION_KEY', '{
    2. "type": "service_account",
    3. [...]
    4. }');
  4. Set the JWT used by the cloud function in the wp-config.php file

    1. define('GCP_JWT', 'JWT-HERE');

Development

Requirements

  • PHP and Composer (dependency manager for PHP) are installed

Steps

  1. Install the requirements: composer install

Sync required files

  1. rsync -r --relative *.php src vendor/autoload.php vendor/composer <host>:<wordpress-dir>/wp-content/plugins/mt-wp-photo-analysis/