Documentation
Add Plugie Insights to your plugin.
Install the PHP SDK, ask site owners for consent, and choose what to measure.
PHP SDK
Plugie Insights PHP SDK
The library a WordPress plugin ships to report installation state, feature usage and lifecycle events to Plugie Insights — only after the site owner has opted…
Install
The package is not on Packagist yet. Add it from this repository:
Initialise
In your main plugin file, at load time (not inside a hook — the SDK registers admin_init, shutdown, activation, deactivation and uninstall hooks itself and…
Consent
The default is off, and off means nothing leaves the site — not registration, not a snapshot, not an event.
Deactivation survey
Off by default. Turned on, it asks the site owner why they are deactivating your plugin, in a popup on the Plugins screen, and sends the answer with the…
Measure features
feature($key) returns a handle; the same key returns the same handle, so you can measure from several files. Keys are ^[a-z][a-z0-9_]{0,63}$.
Record onboarding steps
A step is a milestone in getting started with your plugin: an account connected, a first form published. Record it where it happens:
Lifecycle events
With plugin_file set, the SDK sends plugin_activated, plugin_deactivated and plugin_uninstalled itself.
Show the owner what you send
The PRD names this the primary mitigation for privacy perception, so it is part of the contract.
When the site moves
A migrated site and a cloned site produce the same signal — the stored site hash no longer matches — and need opposite answers.
When something goes wrong
Nothing surfaces. Every public method, every hook callback and every gauge callback runs inside a guard that records the throwable and continues.
Scheduling, for the curious
One due-check behind two triggers. A daily WP-Cron event (plugie_insights_cron, scoped per plugin id) and an admin_init-registered shutdown callback both ask…
Complete example
Complete example, in the Plugie Insights PHP SDK guide.