This plugin uses the Google Cloud Vision API to restrict uploading explicit images to the forum. It accounts for all the images uploaded i.e. avatars, logos, etc.
It uses the upload error popup to display a message explaining which violations resulted in the restriction of the image upload.
The acceptable limits can be set via the site settings.
Create a service account on google cloud Creating and managing service accounts | Cloud IAM Documentation
Google will trigger a download of a JSON file. Store its contents safely.
Paste these lines at the bottom of env section in your app.yml
GOOGLE_ACCOUNT_TYPE: 'service_account' GOOGLE_CLIENT_ID: 'client-id-from-json-file' GOOGLE_CLIENT_EMAIL: "service-account-email-address" GOOGLE_PRIVATE_KEY: instructions below
How to setup
- Paste the key in the json file to code editor.
find and replaceand replace
- Copy the result and paste it in app.yml in front of
GOOGLE_PRIVATE_KEYwrapping it in single quotes
- Now follow the regular steps of installing the plugin.
if_adult_max_acceptable: Maximum acceptable level of the category
if_spoof_max_acceptable: Maximum acceptable level of the category
if_medical_max_acceptable: Maximum acceptable level of the category
if_violence_max_acceptable: Maximum acceptable level of the category
if_racy_max_acceptable: Maximum acceptable level of the category
You can read about these criteria and the API itself in detail here. Detect explicit content (SafeSearch) | Cloud Vision API | Google Cloud
For using in a dev environment on macos, add this line to your .bash_profile file
- Not sure how to install a plugin? Follow the steps here.
Thanks @Terrapop for sponsoring the plugin.