Heartbeats & Installations
This is the part you get for free. Once bootstrap() has run, the SDK
handles installation tracking and heartbeats automatically — there are no
methods to call. This page just explains what’s happening so your dashboard
numbers make sense.
What’s an “Installation”?
One specific website using one specific plugin of yours. The first time your plugin runs on a site, the SDK enrolls it (registers the installation) and the site is now tracked. A returning site is recognized as the same installation, not a new one.
You can check whether the current site has finished enrolling:
if ( $sdk->is_registered() ) {
// this site has enrolled with Appneck
}You won’t usually need this — it’s there if your own logic wants it.
What’s a “Heartbeat”?
A periodic “still alive and active” signal, sent automatically on a
WordPress cron the SDK schedules for you during bootstrap(). Appneck uses
the gap between heartbeats to classify installations as active, inactive, or
lost.
What’s collected automatically
Technical, non-personal signals — plugin version, PHP version, WordPress version, WooCommerce version (if present), locale, timezone, country (derived server-side, the site’s IP is not stored), and whether it’s a Multisite install. Never customer data or site content.
What’s automatic vs. what needs a call
| Behavior | Automatic? |
|---|---|
| Installation registration on first run | ✅ Automatic |
| Activation / deactivation detection | ✅ Automatic |
| Heartbeat cron | ✅ Automatic |
| Reactivation detection | ✅ Automatic |
| Uninstall cleanup | ❌ Requires a separate uninstall.php file — see below |
The one lifecycle piece that is NOT automatic: uninstall
WordPress treats deleting a plugin specially. Everything above is wired by
bootstrap(), but true uninstall is not — you must create it yourself.
Create a file named exactly uninstall.php at the root of your plugin
(WordPress only looks there — a subdirectory won’t work), and call
Sdk::uninstall(...) inside it:
<?php
// uninstall.php — at your plugin's root directory
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
require_once __DIR__ . '/vendor/appneck/wordpress-sdk/appneck-sdk.php';
appneck_sdk_load_latest();
\Appneck\Sdk\Sdk::uninstall(
'pk_your_product_key',
'sk_your_product_secret',
'https://appneck.com'
);⚠️ Important WordPress behavior: if an
uninstall.phpfile exists, WordPress ignoresregister_uninstall_hook()entirely. So don’t try to do both — use theuninstall.phpfile, as shown here. This is the supported path.
Next: Uninstall Survey Setup →