ActiveOHS: Credential Export

OHS compliance reporting without the n+1 query problem. A 26-column CSV export that traverses four ACF post type relationships in a single pass - built for Canadian regulatory audit requirements.

Compliance Tools Enterprise WordPress Plugin
ActiveOHS: Credential Export

How It Works

1

Trigger from WP Admin

Authorised administrators trigger the export from the WordPress admin panel. Nonce verification runs before any data is accessed.

Relational Traversal Runs

The plugin resolves all four ACF post type relationships - employee, completion, course, certification - in a single structured pass.

CSV Builds Per Row

Each employee's full credential record is written as a 26-column row: training history, certification status, expiry dates, and regulatory compliance.

File Downloads to Browser

The completed CSV streams directly to the browser as a download. Ready for the auditor, the HSE team, or the client's records system.

Compliance Reports That Actually Match What Auditors Ask For

Built for OHS training platforms running ACF-relational data models in WordPress - where the compliance data is real but exporting it cleanly is not.

Single-Pass Relational Traversal

Employee - completion - course - certification resolved in one structured query sequence across four ACF post types. No n+1 loops, no timeout risk on large datasets.

26-Column Compliance CSV

Output matches Canadian OHS audit requirements: employee ID, course, provider, completion date, certification type, expiry, regulatory standard, and compliance status per row.

Direct Browser Download

CSV generates on demand and streams directly to the browser. No intermediate storage, no temporary files, no extra steps for the administrator.

Role-Based Access Control

Export action gated behind a WordPress capability check. Only authorised roles can trigger a download.

Nonce-Verified Request

The export URL cannot be triggered by an unauthenticated crawl or a cached page load. Every export request is verified before any data is read.

Built for Ontario OHS Regulation

Column structure and compliance status logic built from actual ActiveOHS client reporting requirements under Ontario occupational health and safety regulation.

Compliance reporting for OHS training platforms sounds like a data export problem until you look at the data model. ActiveOHS tracks training completions, certifications, expiry dates, and regulatory requirements across four separate custom post types, all connected through ACF relational fields. When an enterprise client needs a compliance report for a ministry audit or corporate HSE review, the data they need lives in four different tables with no single query that touches all of it.

I built the credential export plugin to solve that in a single pass.

The plugin traverses the full relational chain in one query sequence: employee records link to completions, completions link to courses, courses link to certifications, certifications link to regulatory standards. All four relationship layers resolve in a single structured query pass rather than n+1 lookups per employee. For platforms with hundreds of employees and dozens of active certifications per person, the difference between a lazy relational traversal and a structured single-pass query is the difference between a report that runs in seconds and one that times out.

The output is a 26-column CSV built to what Canadian OHS regulators actually ask for during audits: employee name and ID, course title and provider, completion date, certification type, expiry date, regulatory standard, and compliance status per standard. The column structure was built from the ActiveOHS client's specific reporting requirements under Ontario OHS regulation. It generates directly to the browser as a downloadable file - no intermediate storage, no temporary files, no page reload.

Access is gated behind a WordPress capability check. Only users with the right role can trigger an export. The export action runs through a nonce-verified admin request so the URL cannot be triggered by an unauthenticated crawl or cached page load.

For OHS platform operators, HR systems, or any WordPress-based compliance tool that needs structured data extraction from complex ACF relational models, this plugin pattern - single-pass relational traversal into a formatted CSV with proper access control - is directly transferable to other regulatory domains.

Running a Compliance Platform or Training Management System?

I build custom WordPress plugins for OHS platforms, credentialing systems, HR tools, and any compliance use case that requires structured data extraction from ACF relational models. Tell me what you need to export.