INTEGRATION GUIDE · BETA · SOURCE CHECKED 16 NOV 2026
Migrate WordPress from the Perspective API (before 31 Dec 2026)
Perspective-shaped requests, independent scores. Change the connection, then validate the moderation decisions.
Google’s Perspective API notice gives 31 December 2026 as the shutdown date. Plan and test your migration before then.
1. Prepare a staging copy
Save the integration version, settings, current thresholds and old scores before changing providers. Create a Decision Models key in the dashboard; store it only on your server. Examples use environment variables, never real keys.
PrePublish Comment Moderator 1.5.4 calls Perspective in its analyze method. It requests seven attributes, then converts the maximum returned score to a 0–100 integer. There is no endpoint argument in its provider constructor. Source was verified in the official 1.5.4 release archive; a GitHub mirror could not be verified.
2. Change the endpoint and key
In a maintained copy of includes/class-sacm-ai-perspective.php, replace the URL at line 65:
- 'https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze'
+ 'https://moderation.decisionmodels.io/v1alpha1/comments:analyze'Select the Perspective provider in plugin settings and replace its API key with a Decision Models key. Preserve this patch through plugin updates. The plugin explicitly sends en and el; keep these hints. They are accepted and echoed. X-DM-Language-Untested marks untested languages; Greek (el) is untested. English has measurements for 5 attributes; German only for an offensive-language proxy. Acceptance is not evidence of Greek quality: validate Greek comments against human labels and retain manual review.
Attributes and compatibility
The plugin requests TOXICITY, SEVERE_TOXICITY, IDENTITY_ATTACK, INSULT, PROFANITY and THREAT together with SPAM. SEVERE_TOXICITY and SPAM are experimental, not evaluated and uncalibrated here. Because the plugin takes the maximum, either experimental attribute can dominate the final action. Decide explicitly whether to retain them after validation or remove both from the attributes array and re-tune the resulting five-attribute maximum.
Built-in and experimental attribute names
Built-in: TOXICITY, IDENTITY_ATTACK, INSULT, PROFANITY, THREAT. Built-in does not mean score parity with Perspective.
Experimental, not evaluated and uncalibrated: SEVERE_TOXICITY, SEXUALLY_EXPLICIT, FLIRTATION, SPAM, ATTACK_ON_AUTHOR, ATTACK_ON_COMMENTER, INCOHERENT, INFLAMMATORY, LIKELY_TO_REJECT, OBSCENE, UNSUBSTANTIAL. Responses identify requested experimental attributes in X-DM-Experimental-Attributes. Unknown attributes return 400. Check the current attribute and language documentation before enabling automatic actions.
Re-tune the thresholds
Settings defaults are approve ≤30, hold >30 through 70, spam >70 on the 0–100 scale. Status mapping holds a null score. These are thresholds on a rounded maximum, not on TOXICITY alone. Use /migrate per attribute, then recompute the rounded maximum and test the complete approve/hold/spam policy on labeled examples.
Use the migration tool with representative comments, their saved Perspective scores and optional human labels. Compare flag rates, flagged-set overlap and, where labels exist, precision and recall. Matching a flag rate does not guarantee the same flagged comments or accuracy. Tune each attribute and action separately; do not copy the old numbers into production without review.
3. Test and re-tune
With DM_MODERATION_KEY set privately, this smoke command should return HTTP 200 and a numeric attributeScores.TOXICITY.summaryScore.value between 0 and 1. It checks transport and response shape, not moderation quality.
curl --fail-with-body --max-time 15 \
'https://moderation.decisionmodels.io/v1alpha1/comments:analyze' \
-H "Authorization: Bearer $DM_MODERATION_KEY" \
-H 'Content-Type: application/json' \
--data '{"comment":{"text":"Thank you for explaining."},"requestedAttributes":{"TOXICITY":{}},"doNotStore":true}'On staging, submit an English comment through the actual WordPress comment form and inspect its AI score and approval status. Test the original en/el payload too: expect HTTP 200 and X-DM-Language-Untested for the original en/el hints, not evidence of Greek quality. Simulate a timeout and confirm the comment is held. Use the curl command above to isolate API transport from plugin behavior.
In staging, test benign, abusive, borderline, quoted and multilingual comments; compare actual queue or warning actions with human decisions. Also test invalid keys, untested-language warnings, 429 rate limits and a timeout. Keep a manual moderation fallback rather than interpreting a failed request as a safe score. Check limits and errors and plan quotas and request rates.
4. Roll out with a fallback
Any WordPress Perspective plugin
First locate the HTTP call in your installed plugin. If it exposes a documented base URL setting, replace that setting and its key. Otherwise maintain a narrow fork patch at the exact call site; do not globally redirect all WordPress HTTP requests. Preserve timeouts, error handling and any preprocessing. Each plugin’s attributes and thresholds must be audited independently.
For PrePublish, automatic updates can overwrite both patches. Restore the saved plugin build and matching settings for rollback; hold comments manually if the old API is unavailable.
Keep the saved version and settings so you can reverse this change. Before Google’s shutdown, you can restore the Google endpoint together with its Google key and old thresholds if that service remains available to your account. After shutdown, use a tested alternative or manual review. Never send a Decision Models key to the Google host, or a Google key to Decision Models.
Shared gaps: scores come from an independent model; sentence-level span annotations are unavailable (one whole-text span only). Only PLAIN_TEXT is accepted. Valid explicit language hints are accepted and echoed. Untested hints or detected languages carry X-DM-Language-Untested. Tested languages: English (5 attributes) and German (offensive-language proxy only). This is not evidence of language quality. Suggested-score feedback is acknowledged but not stored or used to train the model. See the full API contract.
Source notes
These instructions follow the linked source revisions, inspected on 16 November 2026. Your installed release may differ. Patches and examples are migration recipes, not upstream endorsements or a claim of an end-to-end verified integration.
attributes, URL and maximum score · en/el language list · threshold defaults · action mapping