Why a separate tool?
The more forms, languages, notifications and subpages there are, the harder it is to manually check whether everything is still correct after an update. Errors can be invisible, yet still have serious business consequences: a message with an unsubstituted merge tag, a translation using a different list of keys, a condition referring to a non-existent field, or a page linking to the wrong resource.
The diagnostic centre runs repeatable checks and displays the results in the PWE System dashboard. The module was previously linked to PWE Multilang; I migrated it with a view to it also covering tests for other systems in the future. I developed the current implementation myself.
Scope of checks
- Page availability and HTTP responses.
- Selected PHP errors and issues with JS/CSS resources.
- Links that point where they should not.
- Correctness of Gravity Forms merge tags and conditional logic.
- QR feed configuration.
- Consistency of translations and WPML configuration, and alignment of notification languages with forms.
- Unreplaced placeholders and incorrect language links.
During selected checks, sending emails is paused so that the diagnostic tool cannot accidentally send notifications. Only administrators can run the checks.
These are not PHPUnit unit tests, but a tool for diagnosing the actual configuration of a live WordPress environment.
Nine checks
- Page health — pages in every configured language: whether they work, report no errors and load all their resources.
- Tags in notifications — tags within notification content and their compliance with the form structure.
- Tags in confirmations — the same applies to confirmations after a form is submitted.
- Conditional logic — conditions indicating invalid or non-existent fields.
- Links in notifications — URLs in notification templates and their correctness for a given language.
- Unsubstituted text — text and placeholders that should be substituted before sending.
- Notification languages — required, available and active notification languages: omissions, duplicates, inconsistencies.
- Translation consistency — consistency of keys and translation sets for forms and communications.
- QR codes — configuration of feeds and links required to support QR codes.
Dashboard and reports
The dashboard displays a list of checks with their statuses and detailed results in a separate window (with a dedicated view for QR codes). You can run a single check or the entire set. Page checks run in batches so the site is not loaded with one long task.
- Results are remembered — you can reopen the dashboard without repeating the entire diagnostic process.
- The latest results go into a report that other team tools can use too.
Architecture
One shared mechanism runs all the checks, enforces permissions and stores the results. Each of the nine checks is a separate module and the report is a separate component — adding a new check requires no changes to the others.
The checks follow the site’s real configuration: for example, they only check the languages a given form actually uses instead of always requiring all of them.
Results and future development
Some errors can be detected using a repeatable set of rules before they are reported by a trade fair user. The tool facilitates the review of changes, language roll-outs and the configuration checking of multiple elements within a single website. I do not have a measured figure for the number of faults detected or hours saved, so I am describing the impact in qualitative terms.
Direction of development: the centre is to cover systems unrelated to multilingual support as well.