Licensing and the Lite upgrade

Updated

Licensing and updates

The plugin has its own small license client for the WPInterface store, which runs EDD Software Licensing.

  • Storage: option wpinterface_paddle_woo_pro_license (License::OPTION).
  • Activation: the license box on WooCommerce → Paddle posts to admin-post.php?action=wpinterface_paddle_woo_license. License::activate() calls activate_license and clears the update_plugins transient; License::deactivate() calls deactivate_license and deletes the option.
  • Check: License::weekly_check() on admin_init calls check_license once a week; after a connection failure it retries a day later and keeps the last status.
  • Requests go to License::store_url() (WPINTERFACE_PADDLE_WOO_PRO_STORE_URL, filter wpinterface_paddle_woo_license_store_url) with edd_action, license, item_name, item_id, url and environment.
  • Updates: License::updater() on init, only while a key is saved and only in admin, cron or WP-CLI, creates the bundled EDD_SL_Plugin_Updater (not loaded if another plugin already defined the class).
  • License::status() returns '' without a key, otherwise the stored status (valid, expired, invalid, site_inactive, …). No feature checks the license; it only controls updates and support.

Releasing an update means uploading the new ZIP to the Pro download (ID 71568, Software Licensing enabled) and raising its version on the store.

Testing against a local store

The bundled updater refuses to query its own home_url(), so a store on the same site must be reached through a different URL. Define WPINTERFACE_PADDLE_WOO_PRO_STORE_URL (for example http://your-site.local/index.php) and WPINTERFACE_PADDLE_WOO_PRO_ITEM_ID (the local download’s ID) in wp-config.php, or use the store URL filter in an mu-plugin.

Moving from Lite to Pro

Lite (wpinterface-paddle-for-woocommerce) and Pro share the gateway ID wpinterface_paddle, the settings option, every _wpinterface_paddle_* meta key and the wpinterface-paddle-woo/v1/webhook route, so nothing is migrated. Lite doesn’t boot when WPINTERFACE_PADDLE_WOO_PRO_VERSION is defined, and its uninstaller does nothing while Pro is present.

On activation (Lite_Upgrade::on_activation):

  • The store “came from Lite” if Lite is active, or the settings option exists without a checkout_mode key (Lite never writes it).
  • Deactivates Lite.
  • When coming from Lite and no checkout style is saved, stores checkout_mode = overlay (Lite only offers the overlay), and sets wpinterface_paddle_woo_pro_welcome.
  • Deletes Lite’s wpinterface_paddle_woo_needs_pro_subscriptions flag.
  • Deletes wpinterface_paddle_woo_webhook_events, so the webhook events are checked again.

On admin_init:

  • deactivate_lite() deactivates Lite if it gets activated alongside Pro, and sets the welcome option.
  • sync_webhook_events() (priority 20, not during AJAX, manage_woocommerce only): for each environment that has a Billing API key and webhook secret and whose stored hash differs from the current events, calls Billing_Driver::ensure_webhook_events( $sandbox ), which PATCHes in any missing events; the secret is unchanged. On failure the error is stored and retries are blocked for an hour.
  • Set up webhook records the environment as synced.

Renewals during Lite

Lite answers subscription webhooks for Paddle subscriptions with an error, so Paddle retries them, and Pro records them after the upgrade.

Was this page helpful?