WordPress Plugin
Custom Error Messages & Toasts
Override every user-visible error and success message the SDK produces. Ships with three curated copy presets.
The Unidy SDK produces user-visible strings for every error and success event โ sign-in failure, newsletter subscription, profile save, and so on. The plugin ships a Messages system that catches those strings and swaps them for your own copy. Configure under Unidy โ Auth โ Fehlermeldungen & Bestรคtigungen.
1. Presets
A preset is a curated copy set for the roughly 30 messages the SDK can produce. Three ship out of the box:
- Casual DE (default) โ Du-Ansprache, terse, friendly.
- Formal DE โ Sie-Ansprache, full sentences, admin-portal tone.
- English โ US-English mirror of Casual.
- Custom โ your own overrides only; no preset applied.
Click a preset card to activate it. Descriptions on each card summarize the tone.
2. Per-code overrides
Below the preset picker, every registered code is listed with its level (error / success / info / warning) and an editable input. The placeholder shows what the active preset would display if you leave the field empty.
Type your own copy to override a single message without switching the whole preset. Overrides win against presets; the resolved order is:
- Admin override (typed by you)
- Active preset
- Plugin-registered default
- Raw code (only as a fallback)
Codes are grouped by module (Auth, Newsletter, Profile, Tickets) so you can spot which module owns which message.
3. Message levels
Each code has a level that drives its visual style (color, icon):
- Error โ red tint. Something failed, visitor action required.
- Success โ green tint. An action completed successfully.
- Info โ blue tint. Neutral confirmation (e.g. "code sent to your email").
- Warning โ orange tint. Something worked but with caveats.
You cannot change a code's level from the admin โ it's a plugin-side decision that reflects the message's meaning.
4. Message aliases
Some SDK flows emit pre-translated prose instead of machine codes. For example, the SDK might send "Sie haben sich erfolgreich abonniert" directly, not the code newsletter_subscribed. The plugin registers aliases โ text-to-code mappings โ for the most common SDK strings so your overrides catch both variants.
Additional aliases can be registered from a companion mu-plugin via the unidy_sdk_message_aliases filter.
5. Reset
At the top of the override list, a Alle zurรผcksetzen button appears when you have one or more overrides. Clicking it clears every override in one action โ the active preset (or plugin default) takes over again.
6. Behind the scenes
The plugin's frontend JS installs a MutationObserver on every SDK-rendered error and toast element. When a message matches a known code (or an alias), the observer swaps the text and applies the corresponding level class โ no page reload required.
