WP Manifestindependent plugin directory
manifest / ecommerce / spotplayer-license-manager

SpotPlayer License Manager (MDN Academy)

WooCommerce plugin that automatically issues SpotPlayer DRM video licenses on order payment and delivers the key via SMS — replacing manual license issuance.

by MDN Academy · github.com/naznaveh/spotplayer-license-manager

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/naznaveh/spotplayer-license-manager/archive/refs/heads/master.zip

SpotPlayer License Manager (WordPress + WooCommerce)

Automates DRM license issuance for MDN Academy's video courses: when a WooCommerce order is paid, this plugin automatically generates a SpotPlayer license key and SMS's it to the customer — replacing what was previously a manual, error-prone process.

The problem

MDN Academy delivers course videos through SpotPlayer (a DRM-protected video player popular in the Iranian e-learning market). Every completed sale needs a license key generated via SpotPlayer's API and sent to the buyer — previously done by hand for every order, which doesn't scale and is easy to get wrong (wrong course bundle, forgotten customer, typo'd phone number).

What it does

  • Course mapping — each WooCommerce product gets one or more SpotPlayer course IDs attached (supports bundles: multiple IDs per product).
  • Automatic issuance — hooks into woocommerce_payment_complete, so as soon as a real payment gateway (Zarinpal, etc.) confirms payment, a license is created via SpotPlayer's API and watermarked with the customer's phone number (piracy deterrent).
  • Manual fallback — a meta box on the order screen lets staff issue (or resend) a license by hand for manual/bank-transfer orders, which are deliberately excluded from the automatic hook.
  • SMS delivery — the license key is sent via Melipayamak's pattern-based SMS API (BaseServiceNumber), using a pre-approved template with {customer_name} / {license_key} placeholders — chosen specifically because it doesn't depend on a fixed sender line (see the otp-login plugin's README for why that matters on this account).
  • Idempotent — checks for an existing license key on the order before issuing a new one, so retries/webhook duplicates don't create duplicate licenses.
  • Audit trail — every step (success or failure, and why) is logged as a WooCommerce order note.

Configuration

Admin settings page (لایسنس اسپات‌پلیر in the WP sidebar) holds:

  • SpotPlayer API key
  • Melipayamak username/password
  • Melipayamak SMS pattern body ID (template: {0} = customer name, {1} = license key)

Structure

Single-file plugin (spotplayer-license-manager.php) — deliberately kept flat since the logic is a linear pipeline (order paid → resolve course IDs → call SpotPlayer → SMS the key) rather than something that benefits from a class hierarchy.

License

MIT