Skip to Content
SDKHandling User Consent

Handling User Consent

Appneck is privacy-first, and since SDK 0.4.0 it is built for WordPress.org’s rules: a free plugin sends nothing to Appneck, not even its first registration, until the site owner opts in. Most of the consent flow is automatic. bootstrap() wires up the prompt and the handling for you. You make one explicit call, and only to give users a way to change their decision later.

Update to SDK 0.4.0 and ship a plugin release. Older SDK versions registered a free plugin with Appneck before the owner had answered, which WordPress.org plugin guideline 7 does not allow. Updating Appneck’s servers does not change plugins already in the field.

Free or pro?

A plugin is free unless it says otherwise. A pro build you sell outside WordPress.org passes is_premium:

$sdk = \Appneck\Sdk\Sdk::bootstrap( 'pk_live_...', 'sk_live_...', 'https://appneck.com', __FILE__, null, null, null, null, array( 'is_premium' => true ) // pro build only );
Free (default)Pro (is_premium)
Consent promptshown until answerednever shown
Before an answer, or after Skipnothing is sent or collectedn/a
After Allow & Continueusage data + update emails to the admin who clickedalways on
Admin names/emails at registrationnot sentsent
Uninstall surveyworks either wayworks

A pro build that forgets is_premium behaves like a free one: it asks for consent and stays silent until it gets it. Your Org Panel warns you when a product’s Free/Pro setting disagrees with what its installations report.

Pro plugins: say it in your terms. A pro build sends usage data and the site administrators’ names and emails without asking. WordPress.org’s rules don’t apply to a plugin you sell yourself, but data-protection law (such as GDPR) does, so your terms or privacy policy must say what is sent and why.

What’s automatic (free plugins)

After bootstrap(), the SDK:

  • Shows the opt-in card in the admin notices area: your product icon, “Never miss an important update”, a short explanation, a and two buttons: Allow & Continue → and Skip.
  • On Allow & Continue, turns on usage data and update emails (security and feature updates, educational content, occasional offers). The emails go to the admin who clicked, using their own account’s email and name.
  • On Skip, records the refusal and sends nothing.
  • Blocks every request to Appneck until the owner allows it: registration, telemetry, announcements and status updates. Your track() calls return false and record nothing until then.

Pass your product icon so the card shows it (otherwise a neutral icon is used):

array( 'icon_url' => plugins_url( 'assets/icon-128.png', __FILE__ ) )

What is shared

The card’s “What’s shared?” list is hidden for now, so put this list in your plugin’s readme and privacy policy. It is exactly what the SDK sends, and the SDK’s own tests fail if the two ever differ:

  • Your name and email (for update emails only)
  • Site URL
  • WordPress, PHP, WooCommerce and plugin versions
  • Installed plugins and active theme
  • Locale, timezone and country
  • Server software and whether the site is a multisite
  • Which features of your plugin are used, and errors it hits (your custom events)

Reading the current state (optional)

$sdk->may_contact_appneck(); // bool: may the SDK contact Appneck right now? $sdk->is_premium(); // bool: was this build bootstrapped as pro? $consent = $sdk->consent(); $consent->is_accepted(); // bool $consent->is_rejected(); // bool $consent->is_pending(); // bool, no decision made yet $consent->status(); // the raw status $consent->decided_at(); // when they decided $consent->is_sync_pending(); // decided locally, not yet synced to Appneck $sdk->marketing_consent()->is_opted_in(); // update emails on?

This is for your own logic. You don’t need it for the SDK to behave correctly.

Letting users change their mind (the one call you make)

Render the consent controls on your plugin’s own settings page:

$sdk->consent_notice() ->set_privacy_policy_url( 'https://your-plugin-site.com/privacy' ) ->render_settings_section();

It draws two independent switches:

  • Share usage data: turning it off stops everything except the uninstall survey. If Appneck had recorded the acceptance, one request tells it about the change.
  • Receive update emails: can be turned on only while usage data is on (an email opt-in needs a registered site). Turning it off always works.

Each switch records its own decision on Appneck. A pro build renders nothing here, because it has no consent to manage.

Forcing the prompt to reappear (advanced, rare)

$sdk->consent()->reset();

This clears the local decision only, so the prompt reappears on the next admin page load. It does not contact Appneck by itself. On a free plugin a reset reads as “not answered yet”, so nothing is sent until the owner answers again.

The SDK can re-ask users who had accepted if your privacy policy changes, via two filters (advanced, optional):

  • appneck_sdk_privacy_policy_version: set your current policy version
  • appneck_sdk_reprompt_on_policy_change: control whether a version bump re-asks users for consent

The re-confirmation asks about usage data only (“Keep sharing” / “Stop sharing”) and never changes the update-email decision. For a basic integration, ignore these.

Next: Displaying Announcements →