LH Beacon

LH Beacon is a small shared beacon API for the front end of a WordPress site. Any plugin can queue a payload in the browser, and LH Beacon sends everything queued in a single request when the visitor hides or leaves the page. On the server it hands each payload to whichever plugin is listening for it.

It exists so that plugins needing to report something when a visit ends (time on page, last seen, unsent state) do not each add their own unload handlers and requests, and so logged-out pages no longer need the Heartbeat API, with its jQuery and admin-ajax overhead, just to say a visitor was here.

LH Beacon is deliberately pure infrastructure. It knows nothing about what rides on it: it checks only the request itself (same origin, size, and a per-IP rate limit), and every consuming plugin validates and stores its own data. Its script is registered but never loaded on its own; it appears only on pages where a plugin’s script depends on it.