Skip to main content

Error Tracking

StorePilot captures JavaScript and PHP errors from your WordPress site and centralises them in the Platform dashboard.

How Errors Are Captured

JavaScript Errors

The plugin injects a tracking script into every page. The script listens for:

  • window.onerror — uncaught exceptions
  • window.onunhandledrejection — unhandled Promise rejections

When an error fires, the script sends a payload to the Platform (via the WordPress proxy) containing:

{
"message": "Cannot read property 'x' of undefined",
"source": "https://mysite.com/wp-content/themes/my-theme/js/app.js",
"lineno": 42,
"colno": 18,
"stack": "TypeError: Cannot read ...\n at ...",
"context": {
"url": "https://mysite.com/shop/",
"userAgent": "Mozilla/5.0 ...",
"referrer": ""
}
}

PHP Errors

The plugin registers a custom error handler and exception handler early in WordPress boot (via the MU-plugin loader). Fatal errors, warnings, and uncaught exceptions are captured server-side and forwarded to the Platform.


Error Fingerprinting

To group repeated occurrences of the same error into a single record rather than creating thousands of duplicates, the Platform creates a fingerprint for each error.

The fingerprint is based on:

  • Error message (normalised — dynamic values such as IDs removed)
  • source file URL
  • lineno
  • colno

If an incoming error matches an existing fingerprint, the occurrenceCount is incremented and the lastSeenAt timestamp is updated.


Error Statuses

StatusMeaning
newNewly captured; not yet reviewed
investigatingA team member is looking into it
resolvedFix deployed; the error should not recur
ignoredKnown, not worth fixing (e.g. browser extension noise)
mutedSilenced — no further notifications for this error

Automatic Re-open

If an error with status resolved or ignored is received again (same fingerprint), it is automatically:

  1. Reset to status new
  2. occurrenceCount reset to 1
  3. A new notification fires

This ensures that a regression doesn't go unnoticed because the error was previously marked resolved.


Error Detail

Each error record contains:

FieldDescription
messageError message text
sourceJavaScript file URL or "PHP"
lineno / colnoSource location
stackFull stack trace
statusCurrent status
occurrenceCountHow many times this error has been seen
firstSeenAtTimestamp of first occurrence
lastSeenAtTimestamp of most recent occurrence
contextURL, user agent, referrer at time of capture
recordingLinked session recording (if the error occurred during a recorded session)

Linked Recordings

When an error is captured during a session that is being recorded, the recording session ID is stored alongside the error. In the dashboard you can click "View Recording" to replay exactly what the user was doing when the error occurred.


Noise Reduction

Trusted Origins only — The WordPress proxy validates the Origin and Referer header, ensuring only your own domain can submit error events.

Muted errors — Errors you don't care about (e.g. from browser extensions) can be set to muted status and will never trigger notifications again.

Ignored status — Errors set to ignored still accumulate occurrences but do not send notifications.