Wolvy DOCS

Plugin · WordPress.org

Wolvy Video for WordPress

The official plugin puts Wolvy video on a WordPress site with every piece of code from these docs already written: signed viewer tokens, correct iframes, a library browser, analytics, health checks and a verified webhook receiver.

Version 1.0.0 WordPress 6.5+ · tested to 7.1 PHP 7.4+ GPLv2 or later
On this page

What it does#

Embed

Block, shortcode, Elementor, PHP

Insert a video however you build pages. Every player gets the iframe attributes DRM needs.

Identity

Signed playback

Tokens are signed on your server with your signing secret — no API call per page view.

wp-admin

Library & analytics

Search your Wolvy library, copy shortcodes, see views, watch time, countries and recent viewers mapped to WordPress users.

Diagnostics

Health screen

Names the silent breakers — domain rules, referrer policy, a rotated secret, page caching — before your visitors find them.

The Wolvy library inside wp-admin: video cards with status and protection badges and a copyable shortcode each
Wolvy → Library in wp-admin.

Install & connect#

  1. InstallIn wp-admin go to Plugins → Add New, search for Wolvy Video, then Install and Activate. Or download it from WordPress.org.
  2. Add your API keyCreate one in the Wolvy dashboard (Settings → API) with the scopes below. In Wolvy → Settings, paste it and press Verify API key — this also discovers your account id.
  3. Add your signing secretCopy it from Settings → Watermark → Signing secret, paste it and press Verify signing secret.
  4. Check HealthOpen Wolvy → Health and fix anything that is not a pass before you publish a page with a video.

API key scopes#

The key powers the admin features only — playback never uses it. A missing scope hides the feature that needs it rather than breaking the site.

ScopeUsed for
account:readAccount details, player settings, the domain-rules check.
videos:readLibrary browser, block picker, posters and titles.
analytics:readAnalytics screen.
sessions:readRecent viewers, resolved back to WordPress users.
usage:readPlan usage meters.
webhooks:manageRegistering this site’s webhook endpoint.
playback:signVerifying the stored signing secret.

Secrets in wp-config.php#

Settings saved in wp-admin are encrypted with keys derived from your site’s salts, which protects them if only the database leaks. To keep them out of the database entirely, define constants — a constant always wins over the saved setting.

wp-config.php
// wp-config.php — above the line "That's all, stop editing!"
define( 'WOLVY_API_KEY', 'wv_live_…' );
define( 'WOLVY_VIEWER_SIGN_SECRET', '…64 hex characters…' );
ConstantValue
WOLVY_API_KEYDeveloper API key, wv_live_….
WOLVY_VIEWER_SIGN_SECRETYour account’s viewer signing secret (64 hex characters).
WOLVY_ACCOUNT_IDNumeric account id used in embed URLs. Normally filled in for you when you press Verify API key.
WOLVY_WEBHOOK_SECRETThe whsec_… secret for inbound webhook deliveries.
WOLVY_API_BASE / WOLVY_EMBED_BASEEndpoint overrides. Leave unset.

Embedding videos#

Block editor

Add the Wolvy Video block and pick a video from your library — searchable, filterable by folder. The block renders on the server, so each visitor gets their own token.

Shortcode

Shortcodes
[wolvy id="a1b2c3d4e5f60718293a"]

[wolvy id="a1b2c3d4e5f60718293a" aspect="9:16" max_width="420px"]

[wolvy id="a1b2c3d4e5f60718293a" facade="1" title="Lesson 3 — Pricing strategy"]
AttributeDefaultDescription
idThe video id. Required. [wolvy a1b2c3d4e5f60718293a] works as a shorthand.
aspect16:9Ratio as w:h, w/h or a number. Clamped between very wide and very tall so a typo cannot collapse the player.
facade01 shows the poster with a play button and loads the player only on click — keeps pages with many videos light.
lazysetting1/0 — add loading="lazy" to the iframe. Ignored when facade="1".
posterfrom WolvyA poster URL for click-to-play mode, or none.
titlevideo titleAccessible name of the iframe. Fetched from your library when omitted.
max_widthsettingA CSS length such as 720px, 80% or 40rem.
classAn extra CSS class on the wrapper.
ttlsettingToken lifetime in seconds for this embed only (60–86400).

[wolvy_video] works as an alias. An attribute the plugin cannot honour — autoplay is the usual one — shows a notice to administrators instead of being silently ignored: playback behaviour is an account setting in the Wolvy dashboard.

Elementor

Drag in the Wolvy Video widget (it appears only when Elementor is active) and choose a video in the panel.

Theme templates

single-lesson.php
<?php
// In a theme template. Returns nothing when the plugin is inactive.
if ( function_exists( 'wolvy_video' ) ) {
    wolvy_video( 'a1b2c3d4e5f60718293a', array( 'aspect' => '16:9', 'facade' => 1 ) );
}
FunctionReturns
wolvy_video( $id, $args = array(), $echo = true )Render a player from a theme template. $args takes the shortcode attributes.
wolvy_video_embed_url( $id )The embed URL, signed for the current visitor (unsigned for guests).
wolvy_viewer_token()The current visitor’s signed token. One token covers every video, so call it once per page.
wolvy_viewer_id()The viewer id the watermark will show for the current visitor.
wolvy_get_video( $id )One video’s metadata from your library (cached). Returns an array or WP_Error.
wolvy_get_videos( $args = array() )A page of the library (cached). Pass next_cursor as starting_after for the next page.

Who can watch#

