Developer Overview
MediaShield overviewFree + ProGet MediaShield →
PRO - requires MediaShield Pro.
This section is for developers extending or integrating MediaShield Pro. For site-owner documentation, see Getting Started.
Key Facts
Section titled “Key Facts”| Item | Value |
|---|---|
| PHP namespace | MediaShieldPro\ |
| REST namespace | mediashield-pro/v1 |
| Text domain | mediashield-pro |
| Free plugin required | MediaShield (any active version) |
| Version documented | 1.4.0 |
Pro’s only dependency check is defined( 'MEDIASHIELD_VERSION' ) - it does not compare version numbers. Free and Pro are released in lockstep, so run matching versions (1.4.0 with 1.4.0).
How Pro Extends Free
Section titled “How Pro Extends Free”MediaShield Pro extends the free plugin through WordPress hooks, filters, and free’s public static helpers. It never:
- Registers routes under
mediashield/v1(free’s REST namespace). - Adds a top-level admin menu of its own. It injects screens into free’s React admin SPA via the
mediashield_admin_routesJS filter, and adds two ordinary submenu pages under the free MediaShield menu: Bunny Playback (mediashield-bunny-playback) and Video Ad Defaults (mediashield-video-ad-defaults, only when WB Ad Manager supplies video ads).
It does read some free-owned options directly (ms_enabled, ms_show_badge) and calls free classes directly (MediaShield\Access\AccessControl::can_watch(), MediaShield\Access\SessionManager::validate_token()). Free treats those as public API; do not assume the boundary is hook-only.
Boot Sequence
Section titled “Boot Sequence”Pro bootstraps on plugins_loaded at priority 20, after free’s default-priority bootstrap, guarded by the MEDIASHIELD_VERSION constant:
plugins_loaded (priority 10) free plugin initializesplugins_loaded (priority 20) Pro checks defined( 'MEDIASHIELD_VERSION' ) -> Migrator::run(), Plugin::instance() -> registers REST, hooks, subsystems -> fires mediashield_pro_loadedPro does not hook mediashield_loaded. That action exists in free but has no subscribers; load order is carried by the priority gap plus the constant guard. Hook mediashield_pro_loaded if you need to run after Pro is ready.
Subsystems
Section titled “Subsystems”| Subsystem | Purpose |
|---|---|
| Access | Per-video role restriction (Access\RoleAccess) |
| Analytics | Heatmap aggregation, realtime viewers, suspicious-activity alerts, optional VPN lookup, playback-event recording |
| Platform | Bunny, YouTube, Vimeo, and Wistia connections, browsing, and import; Platform\BunnyUrls derives and signs Bunny playback URLs; REST\BunnyWebhookController receives encoding callbacks |
| Upload | Platform upload drivers and the ms_upload_queue job log |
| LMS | Auto-completion and enrollment gating for LearnDash, Tutor LMS, LifterLMS |
| Watermark | Advanced watermark configuration (7 fields) |
| Milestones | Webhook, email, and user-meta actions on milestone events |
| Ads | Per-video in-video ad selection on top of free’s ad-manager bridge |
| Export | Streaming CSV and async PDF reports |
| Licensing | Pro license activation and status (updates only, no feature gating) |
| Reports | Weekly engagement digest email |
| Privacy | GDPR exporter and eraser for Pro-owned tables |
Encryption note: MediaShield does not encrypt or package video, and since 1.4.1 Pro has no DRM subsystem. MediaShield controls who can start playback. Use your video host’s own DRM, such as Bunny Stream’s.
Access Control Priority Stack
Section titled “Access Control Priority Stack”MediaShield\Access\AccessControl::can_watch() runs free’s own checks first - admin bypass, login gate, per-video role gate (_ms_access_role), domain restriction - and only then applies the mediashield_can_watch filter. Subscribers on that filter:
| Priority | Subscriber | Decision |
|---|---|---|
| 20 | Pro Access\RoleAccess |
Per-video role restriction (_ms_access_role) |
| 25 | Pro LMS adapters | Enrollment gate, per video via _ms_lms_require_enrollment |
Every subscriber returns early when $result['allowed'] is already false, so a denial from an earlier callback stands. Pick a priority outside 20-25 for custom callbacks.
Admin screens
Section titled “Admin screens”Pro routes added to the SPA hash router: #/platforms, #/bunny-browser, #/youtube-browser, #/vimeo-browser, #/wistia-browser, #/alerts, #/heatmap, #/realtime, #/export, #/upload-queue, #/milestone-config, #/license. They are inserted before #/settings, and the Settings screen gains a Pro Watermark card.
WP-CLI
Section titled “WP-CLI”wp mediashield-pro scale {seed,benchmark,teardown} seeds synthetic rows into Pro’s tables and times hot queries. It is a development tool. Do not run it on a live site.