Everyone, by default. A signed-in visitor gets a signed token, so the watermark and session records name them. A visitor who is not signed in gets an unsigned embed, which plays unless your account has enforcement on.

  • To restrict playback, turn on Require visitors to sign in in Wolvy → Settings and choose what others see: a message, a sign-in link, or nothing.
  • For finer rules — a membership level, a purchased course — use the wolvy_can_view filter.

What the watermark shows

Identity modeExampleNotes
Pseudonymous (default)wv_9f2b6c1d3e4a5b60Stable per user, stored in user meta so a leak traces back to an account. Reveals nothing on screen.
WordPress user idwp-user-42Traceable, and meaningless to anyone who sees it.
Usernamesara.kLegible on the watermark.
Email address[email protected]The strongest deterrent — and visible to anyone looking at the screen.

The id is stored in user meta and registered with WordPress’s personal-data export and erase tools. Pages that carry a viewer token are marked uncacheable (DONOTCACHEPAGE and Cache-Control: private, no-store); pages for anonymous visitors cache normally.

Filters & actions#

Hook into the plugin from your theme’s functions.php or a small site plugin.

wolvy_can_view filter

apply_filters( 'wolvy_can_view', bool $can_view, string $video_id )

The access gate. Return false to show the “please sign in” notice instead of the player. This is where a membership or LMS plugin hooks in.

Example
<?php
// Only members may watch. Replace the role check with your membership plugin's own test.
add_filter( 'wolvy_can_view', function ( $can_view, $video_id ) {
    if ( ! is_user_logged_in() ) {
        return false;
    }
    $roles = (array) wp_get_current_user()->roles;
    return (bool) array_intersect( array( 'administrator', 'member' ), $roles );
}, 10, 2 );

wolvy_viewer_id filter

apply_filters( 'wolvy_viewer_id', string $id, int $user_id )

Use a different identity on the watermark — an LMS enrolment, a CRM contact, a licence number. Keep it stable per person; anything past 64 characters is cut.

Example
<?php
// Put the student number on the watermark instead of the default pseudonymous id.
add_filter( 'wolvy_viewer_id', function ( $id, $user_id ) {
    $student_no = get_user_meta( $user_id, 'student_number', true );
    return $student_no ? 'STU-' . $student_no : $id;
}, 10, 2 );

wolvy_embed_url filter

apply_filters( 'wolvy_embed_url', string $url, string $video_id, string $vt )

Adjust the final embed URL.

wolvy_iframe_attributes filter

apply_filters( 'wolvy_iframe_attributes', array $attributes, string $video_id, array $atts )

Final say over the iframe’s attributes. Keep allow (with encrypted-media) and referrerpolicy — both are load-bearing.

Example
<?php
// Add a data attribute for your own analytics. Leave allow and referrerpolicy untouched.
add_filter( 'wolvy_iframe_attributes', function ( $attributes, $video_id, $atts ) {
    $attributes['data-lesson'] = $video_id;
    return $attributes;
}, 10, 3 );

wolvy_player_html filter

apply_filters( 'wolvy_player_html', string $html, string $video_id, array $atts )

Final say over the whole player markup.

wolvy_guest_notice_html filter

apply_filters( 'wolvy_guest_notice_html', string $html )

Replace the block shown to visitors who may not watch.

wolvy_admin_capability filter

apply_filters( 'wolvy_admin_capability', string $capability, string $screen )

Who may open each Wolvy admin screen.

wolvy_webhook_event action

do_action( 'wolvy_webhook_event', string $type, array $data, array $event )

Fires for every verified webhook delivery. Do slow work (emails, LMS updates) here, not in a filter.

Example
<?php
// Email the site admin when a video finishes encoding. Runs only for verified deliveries.
add_action( 'wolvy_webhook_event', function ( $type, $data, $event ) {
    if ( 'video.ready' !== $type ) {
        return;
    }
    wp_mail(
        get_option( 'admin_email' ),
        'A Wolvy video is ready',
        sprintf( 'Video %s finished encoding and can be published.', $data['id'] )
    );
}, 10, 3 );

Webhooks#

Optional. Encoding is asynchronous, so a video added to a page right after upload is cached as “processing”. With webhooks on, Wolvy tells the site the moment it is ready and the cached copy is refreshed.

  1. EnableIn Wolvy → Settings, register the webhook. The site must be reachable on a public https address — localhost and .test domains cannot receive deliveries.
  2. DoneThe plugin creates the endpoint https://your-site.com/wp-json/wolvy/v1/webhook for video.ready, video.failed, video.deleted and caption.ready, stores its secret, and verifies every delivery’s signature and timestamp.

Build on it with the wolvy_webhook_event action. If you deactivate the plugin for good, remove the endpoint in Wolvy → Settings first, so Wolvy stops sending to a URL that no longer answers.

Health & troubleshooting#

The Wolvy Health screen: pass, problem, check and note rows for PHP environment, API key, account id, signing secret, key scopes, domain rules, watermark enforcement, referrer policy, page caching and webhooks
Wolvy → Health names what would break playback.
SymptomCauseFix
Blank player or error pageThis site is not on your account’s allowed domainsAdd the hostname in Settings → Protection → Allowed domains
Blank player after installing a security pluginThe site sends Referrer-Policy: no-referrerThe plugin’s iframe overrides it — check a custom wolvy_iframe_attributes filter didn’t remove referrerpolicy
Watermark shows no viewer id — or, with enforcement on, nothing playsThe signing secret was rotated in the dashboard, so the site’s tokens no longer verifyPaste the new secret and press Verify signing secret
One visitor sees another visitor’s idA page cache serving logged-in pagesExclude pages with videos, or stop caching for logged-in users
Library or analytics screens emptyThe API key lacks a scopeHealth lists the missing scopes; create a key with them