VideoHub Documentation

Build your own WordPress video platform with a useful free core and optional official addons for advanced workflows.

💡
Welcome to VideoHub!

This documentation covers the free core, official addon packages, and developer extension points.

What is VideoHub?

VideoHub is a WordPress plugin that lets you create a responsive video platform with videos, playlists, categories, tags, comments, reactions, search, and shortcodes. The free core works on its own; optional official addons add member, channel, upload, monetization, live, optimization, chat, navigation, shorts, and PWA workflows when your project needs them.

Key Features

  • Multi-Platform Support - YouTube, Vimeo, Dailymotion, and self-hosted videos
  • Modern UI - Responsive video platform layout for desktop and mobile
  • Playlist System - Create and manage video playlists
  • Optional Shorts Support - Vertical short-form video experience with the PVH Shorts addon
  • Advanced Search - Professional filtering and search system included in the free core
  • Reactions & Comments - Full engagement system
  • Autoplay - Automatic next video playback
  • SEO Friendly - Clean URLs and structured data

Installation

Method 1: WordPress Admin Upload

  1. Download the polanger-videohub-lite.zip file from WordPress.org or your release package
  2. Go to Plugins → Add New → Upload Plugin
  3. Choose the zip file and click Install Now
  4. Click Activate Plugin

Method 2: FTP Upload

  1. Extract the polanger-videohub-lite.zip file
  2. Upload the polanger-videohub-lite folder to /wp-content/plugins/
  3. Go to Plugins in WordPress admin
  4. Find "VideoHub - Build Your Own Video Platform" and click Activate
⚠️
Important!

After activation, go to Settings → Permalinks and click "Save Changes" to flush rewrite rules.

Quick Start Guide

Step 1: Configure API Keys (Optional)

For automatic video info fetching, add your API keys:

  1. Go to VideoHub → Settings → API Keys
  2. Enter your YouTube Data API v3 key
  3. Enter your Vimeo Access Token (optional)
  4. Click Test to verify keys work
  5. Save settings

Step 2: Create Videos Page

  1. Create a new page (e.g., "Videos" or "All Videos")
  2. Go to VideoHub → Settings
  3. Select your page under "Videos Page"
  4. The shortcode will be automatically added

Step 3: Add Your First Video

  1. Go to VideoHub → Add New
  2. Enter the video title
  3. Paste the YouTube/Vimeo URL in the Video URL field
  4. Click Fetch Info to auto-fill description and thumbnail
  5. Select a category
  6. Click Publish
That's it!

Your video is now live. Visit your Videos page to see it in action!

System Requirements

Requirement Minimum Recommended
WordPress 5.8 6.0+
PHP 7.4 8.0+
MySQL 5.6 8.0+
Memory Limit 128MB 256MB+

Settings

Access plugin settings via VideoHub → Settings in your WordPress admin.

General Settings

  • Videos Page - Select the page to display your video archive
  • Videos Per Page - Number of videos to show per page (default: 12)
  • Videos Per Row - Number of columns in the grid (default: 4)

Video Player Settings

  • Autoplay - Enable/disable video autoplay
  • Related Videos - Show related videos in sidebar
  • Related Videos Count - Number of related videos to display

URL Slugs

  • Video Slug - URL slug for videos (default: "video")
  • Category Slug - URL slug for categories (default: "video-category")
  • Tag Slug - URL slug for tags (default: "video-tag")

API Keys Configuration

YouTube Data API v3

Required for fetching YouTube video information automatically.

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable "YouTube Data API v3"
  4. Go to Credentials → Create Credentials → API Key
  5. Copy the API key and paste in VideoHub settings

Vimeo Access Token

Required for fetching Vimeo video information.

  1. Go to Vimeo Developer Portal
  2. Create a new app
  3. Generate an access token with "Public" scope
  4. Copy and paste in VideoHub settings

Dailymotion API Key

Required for fetching Dailymotion video information.

  1. Go to Dailymotion Developer
  2. Create an application
  3. Copy the API key and paste in VideoHub settings
Testing API Keys
After entering your API key, click the "Test" button next to each field.
A green checkmark indicates the key is valid.
A red X indicates an invalid or expired key.

Homepage Options

Customize which sections appear on your video homepage.

Available Sections

  • Hero Banner - Featured video showcase at the top
  • Shorts Carousel - Horizontal scrolling shorts (requires Shorts addon)
  • Latest Videos - Most recent video uploads
  • Trending Videos - Most viewed videos in the last 7 days
  • Playlists - Featured playlists section
  • Categories - Category-based video sections

Section Settings

For each section, you can configure:

  • Enable/Disable the section
  • Number of items to display
  • Excluded categories (for category sections)

Display Settings

Grid Layout

Setting Options Default
Columns (Desktop) 2, 3, 4, 5, 6 4
Columns (Tablet) Auto-responsive 3
Columns (Mobile) Auto-responsive 2

Thumbnail Sizes

  • Small - 320x180px
  • Medium - 480x270px (default)
  • Large - 640x360px
  • HD - 1280x720px

Adding Videos

Video Sources

VideoHub supports multiple video sources:

1. Video URL (Recommended)

Simply paste the video URL from YouTube, Vimeo, or Dailymotion.

Supported URL Formats
YouTube:
https://www.youtube.com/watch?v=VIDEO_ID
https://youtu.be/VIDEO_ID

Vimeo:
https://vimeo.com/VIDEO_ID

Dailymotion:
https://www.dailymotion.com/video/VIDEO_ID

2. Self-Hosted Video

Upload video files directly to your WordPress media library.

  • Supported formats: MP4, WebM, OGG
  • Recommended codec: H.264 for MP4
  • Maximum file size depends on your server settings

3. Custom Embed Code

Paste any iframe embed code from other video platforms.

Fetch Info Button

Click "Fetch Info" to automatically retrieve:

  • Video title
  • Description
  • Duration
  • Thumbnail (set as featured image)

Bulk Video Import

Import multiple videos at once from YouTube playlists or channels.

Import from YouTube Playlist

  1. Go to VideoHub → Bulk Import
  2. Select "YouTube Playlist"
  3. Paste the playlist URL
  4. Select default category
  5. Click "Import"

Import from YouTube Channel

  1. Go to VideoHub → Bulk Import
  2. Select "YouTube Channel"
  3. Paste the channel URL
  4. Set maximum videos to import
  5. Click "Import"
💡
Tip:

YouTube API has a daily quota limit. Import large playlists in batches to avoid hitting the limit.

Playlists

Creating a Playlist

  1. Go to VideoHub → Playlists → Add New
  2. Enter playlist title and description
  3. Add videos using the video selector
  4. Drag and drop to reorder videos
  5. Set a featured image
  6. Publish the playlist

Playlist Display

Use the shortcode to display a playlist:

Shortcode
[pvh_playlist id="123"]

Categories & Tags

Video Categories

Organize your videos into categories for better navigation.

  • Go to VideoHub → Categories
  • Add new categories with name, slug, and description
  • Categories support hierarchy (parent/child)
  • Each category has its own archive page

Video Tags

Add tags for more granular organization and related video suggestions.

  • Go to VideoHub → Tags
  • Tags are flat (no hierarchy)
  • Used for related video matching

Shortcode Reference

VideoHub shortcodes let you place video platform sections inside pages, posts, widgets, and page builders. Paste a shortcode into the WordPress Shortcode block, Classic Editor, Elementor Shortcode widget, or any builder field that supports WordPress shortcodes.

i
Availability

Core shortcodes are available with VideoHub itself. Addon shortcodes become available only when the related official addon is installed and active. Legacy pvhl_ aliases are kept for older sites and should not be used for new pages unless you are preserving existing content.

How to Use Shortcodes in WordPress

  1. Open the page or post where you want to show VideoHub content.
  2. Add a Shortcode block, or paste the shortcode into the Classic Editor content area.
  3. Replace example IDs such as 123 with the real video, playlist, stream, channel, or user ID from your site.
  4. Update or publish the page, then view it on the frontend.

Where to Find IDs and Slugs

Value Where to find it Example
Video ID Go to VideoHub -> All Videos, open or hover a video, and use the numeric post ID from the edit URL. If the edit URL contains post=5283, use [pvh_video id="5283"].
Playlist ID Go to VideoHub -> Playlists, open or hover a playlist, and use the numeric post ID from the edit URL. If the edit URL contains post=5310, use [pvh_playlist id="5310"].
Category slug Go to VideoHub -> Categories and copy the Slug value. If the slug is game, use [pvh_videos category="game"].
Tag slug Go to VideoHub -> Tags and copy the Slug value. If the slug is news, use [pvh_videos tag="news"].
User or author ID Go to Users, open a user profile, and use the numeric user_id from the URL. If the URL contains user_id=7, use [pvh_channel author="7"].

Common Copy/Paste Recipes

Goal Shortcode to paste
Add one video inside a blog post or page. [pvh_video id="5283"]
Create a simple video homepage. [pvh_home]
Show the latest 12 videos in a 3-column grid. [pvh_latest count="12" columns="3"]
Show videos from only one category. [pvh_videos category="game" count="8"]
Show a playlist on a custom page. [pvh_playlist id="5310" style="player"]
Create a standalone search page. [pvh_search placeholder="Search videos..."]

Core Shortcodes

Shortcode What it does Best used for
[pvh_home]Displays the full VideoHub homepage layout.Main video homepage or landing page.
[pvh_videos]Displays a customizable video grid.Archives, category pages, custom video sections.
[pvh_video]Embeds one VideoHub video by ID.Posts, lessons, documentation, landing pages.
[pvh_categories]Displays video categories as a grid, list, or pills.Browse pages and category directories.
[pvh_playlist]Displays one playlist and its video queue.Series pages, course playlists, curated collections.
[pvh_channel]Displays author videos in core. PVH Channels can replace this with the full channel view.Author or channel pages.
[pvh_trending]Displays most-viewed videos in a recent date window.Trending blocks on landing pages.
[pvh_latest]Displays latest published videos.Recent upload sections.
[pvh_search]Displays the VideoHub search interface when PVH Search is active.Standalone search pages or header search layouts.

[pvh_home] Shortcode

Displays the complete VideoHub homepage surface. It can show the hero section, latest videos, trending videos, playlists, and category-based sections. Addons can hook extra homepage sections into this layout when active.

Basic Usage
[pvh_home]

Parameters

ParameterDescriptionDefault
videos_countNumber of videos to show inside each homepage video section.8
playlists_countNumber of playlists to show in the playlist section.4
columnsGrid columns used by homepage sections.Site setting or 4
show_trendingShow or hide the trending videos section. Use yes or no.yes
show_latestShow or hide the latest videos section. Use yes or no.yes
show_playlistsShow or hide the playlists section. Use yes or no.yes
show_categoriesShow or hide category-based video sections. Use yes or no.yes
categoriesLimit category sections to specific category slugs, separated by commas.All eligible categories
max_categoriesMaximum number of category sections to render.10

Examples

Homepage with fewer videos per section
[pvh_home videos_count="6" playlists_count="3"]
Only selected categories
[pvh_home categories="game,technology,news" max_categories="3"]
Hide trending and playlists
[pvh_home show_trending="no" show_playlists="no"]

Real-World Examples

Use one page as the main VideoHub homepage
[pvh_home]
Create a compact homepage for a small site
[pvh_home videos_count="4" playlists_count="2" max_categories="4"]
Create a category-focused homepage
[pvh_home show_latest="no" show_trending="no" categories="game,news,music"]
Tip
Homepage settings still matter

The shortcode can limit sections, but global homepage behavior is also controlled from VideoHub -> Settings -> Homepage Options.

[pvh_videos] Shortcode

Displays a customizable grid of VideoHub videos. It supports category, tag, author, ID, sorting, exclusion, offset, and pagination controls.

Basic Usage
[pvh_videos]

Parameters

ParameterDescriptionDefault
countNumber of videos to display.Site setting or 12
columnsNumber of grid columns.Site setting or 4
categoryFilter by one or more category slugs, separated by commas.None
tagFilter by one or more tag slugs, separated by commas.None
orderbySort by date, title, rand, or views.date
orderSort direction. Use DESC or ASC.DESC
offsetSkip a number of videos before output begins.0
idsShow only specific video IDs, separated by commas. Preserves the ID order.None
excludeExclude specific video IDs, separated by commas.None
authorFilter by author ID, user slug, or username. If a valid author is found, the author profile template is used.None
pagedEnable pagination. Use true or false.true

Examples

Category grid
[pvh_videos count="8" category="gaming"]
Most-viewed videos
[pvh_videos count="10" orderby="views"]
Specific videos in a custom order
[pvh_videos ids="123,456,789"]
Author videos without pagination
[pvh_videos author="john-doe" count="12" paged="false"]

Most Used: Show One Category Anywhere

Use the category parameter when you want to place videos from one category inside any post, page, sidebar content area, or page builder section.

Show the Game category in a post or page
[pvh_videos category="game"]
Show 8 Game videos in 4 columns
[pvh_videos category="game" count="8" columns="4"]
Show Game News category videos, newest first
[pvh_videos category="game-news" count="12" columns="3" orderby="date" order="DESC"]
Tip
Use the category slug

The shortcode uses the category slug, not the category name. Find it in VideoHub -> Categories. If the category name is "Game News" and the slug is game-news, use category="game-news".

Most Used: Manually Select Videos by ID

Use the ids parameter when you want full control over exactly which videos appear. VideoHub keeps the same order you write in the shortcode.

Show exactly 4 selected videos
[pvh_videos ids="5283,5310,5402,5411" count="4" columns="4"]
Show 3 selected videos in one row
[pvh_videos ids="5283,5310,5402" count="3" columns="3"]
Change the display order manually
[pvh_videos ids="5411,5283,5310,5402" count="4" columns="4"]
Tip
ID order is preserved

If you write ids="5411,5283,5310", the videos appear in that same order. Find video IDs from VideoHub -> All Videos; the edit URL contains a value like post=5283.

Real-World Examples

Technology page with 12 videos in 3 columns
[pvh_videos category="technology" count="12" columns="3"]
Homepage block that skips the first 4 videos
[pvh_videos count="8" offset="4" orderby="date"]
Show videos tagged with "interview" or "podcast"
[pvh_videos tag="interview,podcast" count="9" columns="3"]
Show random featured videos
[pvh_videos ids="5283,5310,5402,5411" orderby="rand" count="4"]
Tip
Category and tag filters use slugs, not names

If the category name is "Game News" but the slug is game-news, use [pvh_videos category="game-news"].

[pvh_video] Shortcode

Embeds one VideoHub video player by video post ID. Use it when you want a specific video inside a normal page or post.

Usage
[pvh_video id="123"]

Parameters

ParameterDescriptionDefault
idVideo post ID. Required.0
widthPlayer width passed to the embedded player template.100%
heightPlayer height passed to the embedded player template.auto
autoplayRequest autoplay for supported player sources. Browser autoplay rules may still require muted playback or user interaction.false
Example
[pvh_video id="123" width="100%" autoplay="false"]

Real-World Examples

Use this shortcode when you want to place one specific VideoHub video inside a blog post, sales page, documentation page, or lesson page.

Add a video inside a WordPress post
[pvh_video id="5283"]
Add a responsive video and request autoplay
[pvh_video id="5283" width="100%" autoplay="true"]
Add two videos one after another in the same content area
[pvh_video id="5283"]

[pvh_video id="5310"]
Important:

[pvh_video] without an id cannot know which video to display. Always replace 5283 with a real video ID from VideoHub -> All Videos.

[pvh_categories] Shortcode

Displays VideoHub categories as a grid, list, or pill-style navigation. This is useful for browse pages and category directories.

Usage
[pvh_categories]

Parameters

ParameterDescriptionDefault
countMaximum number of categories. Use 0 for all.0
hide_emptyHide categories without published videos. Use true or false.true
styleDisplay style. Supported values: grid, list, pills.grid
columnsNumber of columns for grid output.4
show_countShow video counts next to categories. Use true or false.true
Examples
[pvh_categories style="pills" show_count="false"]
[pvh_categories count="12" columns="3"]

Real-World Examples

Simple category directory
[pvh_categories]
Horizontal category pills above a video grid
[pvh_categories style="pills" hide_empty="true" show_count="true"]
Show all categories, even empty ones
[pvh_categories hide_empty="false" columns="4"]

[pvh_playlist] Shortcode

Displays one playlist by playlist post ID. Depending on the style, it can render a grid, list, or player-focused playlist view.

Usage
[pvh_playlist id="123"]

Parameters

ParameterDescriptionDefault
idPlaylist post ID. Required.0
styleDisplay style. Supported values: grid, list, player.grid
columnsNumber of columns for grid output.4
autoplayRequest autoplay for the playlist player where supported.false
Examples
[pvh_playlist id="123" style="player"]
[pvh_playlist id="123" style="grid" columns="3"]

Real-World Examples

Use this shortcode when you want to create a page for a course, video series, event replay list, or curated collection.

Embed a playlist with the player layout
[pvh_playlist id="5310" style="player"]
Show a playlist as a compact grid
[pvh_playlist id="5310" style="grid" columns="3"]
Show a playlist as a simple list
[pvh_playlist id="5310" style="list"]
Tip
Playlist ID is different from video ID

Find playlist IDs in VideoHub -> Playlists. A playlist shortcode needs the playlist post ID, not the first video ID inside that playlist.

[pvh_channel] Shortcode

In the core plugin, this displays videos by a specific WordPress author ID. When the PVH Channels addon is active, the same shortcode is handled by the Channels addon and can display a full channel by channel ID or slug.

Core Usage

Author video section
[pvh_channel author="1" count="12" columns="4"]
ParameterDescriptionDefault
authorWordPress user ID. Required in the core author-video mode.0
countNumber of author videos to show.12
columnsGrid columns.4
show_headerShow the author header where the template supports it.true

Channels Addon Usage

Full channel output
[pvh_channel id="123"]
[pvh_channel slug="my-channel"]

Real-World Examples

Core: show videos uploaded by WordPress user ID 7
[pvh_channel author="7" count="12" columns="3"]
Channels addon: show a channel by slug
[pvh_channel slug="websehri"]
Channels addon: show a channel by channel post ID
[pvh_channel id="6281"]

[pvh_latest] Shortcode

Displays the newest published videos. Use it for compact recent-upload sections on normal pages.

Usage
[pvh_latest count="8" columns="4" title="Latest Videos"]
ParameterDescriptionDefault
countNumber of videos to show.8
columnsGrid columns.4
titleOptional section title. Leave empty to hide the heading.Latest Videos

Real-World Examples

Latest videos block for a sidebar or page section
[pvh_latest count="6" columns="2" title="New Videos"]
Latest 12 videos in a 4-column grid
[pvh_latest count="12" columns="4" title="Latest Uploads"]

Official Addon Shortcodes

The following shortcodes are registered by official VideoHub addons. They are available only when the related addon is installed, licensed where required, and active from VideoHub -> Addons.

PVH Auth

ShortcodeWhat it doesExample or attributes
[pvh_login_form]Displays the login form. Logged-in users see an already-logged-in message.[pvh_login_form]
[pvh_register_form]Displays the registration form when registration is enabled.[pvh_register_form]
[pvh_profile]Displays the current user's profile area. Guests are asked to log in.[pvh_profile]
[pvh_user_menu]Displays the Auth addon user menu.[pvh_user_menu]
[pvh_login_link]Outputs a login modal trigger. Logged-in users see a profile link instead.text, class, icon, logged_in_text
[pvh_register_link]Outputs a register modal trigger. Logged-in users see a profile link instead.text, class, icon, logged_in_text
PVH Auth Examples
[pvh_login_link text="Login"]
[pvh_register_link]Create account[/pvh_register_link]

PVH Auth Real-World Examples

Add login and register buttons to a landing page
[pvh_login_link text="Login" class="button"]
[pvh_register_link text="Create Account" class="button button-primary"]
Create a dedicated login page
[pvh_login_form]
Create a member profile page
[pvh_profile]

PVH Community

ShortcodeWhat it doesExample or attributes
[pvh_community]Displays the global Community feed.limit, title
[pvh_community_feed]Displays the feed. Use user_id for one member's wall.user_id, limit, title
[pvh_community_messages]Displays the private messages surface.Requires logged-in users.
[pvh_community_notifications]Displays the current member's notifications.Requires logged-in users.
PVH Community Examples
[pvh_community limit="12" title="Community"]
[pvh_community_feed user_id="15" limit="8" title="Creator Updates"]
[pvh_community_messages]
[pvh_community_notifications]

PVH Community Real-World Examples

Create a community home page
[pvh_community limit="12" title="Community Wall"]
Show one creator's wall inside a profile page
[pvh_community_feed user_id="42" limit="6" title="Latest Posts"]

PVH Community requires PVH Auth. Its CSS and JavaScript load only on configured Community pages or pages containing these shortcodes.

PVH Channels

ShortcodeWhat it doesParameters
[pvh_channel]Displays a full channel by ID or slug.id, slug
[pvh_channels_list]Displays a channel directory.limit default 12, orderby default subscribers, order default DESC
[pvh_create_channel]Displays the create-channel form.No public attributes.
PVH Channels Examples
[pvh_channel slug="websehri"]
[pvh_channels_list limit="24" orderby="subscribers"]
[pvh_create_channel]

PVH Channels Real-World Examples

Create a public channels directory
[pvh_channels_list limit="24" orderby="subscribers" order="DESC"]
Create a page where users can open their channel
[pvh_create_channel]
Embed one specific channel inside a page
[pvh_channel slug="polanger"]

PVH Uploads

ShortcodeWhat it doesNotes
[pvh_upload_form]Displays the frontend video upload and edit form.Requires the visitor to be logged in and allowed to upload.

PVH Uploads Real-World Examples

Create a frontend upload page
[pvh_upload_form]

Place this shortcode on a page named "Upload Video" or "Submit Video". Logged-out visitors will see a login-required message. Users who reached their upload limit will see a permission or limit message instead of the form.

PVH Shorts

ShortcodeWhat it doesParameters
[pvh_shorts]Displays a shorts feed.count default 10, category, orderby default date, order default DESC
[pvh_shorts_carousel]Displays a horizontal shorts carousel.count default 8, title default Shorts
PVH Shorts Examples
[pvh_shorts count="12" category="game"]
[pvh_shorts_carousel count="8" title="Shorts"]

PVH Shorts Real-World Examples

Add a Shorts carousel to the homepage
[pvh_shorts_carousel count="8" title="Shorts"]
Create a dedicated Shorts feed page
[pvh_shorts count="20" orderby="date" order="DESC"]
Show only shorts from one category
[pvh_shorts category="music" count="12"]

Live Streaming

ShortcodeWhat it doesParameters
[pvh_live_streams]Displays a grid of live streams.status, limit default 12, columns default 3, orderby default date, order default DESC
[pvh_live_streams_carousel]Displays the homepage-style live streams carousel.count default 8, limit optional alias for count
[pvh_live_stream]Displays a single live stream player.id required
Live Streaming Examples
[pvh_live_streams status="live" limit="6" columns="3"]
[pvh_live_streams_carousel count="8"]
[pvh_live_stream id="123"]

Live Streaming Real-World Examples

Create a live streams archive page
[pvh_live_streams limit="12" columns="3"]
Show only currently live broadcasts
[pvh_live_streams status="live" limit="6" columns="3"]
Add live stream carousel to a landing page
[pvh_live_streams_carousel count="8"]
Embed one live stream player by ID
[pvh_live_stream id="7421"]

Official Addons Without Public Shortcodes

Some addons work through hooks, settings, automatic UI, or background integrations rather than standalone shortcodes. At the time of this documentation, PVH Comments, PVH Reactions, PVH Ads, Premium Content, Marketplace, Media Optimizer, Live Chat, Navigation Panel, and Progressive Web App do not register public shortcodes.

Legacy Compatibility Aliases

VideoHub keeps older pvhl_ shortcodes working for existing sites. New pages should use the pvh_ shortcodes above unless you are maintaining old content.

Legacy aliasCurrent shortcode or behavior
[pvhl_home]Alias of [pvh_home]
[pvhl_videos]Alias of [pvh_videos]
[pvhl_video]Alias of [pvh_video]
[pvhl_categories]Alias of [pvh_categories]
[pvhl_playlist]Alias of [pvh_playlist]
[pvhl_playlists]Legacy playlist grid. Supports count, columns, orderby, and order.
[pvh_playlists]Historical playlist grid registration from the older public class. The active shortcode loader uses [pvhl_playlists] for legacy playlist grids and [pvh_playlist id="123"] for a single playlist.
[pvhl_channel]Alias of the core [pvh_channel] author-video behavior.
[pvhl_trending]Alias of [pvh_trending]
[pvhl_latest]Alias of [pvh_latest]
[pvhl_search]Alias of [pvh_search] when PVH Search is active.
Developer note:

The old public class contains historical shortcode registration code, but the active shortcode loader is Polanger_VideoHub_Shortcodes::register(). Document new implementations against the active pvh_ shortcode surface.

PVH Shorts Addon

Vertical short-form video support with a fullscreen swipe player.

PVH
Optional official paid addon

PVH Shorts is an optional addon. After installing and activating it, go to VideoHub -> Shorts. The free core continues to work without this addon.

Features

  • Vertical video format (9:16 aspect ratio)
  • Fullscreen swipe navigation
  • Auto-loop playback
  • Touch-friendly mobile interface
  • Shorts carousel on homepage
  • Dedicated Shorts archive page
  • Featured & Trending Shorts sections
  • Maximum duration: 60 seconds

Adding a Short

  1. Go to VideoHub → Shorts → Add New
  2. Enter the short title
  3. Paste the vertical video URL
  4. Click "Fetch Info"
  5. Publish

Shortcode

Shorts Carousel
[pvh_shorts_carousel count="8" title="Shorts"]

Shorts Archive URL

Default: yoursite.com/shorts/

PVH Reactions

Add engagement features to your videos.

Core
Included in the free core

PVH Reactions is bundled with the WordPress.org core package and does not require a paid addon.

Features

  • Like button with count
  • Dislike button with count
  • Share button (copy link, social sharing)
  • Report video functionality
  • AJAX-powered (no page reload)
  • Works for guests and logged-in users
  • Cookie-based tracking for guests

Display

Reactions are automatically displayed below the video player on single video pages.

PVH Comments

Advanced commenting system for videos.

Core
Included in the free core

PVH Comments is bundled with the WordPress.org core package and uses WordPress discussion settings where appropriate.

Features

  • Threaded replies (up to 2 levels deep)
  • Comment voting (upvote/downvote)
  • @mentions support with autocomplete
  • Sort by: Newest, Oldest, Top Comments
  • Lazy loading for performance
  • Real-time comment count
  • Admin moderation tools
  • Spam protection

Settings

  • Comments Per Page - Default: 10
  • Reply Depth - Maximum: 2 levels
  • Guest Comments - Enable/disable
  • Moderation - Auto-approve or manual

PVH Auth Addon

Complete frontend authentication system with custom login, register, and profile pages. Transform your video platform into a full membership site.

🔐
Optional official bundle addon

PVH Auth is part of the User & Community bundle and is required for PVH Community, PVH Channels, and PVH Uploads.

Features

  • Custom Login Page - Modern, styled login form at /login/
  • Custom Register Page - User registration with customizable fields at /register/
  • User Profile Page - Public profile pages at /profile/{username}/
  • Profile Editing - Users can edit their profile, avatar, and cover image
  • User Dropdown Menu - Header dropdown with user actions
  • Avatar Upload - Custom profile picture upload
  • Cover Image - Profile banner/cover image support
  • Social Links - Add social media links to profile
  • Bio/About Section - User biography field
  • Profile Tabs - Extensible tab system for profile sections

Registration Fields

Configure which fields are required during registration:

Field Default Configurable
Username Required Always required
Email Required Always required
Password Required Always required
First Name Optional Yes
Last Name Optional Yes
Phone Number Optional Yes
Country Optional Yes
City Optional Yes
Birth Date Optional Yes

URLs

  • /login/ - Login page
  • /register/ - Registration page
  • /profile/{username}/ - User profile page
  • /my-account/ - Account settings (redirects to profile)

Settings Location

Go to VideoHub → Settings → Auth to configure:

  • Enable/disable registration
  • Required registration fields
  • Email verification settings
  • Login redirect URL

Hooks for Developers

Available Hooks
// Add items to user dropdown menu
do_action( 'pvh_user_dropdown_menu_items', $user );

// Add tabs to profile page
add_filter( 'pvh_profile_tabs', function( $tabs, $user, $is_own_profile ) {
    $tabs['custom'] = 'Custom Tab';
    return $tabs;
}, 10, 3 );

// Add content to profile tab
do_action( 'pvh_profile_tab_content_{tab_slug}', $profile_user, $is_own_profile );

// Add buttons to profile header
do_action( 'pvh_profile_header_actions', $profile_user );

PVH Community Addon

PVH Community adds a social layer to VideoHub with creator walls, a global community feed, follows, private messaging, notifications, reports, and moderation-ready data structures.

👥
Single addon, modular internals

PVH Community is a new official addon included in the User & Community bundle with PVH Auth, PVH Channels, and PVH Uploads. Internally, wall posts, follows, messages, notifications, reports, permissions, REST routes, and assets are separated into their own files so the system can grow without becoming difficult to maintain.

🔐
Requires PVH Auth

PVH Community depends on PVH Auth because community actions need logged-in users, profile identity, avatars, and safe member context. If PVH Auth is not active, Community feature classes and REST routes do not load.

Feature Modules

  • Global Wall - A site-wide feed where members can publish community posts.
  • Profile Walls - User or creator-specific posts that can later be shown inside profile/channel experiences.
  • Follow System - Follow users or channels using dedicated indexed tables.
  • Private Messaging - Direct conversations with membership checks and rate limits.
  • Notifications - Lightweight records for messages, reactions, follows, and future community events.
  • Reports & Moderation Foundation - Report records are stored separately so moderation screens can be expanded without changing the core data model.

Performance Model

Community activity can grow much faster than normal WordPress content. For that reason, PVH Community stores high-volume social data in dedicated tables instead of overloading postmeta. Feed, follows, messages, notifications, and reports each have indexes designed for their main lookup patterns.

  • Frontend assets load only on Community shortcodes or configured Community pages.
  • Video pages do not receive Community JavaScript or CSS unless a Community surface is actually present.
  • REST write actions use rate limiting for posts, comments, reactions, follows, and private messages.
  • Feeds are cursor-based and bounded, avoiding large unpaged queries.

Shortcodes

Shortcode What it does Example
[pvh_community] Displays the global community feed with composer and load more controls. [pvh_community limit="12"]
[pvh_community_feed] Displays the community feed. Use user_id to show one member's wall. [pvh_community_feed user_id="15" limit="8"]
[pvh_community_messages] Displays the private messages surface for logged-in users. [pvh_community_messages]
[pvh_community_notifications] Displays member notifications. [pvh_community_notifications]

Settings Location

Go to VideoHub → Settings → Community to configure Community pages, enabled modules, feed size, message fetch limits, and rate limits.

PVH Channels Addon

Channel system allowing users to create their own public presence, customize branding, and build subscriber bases.

📺
Requires PVH Auth

This addon requires the PVH Auth addon to be active for user management. It is sold with PVH Auth, PVH Community, and PVH Uploads as the User & Community bundle.

Features

  • Channel Creation - Users can create their own channels
  • Channel Customization - Custom banner, avatar, description
  • Channel Handle - Unique @handle for each channel
  • Subscriber System - Users can subscribe to channels
  • Subscriber Count - Display subscriber numbers
  • Channel Tabs - Videos, About, Playlists sections
  • Social Links - Website, YouTube, Twitter, Instagram, TikTok
  • Channel Visibility - Public, Unlisted, or Private channels
  • Admin Approval - Optional channel approval workflow
  • Multiple Channels - Allow users to create multiple channels

Channel Page Sections

Tab Content
Videos All videos uploaded to this channel
About Channel description, stats, social links, join date
Playlists Channel's video playlists (if available)

URLs

  • /channel/{channel-slug}/ - Channel page
  • /create-channel/ - Create new channel
  • /edit-channel/{channel-id}/ - Edit channel

Settings Location

Go to VideoHub → Settings → Channels to configure:

  • Channel Slug - URL prefix for channels
  • Allow Multiple Channels - Let users create more than one channel
  • Max Channels Per User - Limit number of channels
  • Require Approval - Admin must approve new channels
  • Default Visibility - Public, Unlisted, or Private
  • Enable Subscriptions - Allow channel subscriptions

Admin Management

Go to VideoHub → Channels to:

  • View all channels
  • Filter by status (Published, Pending, Suspended)
  • Approve or reject pending channels
  • Suspend channels that violate policies
  • View channel statistics

Channel Visibility Options

Visibility Description
Public Anyone can find and view the channel
Unlisted Only accessible via direct link
Private Only the owner can view

PVH Uploads Addon

Allow users to upload their own videos directly from the frontend. Complete video upload system with progress tracking, thumbnail selection, and video management.

📤
Requires PVH Auth

This addon requires the PVH Auth addon to be active for user authentication. It is sold with PVH Auth, PVH Community, and PVH Channels as the User & Community bundle.

Features

  • Drag & Drop Upload - Modern upload interface with drag and drop
  • Progress Tracking - Real-time upload progress bar
  • Video Details Form - Title, description, category, tags
  • Thumbnail Upload - Custom thumbnail selection
  • Visibility Options - Public, Unlisted, or Private videos
  • Upload Limits - Daily and monthly upload quotas
  • File Size Limits - Configurable maximum file size
  • Format Restrictions - Control allowed video formats
  • Role-Based Access - Control which user roles can upload
  • Moderation - Optional approval workflow for uploads
  • Duplicate Prevention - Prevents accidental double uploads

Upload Page Layout

The upload page features a guided multi-step publishing interface:

  • Left Panel - Upload dropzone with drag & drop
  • Right Panel - Upload quota, tips, user info
  • Progress View - Shows during upload with percentage
  • Edit Page - Video details form after upload

URLs

  • /upload/ - Video upload page
  • /upload/edit/{video-id}/ - Edit uploaded video details

Settings Location

Go to VideoHub → Settings → Uploads to configure:

  • Maximum File Size - Max upload size in MB (default: 500MB)
  • Daily Upload Limit - Max uploads per day (default: 10)
  • Monthly Upload Limit - Max uploads per month (default: 100)
  • Max Title Length - Character limit for titles
  • Allowed Formats - MP4, WEBM, MOV, AVI, MKV, WMV, FLV, M4V
  • Allowed User Roles - Which roles can upload videos
  • Require Approval - Videos need admin approval before publishing

Video Status Flow

Status Description Visibility
Pending Awaiting admin approval Only owner and admins can view
Published Approved and live Based on visibility setting
Draft/Suspended Removed or suspended by admin Only owner can view with warning

Pending Video Messages

When a video is pending or suspended:

  • For Visitors - "This video is currently under review" message
  • For Owner - Yellow/red banner showing status and reason
  • Suspended Videos - Shows suspension reason if provided by admin

Upload Button Locations

The upload button appears in multiple locations:

  • User dropdown menu
  • Profile header (own profile only)
  • Header actions area
⚠️
Server Configuration

Make sure your server's upload_max_filesize and post_max_size PHP settings are configured to allow large video uploads.

Premium Content Addon

Sell individual videos through WooCommerce integration. Monetize your video content with pay-per-view functionality.

💰
Requires WooCommerce

This addon requires WooCommerce to be installed and activated for payment processing.

Features

  • Pay-Per-View - Sell individual videos at custom prices
  • Preview System - Allow users to preview videos before purchase
  • Access Control - Automatic access management after purchase
  • Premium Badge - Visual indicator on premium video cards
  • WooCommerce Integration - Seamless checkout experience
  • My Account Tab - Users can view purchased videos
  • Order Management - Track video purchases in WooCommerce orders
  • Refund Handling - Automatic access revocation on refund

Setting Up Premium Videos

  1. Go to VideoHub → Videos
  2. Edit a video or create a new one
  3. Find the Premium Content Settings meta box
  4. Check "Mark as Premium"
  5. Set the Price (e.g., $9.99)
  6. Set Preview Duration in seconds (0 = no preview)
  7. Publish/Update the video

How It Works

User Type Experience
Non-Purchaser Sees preview (if enabled) or locked content with price and purchase button
Purchaser Full video access with "You own this video" badge
Guest Redirected to login when clicking purchase button

Premium Video Settings

  • Price - Set any price in your WooCommerce currency
  • Preview Duration - Seconds of free preview (0 to disable)

User Purchase Flow

  1. User visits premium video page
  2. Sees preview or locked content with price
  3. Clicks "Buy Now" button
  4. Video added to WooCommerce cart
  5. Completes checkout
  6. Instant access granted
  7. Video appears in My Account → Purchased Videos
Auto-Complete Orders

Video-only orders are automatically marked as completed, granting instant access.

Live Streaming Addon

Create and sell live streams from supported providers including YouTube, Twitch, Vimeo, and Dailymotion. Offer free or paid access to real-time broadcasts, scheduled events, and stream replays.

🔴
Multi-platform live stream integration

Embed supported live stream URLs and manage them inside VideoHub. WooCommerce is optional - only required for selling paid streams.

Key Features

  • Supported Providers - Embed supported YouTube, Twitch, Vimeo, and Dailymotion stream URLs
  • Scheduled Streams - Set start date/time for upcoming broadcasts
  • Live Status Indicator - Automatic "LIVE" badge when streaming
  • Paid Streams - Sell access to exclusive live content
  • Free Streams - Offer free broadcasts to all visitors
  • Stream Archive - Keep streams accessible after they end
  • Homepage Integration - Live streams section on homepage
  • Category Support - Organize streams with VideoHub categories

Creating a Live Stream

  1. Go to VideoHub → Live Streams → Add New
  2. Enter the Stream Title
  3. Add a Description for your stream
  4. Set a Featured Image (thumbnail)
  5. In the Stream Settings meta box:
    • Paste your supported stream URL, such as YouTube, Twitch, Vimeo, or Dailymotion
    • Set Stream Status (Upcoming, Live, or Ended)
    • Set Scheduled Date/Time for upcoming streams
  6. Publish the stream

Stream Status Types

Status Display Description
Upcoming Blue "Upcoming" badge with countdown Stream is scheduled but not yet live
Live Red pulsing "LIVE" badge Stream is currently broadcasting
Ended Gray "Ended" badge Stream has finished (can still be viewed if recorded)

Making a Stream Premium (Paid)

  1. Edit your live stream
  2. Find the Premium Settings meta box
  3. Check "This is a Premium Stream"
  4. Set the Price (e.g., $19.99)
  5. Update the stream
⚠️
WooCommerce Required for Paid Streams

To sell paid live streams, WooCommerce must be installed and activated.

Homepage Live Streams Section

When the Live Streaming addon is active, a "Live Streams" section automatically appears on your homepage (if using [pvh_home] shortcode). This section:

  • Shows currently live streams with priority
  • Displays upcoming scheduled streams
  • Has a special red glow effect when streams are live
  • Links to the full streams archive via "See All"

PVH PWA (Progressive Web App)

Transform VideoHub into an installable mobile app. Users can add your video platform to their home screen and enjoy an app-like experience with offline support.

📱
App-Like Experience

PWA allows users to install your video site as a standalone app on their mobile devices, providing faster access and a native app feel.

Key Features

  • Installable App - Users can add to home screen on iOS and Android
  • Offline Fallback - Shows a friendly offline page when no connection
  • Custom Branding - Set your own app name, icons, and theme colors
  • Standalone Mode - Runs without browser UI for true app experience
  • Install Prompt - Smart banner prompts users to install the app
  • iOS Support - Special handling for Safari on iOS devices
  • Hide Header/Footer - Option to hide theme elements in PWA mode
  • Scope Control - Limit PWA to VideoHub pages only

Configuration

PWA settings are located in VideoHub → Settings → Mobile tab:

Setting Description
Enable PWA Turn the Progressive Web App feature on or off
App Name Full application name shown in app stores and install dialogs
Short Name Name displayed on home screen (max 12 characters)
App Icons 192x192 and 512x512 PNG icons for different devices
Start URL Page that opens when app is launched (e.g., /videos/)
App Scope URL path that defines PWA boundaries
Theme Color Browser toolbar color on mobile devices
Background Color Splash screen background when app launches
Hide Header/Footer Remove theme header/footer in standalone PWA mode

Icon Requirements

  • 192x192 PNG - Required for Android devices
  • 512x512 PNG - Required for splash screens and app stores
  • Icons should be square with transparent or solid background
  • Use your brand logo or a recognizable icon

How It Works

  1. PWA generates a dynamic manifest.json via REST API
  2. A Service Worker is registered for the specified scope
  3. Users see an install prompt when visiting VideoHub pages
  4. After installation, the app runs in standalone mode
  5. Offline fallback page is shown when no internet connection
⚠️
HTTPS Required

PWA features require your site to be served over HTTPS. Service Workers will not register on non-secure origins.

PVH Live Chat

Add real-time chat functionality to your videos and live streams. Users can interact with each other and content creators during video playback.

💬
Video sidebar chat

Professional chat panel that appears beside videos and live streams, with adaptive polling to reduce server load.

Key Features

  • Adaptive Polling - Smart refresh rates (3s active, 10s slow, 25s idle)
  • Typing Indicators - See when others are typing
  • Rate Limiting - Prevent spam with user + IP based limits
  • Permission System - Restrict chat to purchasers for premium content
  • Message Moderation - Authors, admins, and content owners can delete messages
  • XSS Protection - Secure message sanitization pipeline
  • Cache Layer - Object Cache + Transient fallback for performance
  • Audit Trail - Soft delete with deleted_at and deleted_by tracking
  • Profanity filter - Blocklist in Chat settings; viewers see a standard notice; only administrators see original text
  • Transport Interface - Ready for future WebSocket/Pusher upgrade

Configuration

Live Chat settings are located in VideoHub → Settings → Chat tab:

Setting Description
Enable on Live Streams Show chat panel on live stream pages
Premium Live Streams Only Restrict chat to users who purchased the live stream
Enable on Premium Videos Show chat on premium videos (purchasers only)
Polling Interval (Active) Refresh rate when chat is active (default: 3000ms)
Polling Interval (Slow) Refresh rate when chat is slow (default: 10000ms)
Polling Interval (Idle) Refresh rate when chat is idle (default: 25000ms)
Rate Limit Seconds between messages per user (default: 3)
Max Message Length Maximum characters per message (default: 500)
Messages Per Fetch Number of messages to load and cache (default: 50)

Profanity filter (addon v1.0.2+)

At the bottom of the Chat settings tab, the Profanity filter section lets you maintain a blocklist of words or phrases. Messages are stored unchanged in the database; filtering is applied when messages are displayed.

  • Blocked words or phrases — Multi-line textarea: one term per line, or comma-separated entries. Each line is limited to 80 characters. Saved in option pvh_live_chat_settings as profanity_blocklist (sanitized with sanitize_textarea_field).
  • Matching — Case-insensitive substring search per term. If mb_stripos is available, matching is UTF-8 safe.
  • What viewers see — If a message matches the blocklist, other users and guests see the English placeholder (translatable via __()): "This message has been hidden because its content does not meet our community standards." Filtered rows use message_filtered: true and the pvh-chat-message-filtered CSS class (muted/italic styling).
  • Who sees the original text — Only users with the manage_options capability (typically site administrators) see the unfiltered message. The message author sees the same placeholder as everyone else.
  • Performance — Message cache stores raw rows; formatting (including profanity filtering and delete permissions) runs per request so the correct text is shown for each viewer. Cache key _messages_v2 replaces older cached formats.

REST API Endpoints

Live Chat provides the following REST API endpoints:

  • GET /wp-json/pvh-chat/v1/fetch - Fetch messages (with after_id for incremental)
  • POST /wp-json/pvh-chat/v1/send - Send a new message
  • POST /wp-json/pvh-chat/v1/typing - Set typing indicator
  • DELETE /wp-json/pvh-chat/v1/delete/{id} - Delete a message

Database Tables

Live Chat creates two database tables:

  • wp_pvh_chat_rooms - Chat rooms linked to videos/streams
  • wp_pvh_chat_messages - Chat messages with optimized indexes

Hooks & Filters

// Customize message sanitization
add_filter( 'pvh_chat_sanitize_message', function( $message ) {
    // Add profanity filter, etc.
    return $message;
});

// Override transport (for a future WebSocket addon)
add_filter( 'pvh_chat_transport', function( $transport, $addon ) {
    return new My_WebSocket_Transport( $addon );
}, 10, 2 );
⚠️
Uninstall Behavior

By default, chat data is preserved when deactivating. To delete all data on uninstall, enable "Delete data on uninstall" option in settings.

PVH Marketplace

Transform your video platform into a multi-vendor marketplace where creators can sell videos and earn money.

🏪
Complete Vendor Ecosystem

A full-featured marketplace system with earnings tracking, commission management, withdrawal requests, and payout processing - everything you need to run a video sales platform.

Key Features

  • Automatic Earnings - Commission calculated automatically on each sale
  • Configurable Commission - Set platform commission rate (e.g., 20%)
  • Holding Period - Earnings held for configurable days before available
  • Vendor Payout Profiles - Bank name, IBAN, SWIFT/BIC, country
  • Withdrawal Requests - Vendors request payouts when balance is available
  • Admin Approval Workflow - Approve, reject, or mark withdrawals as paid
  • Minimum Withdrawal - Set minimum amount for withdrawal requests
  • Refund Protection - Handles refunds for withdrawn earnings
  • WooCommerce Integration - Works seamlessly with Premium Content addon

How It Works

📊
Earnings Flow
  1. Sale: Customer purchases a premium video
  2. Earning Created: System calculates vendor's share (e.g., 80%)
  3. Holding Period: Earning stays "pending" for X days
  4. Available: After holding period, earning becomes available
  5. Withdrawal: Vendor requests withdrawal when minimum reached
  6. Payout: Admin approves and marks as paid

Admin Dashboard

The Marketplace admin panel provides comprehensive management tools:

📊 Dashboard Tab

  • Quick Stats: Pending withdrawals, pending earnings, total paid out, commission rate
  • Sales Chart: Visual bar chart with Week/Month/Year filters
  • Top Vendors: Leaderboard of best-selling vendors (20 items)
  • Top Videos: Leaderboard of best-selling videos (20 items)
  • Clickable Cards: Quick navigation to pending items

💰 Earnings Tab

  • Status Filters: All, Pending, Available, Withdrawn, Refunded
  • Pending Alert: Warning banner when earnings are waiting
  • Quick Actions: Release button to make pending earnings available immediately
  • Vendor Filter: Filter earnings by specific vendor

💸 Withdrawals Tab

  • Status Filters: All, Pending, Approved, Paid, Rejected
  • Pending Alert: Red warning when withdrawals need attention
  • Action Buttons: Approve, Reject, Mark as Paid
  • Payout Details: View vendor's bank information
  • Earnings Snapshot: See which earnings are included in withdrawal

👥 Vendors Tab

  • Profile Status: Active, Incomplete, Pending
  • Payout Information: Bank details for each vendor
  • Quick Stats: Total earnings per vendor

Vendor Experience

Vendors access their marketplace features through WooCommerce My Account:

Earnings Page

  • View all earnings with status (Pending, Available, Withdrawn)
  • See holding period countdown for pending earnings
  • Track total available balance

Withdrawals Page

  • Request new withdrawal (when minimum reached)
  • View withdrawal history and status
  • Track pending, approved, and paid withdrawals

Payout Profile Page

  • Enter bank account details
  • IBAN and SWIFT/BIC support
  • Country selection
  • Profile must be complete before requesting withdrawals

Configuration

Marketplace settings are located in VideoHub → Settings → Marketplace tab:

Setting Description Default
Commission Rate Platform commission percentage on each sale 20%
Minimum Withdrawal Minimum balance required to request withdrawal $50
Holding Period Days before pending earnings become available 14 days

Database Tables

Marketplace creates three database tables:

  • wp_pvh_marketplace_earnings - Vendor earnings from video sales
  • wp_pvh_marketplace_withdrawals - Withdrawal requests and history
  • wp_pvh_marketplace_vendor_profiles - Vendor payout information

Hooks & Filters

Marketplace provides comprehensive hooks for customization:

// Notify vendor when earning is created
add_action( 'pvh_marketplace_earning_created', function( $earning_id, $data ) {
    $vendor = get_userdata( $data['vendor_id'] );
    wp_mail( $vendor->user_email, 'New Sale!', 
        'You earned $' . $data['net_amount'] . ' from a video sale.' );
}, 10, 2 );

// Track withdrawals for accounting
add_action( 'pvh_marketplace_withdrawal_paid', function( $withdrawal_id, $withdrawal ) {
    // Log to external accounting system
    my_accounting_log( 'payout', $withdrawal->amount, $withdrawal->vendor_id );
}, 10, 2 );

// Custom notification on withdrawal rejection
add_action( 'pvh_marketplace_withdrawal_rejected', function( $withdrawal_id, $withdrawal ) {
    // Send custom rejection email
}, 10, 2 );

Available Hooks

Hook Type Description
pvh_marketplace_earning_created Action After earning record created
pvh_marketplace_earning_status_changed Action After earning status changes
pvh_marketplace_withdrawal_created Action After withdrawal request created
pvh_marketplace_withdrawal_paid Action After withdrawal marked as paid
pvh_marketplace_withdrawal_rejected Action After withdrawal rejected
pvh_marketplace_earnings_released Action After pending earnings released by cron
pvh_marketplace_vendor_profile_saved Action After vendor payout profile saved
⚠️
Important: Manual Payouts

This addon does NOT transfer money automatically. After marking a withdrawal as "Paid", you must manually send the payment to the vendor via bank transfer, PayPal, or your preferred method.

Requirements

  • WooCommerce: Required for payment processing
  • Premium Content Addon: Required for video sales functionality

Navigation Panel Addon

Modern collapsible sidebar navigation panel for a professional video platform experience.

🎯
Video Platform Navigation

A familiar sidebar navigation experience for video sites. It supports a brand/logo area, fixed system links, customizable menu items, video categories, user subscriptions, and mobile drawer behavior.

Key Features

  • Collapsible Sidebar - Expand/collapse with smooth animations
  • Brand Logo Area - Optional image logo or text logo fallback at the top of the panel
  • Customizable Menu Items - Home, Subscriptions, Library, History, Liked Videos, My Videos, My Channel, and custom links
  • Dedicated Explore Page - A discovery surface for new videos, channels, shorts, premium videos, and popular comments
  • Video Categories - Automatically displays categories with video count badges
  • User Subscriptions - Shows subscribed channels with avatars and a helpful empty state (requires Channels addon)
  • Logged-in Visibility Rules - Personal links such as Subscriptions, Library, History, Liked Videos, My Videos, and My Channel are hidden from guests
  • Panel Position - Left or right side positioning
  • Adjustable Width - Configure expanded and collapsed widths
  • Mobile Drawer - Full-screen drawer for mobile devices
  • Dark Mode Support - Automatic theme detection
  • Lucide Icons - Beautiful, consistent iconography

Configuration

Navigate to VideoHub → Settings → Navigation to configure:

Setting Description Default
Enable Panel Show/hide the navigation panel Enabled
Panel Position Left or right side of the screen Left
Panel Width Width when expanded (px) 240px
Collapsed Width Width when collapsed (px) 72px
Default Collapsed Start in collapsed state No
Show Categories Display video categories section Yes
Categories Limit Maximum categories to display 10
Show Logo Display a logo area at the top of the navigation panel Disabled
Logo Image Optional uploaded image used as the panel logo Empty
Logo Alt Text Image alt text, or a text logo fallback when no image is selected Empty
Logo Size and Padding Desktop width, mobile width, and top/right/bottom/left spacing 150px width with safe default padding
Explore Items Per Section Maximum number of cards shown in each Explore section 6
Explore Sections Enable or disable New Videos, Channels, New Shorts, Premium Videos, and Popular Comments Enabled when available

Logo Area

The logo area is optional. When Show Logo is enabled, the panel displays the uploaded logo image if one is selected. If no image is selected but Logo Alt Text contains text, that text is shown as a clean text logo. If both fields are empty, the logo area is not rendered.

  • Logo Image - Best for brand marks or horizontal logos.
  • Logo Alt Text - Used for accessibility and as the text-logo fallback.
  • Logo Link URL - Leave empty to link to the site homepage, or enter a custom destination.
  • Logo Size - Set separate desktop and mobile widths.
  • Logo Padding - Control top, right, bottom, and left spacing inside the drawer/panel.

Explore Page

The Navigation Panel addon creates a dedicated /explore/ page. The Explore menu link is a fixed system item that appears directly below Home on the frontend. It is not managed from the regular Menu Items list, because the page has its own settings and addon-aware visibility rules.

Explore Section Requires Behavior
New Videos VideoHub core Shows the newest published videos, limited to 6 items by default.
Channels PVH Channels Shows newest public channels. Hidden automatically when the Channels addon is inactive.
New Shorts PVH Shorts Shows newest shorts. Hidden automatically when the Shorts addon is inactive.
Premium Videos Premium Content Shows newest videos marked as paid content. Hidden automatically when Premium Content is inactive.
Popular Comments PVH Comments Shows up to 6 comments from the last 7 days, sorted by likes first and then newest comments to avoid empty sections.
i
Addon-aware rendering

Explore sections only render when their related addon is active and the section is enabled in VideoHub -> Settings -> Navigation. Inactive addon sections do not output empty markup on the frontend.

Menu Items

Most menu items can be individually enabled/disabled and customized. The Explore item is handled separately as a fixed system link below Home.

  • Home - Link to homepage
  • Subscriptions - User's subscribed channels feed (login required)
  • Library - User's video library (login required)
  • History - Watch history (login required)
  • Liked Videos - User's liked videos (login required)
  • My Videos - User's uploaded videos (login required)
  • My Channel - User's channel page (login required)

Use Add Custom Menu Item to add your own links to pages, products, carts, account pages, or external URLs. Custom items support a label, URL, icon, divider behavior, and optional new-tab behavior.

i
Subscriptions behavior

The Subscriptions menu item is only shown to logged-in users. If the user has no subscriptions yet, the subscriptions page should show a helpful empty state instead of a blank page, encouraging the user to explore channels.

Hooks & Filters

// Add custom items to navigation panel
add_action( 'pvh_nav_panel_after_items', function() {
    echo '<div class="pvh-nav-panel__custom">Custom Content</div>';
});

// Add content to panel footer
add_action( 'pvh_nav_panel_footer', function() {
    echo '<div class="pvh-nav-panel__footer-content">Footer</div>';
});

// Mobile drawer hooks
add_action( 'pvh_mobile_drawer_after_items', 'my_custom_drawer_content' );
add_action( 'pvh_mobile_drawer_footer', 'my_custom_drawer_footer' );

// Add custom content before or after the Explore page sections
add_action( 'pvh_navigation_panel_explore_before_sections', function( $nav_panel ) {
    echo '<div class="my-explore-banner">Featured discovery content</div>';
});

add_action( 'pvh_navigation_panel_explore_after_sections', function( $nav_panel, $sections_rendered ) {
    // Add addon-powered sections after the built-in Explore sections.
}, 10, 2 );

// Register addon-aware Explore section definitions
add_filter( 'pvh_navigation_panel_explore_section_definitions', function( $sections ) {
    $sections['my_addon_section'] = array(
        'label'       => 'My Addon Section',
        'description' => 'Shown only when my addon is active.',
        'setting_key' => 'explore_show_my_addon_section',
        'available'   => class_exists( 'My_Addon' ),
        'requires'    => 'my-addon',
    );

    return $sections;
});

CSS Classes

  • .pvh-nav-panel - Main panel container
  • .pvh-nav-panel--collapsed - Collapsed state
  • .pvh-nav-panel--left / .pvh-nav-panel--right - Position classes
  • .pvh-nav-panel__section - Section container (categories, subscriptions)
  • .pvh-nav-panel__logo - Logo/text-logo container
  • .pvh-navigation-explore - Explore page wrapper
  • .pvh-explore-section - Explore section card
  • .pvh-mobile-drawer - Mobile drawer container

PVH Ads Addon

Complete video monetization system with pre-roll, mid-roll, display, in-feed, and shorts ads with full analytics tracking.

💰
Monetize Your Video Platform

Turn your video platform into a revenue-generating machine with multiple ad formats. Support for AdSense, custom ad networks, or direct image ads with click tracking.

Key Features

  • Pre-roll Ads - Show ads before video playback with skip button
  • Mid-roll Ads - Show ads during video at configurable intervals
  • Display Ads - Above video, below video, and below comments positions
  • In-feed Ads - Inject ads between videos in grids and carousels
  • Shorts Ads - Full-screen ads between shorts while scrolling
  • Ad Statistics - Track impressions and clicks with daily breakdown
  • Premium User Support - Hide ads for users who purchased content
  • Role-Based Visibility - Hide all ad formats for selected WordPress user roles

Ad Types

Ad Type Description Recommended Size
Pre-roll Shows before video starts playing 640x360px (16:9)
Mid-roll Shows during video at intervals 640x360px (16:9)
Above Video Banner above video player 728x90px (Leaderboard)
Below Video Banner below video player 728x90px (Leaderboard)
Below Comments Banner below comments section 728x90px (Leaderboard)
In-feed Ads between video cards in grids 320x180px (16:9)
Shorts Full-screen ads between shorts 1080x1920px (9:16)

Video Provider Compatibility

⚠️
Important: Mid-roll Limitations

Mid-roll ads only work with self-hosted videos (MP4, WebM). YouTube and Vimeo embeds do not support mid-roll ads due to cross-origin iframe restrictions. For embed videos, use Pre-roll or Display ads instead.

Ad Format Self-hosted YouTube Vimeo
Pre-roll ✅ Supported ✅ Supported ✅ Supported
Mid-roll ✅ Supported ❌ Not Available ❌ Not Available
Display Ads ✅ Supported ✅ Supported ✅ Supported
In-feed Ads ✅ Supported ✅ Supported ✅ Supported
Shorts Ads ✅ Supported ✅ Supported ✅ Supported

Ad Content Options

Each ad slot supports two content types:

  • Ad Code (HTML) - Paste AdSense, ad network code, or custom HTML
  • Image + URL - Upload an image and set a click-through URL

Settings

Configure ads from VideoHub → Settings → Ads tab:

  • Pre-roll Skip After - Seconds before skip button appears (0 = no skip)
  • Mid-roll Interval - Show mid-roll every X seconds (minimum 15)
  • In-feed Interval - Show ad after every X videos in grids
  • Shorts Interval - Show ad after every X shorts
  • Hide for Premium - Hide all ads for users who purchased content
  • Hide Ads for User Roles - Select WordPress roles that should never see frontend ads

Role-Based Ad Visibility

PVH Ads can hide ads for selected WordPress roles from VideoHub → Settings → Ads → Audience Rules. This is useful when administrators, editors, moderators, instructors, vendors, members, or other trusted roles should browse the site without ads.

  • The role rule applies globally to all PVH Ads formats.
  • Selected roles will not see display ads, pre-roll ads, mid-roll ads, in-feed ads, or shorts ads.
  • Visitors who are not logged in do not have a WordPress role, so they continue to see ads unless another rule or custom hook hides them.
  • If a user has multiple roles, matching any selected hidden role is enough to hide ads for that user.

Statistics Dashboard

Access ad statistics from VideoHub → Ads:

  • Total impressions and clicks per ad slot
  • Click-through rate (CTR) calculation
  • Daily breakdown with date filtering
  • Revenue tracking (when integrated with ad networks)

Developer Hooks

Customize ad behavior with these hooks:

// Filter whether to show ads
add_filter( 'pvh_ads_should_show', function( $show, $video_id, $user_id, $slot ) {
    // Example: hide only below-video ads for administrators.
    if ( 'below_video' === $slot && current_user_can( 'administrator' ) ) {
        return false;
    }

    return $show;
}, 10, 4 );

// Action after any ad event is tracked.
add_action( 'pvh_ad_event_tracked', function( $slot, $event, $video_id, $user_id ) {
    if ( 'impression' === $event ) {
        // Custom impression tracking logic.
    }
}, 10, 4 );

// Action after a completed ad interaction, such as a click.
add_action( 'pvh_ad_completed', function( $slot, $video_id, $user_id ) {
    // Custom completion/click handling.
}, 10, 3 );

CSS Classes

  • .pvh-ad-unit - Base ad container
  • .pvh-ad-overlay - Pre-roll/mid-roll overlay
  • .pvh-ad-skip-btn - Skip button
  • .pvh-ad-label - "Ad" label badge
  • .pvh-ad-above-video - Above video position
  • .pvh-ad-below-video - Below video position
  • .pvh-ad-infeed-item - In-feed ad card
  • .pvh-ad-shorts-item - Shorts ad container

Best Practices

  • Pre-roll: Keep skip time between 3-5 seconds for best user experience
  • Mid-roll: Set interval to 30+ seconds to avoid annoying viewers
  • In-feed: Show ads every 5-8 videos for balanced monetization
  • Image Ads: Optimize images for fast loading (under 150KB)
  • Mobile: Test all ad formats on mobile devices

Media Optimizer Addon

Auto-optimize self-hosted MP4 videos with FFmpeg for dramatically improved mobile performance and streaming experience.

🚀
Performance Revolution

Transforms large MP4 files into mobile-optimized, fast-starting videos that load instantly on any device. Fixes the #1 user complaint: slow-loading self-hosted videos.

Key Features

  • Automatic FFmpeg Detection - Detects FFmpeg from 40+ common paths (cPanel, Plesk, DirectAdmin, CloudLinux, Windows, macOS)
  • Automatic Optimization - Videos processed automatically after upload
  • Background Processing - Uses WP-Cron for non-blocking optimization queue
  • Fast Start (moov atom) - Videos start playing instantly, no waiting
  • Mobile Compatible - yuv420p format ensures universal device support
  • Quality Presets - Fast, Balanced, or Quality encoding options
  • Resolution Control - Auto-downscale to 480p, 720p, or 1080p max (no upscaling)
  • Safe Fallback - Original video preserved, automatic fallback if optimization fails
  • Duplicate Protection - Same video never processed twice
  • Disk Space Check - Verifies available space before optimization
  • Compression Stats - Shows file size reduction percentage after optimization
  • Debug Mode - Built-in logging system for troubleshooting

Server Requirements

🔍
Automatic FFmpeg Detection

Media Optimizer automatically detects FFmpeg on your server. It checks 40+ common paths including cPanel, Plesk, DirectAdmin, CloudLinux, and standard Linux/Windows/macOS locations.

Requirement Details
FFmpeg Auto-detected from 40+ common paths. Manual path entry available if needed.
PHP exec() PHP must have permission to execute shell commands
Disk Space ~2x video file size required (checked automatically before optimization)
Cron WP-Cron or real cron for background processing

FFmpeg Installation Guide

If FFmpeg is not detected, follow the instructions for your hosting environment:

cPanel / WHM

  1. Login to WHM as root
  2. Go to Software → EasyApache 4
  3. Search for "ffmpeg" and install it
  4. Or ask your hosting provider to install FFmpeg

Plesk

  1. Login to Plesk as admin
  2. Go to Tools & Settings → Updates
  3. Install FFmpeg extension if available
  4. Or use SSH: yum install ffmpeg or apt install ffmpeg

DirectAdmin

  1. Login via SSH as root
  2. Run: cd /usr/local/directadmin/custombuild && ./build ffmpeg

Linux (Ubuntu/Debian)

Terminal Command
sudo apt update && sudo apt install ffmpeg -y

Linux (CentOS/RHEL/AlmaLinux)

Terminal Command
sudo yum install epel-release -y && sudo yum install ffmpeg ffmpeg-devel -y

Windows (Local Development)

  1. Download from ffmpeg.org/download.html
  2. Extract to C:\ffmpeg
  3. Add C:\ffmpeg\bin to System PATH
  4. Restart Apache/XAMPP

macOS

Terminal Command
brew install ffmpeg

Manual Path Entry

If FFmpeg is installed but not auto-detected, find its path manually:

  • Linux/Mac: Run which ffmpeg in terminal
  • Windows: Run where ffmpeg in CMD

Then enter the full path in VideoHub → Media Optimizer → FFmpeg Path

Setup Instructions

  1. Go to VideoHub → Media Optimizer
  2. Verify FFmpeg is detected (green checkmark)
  3. If not detected, enter custom FFmpeg path
  4. Select quality preset (Balanced recommended)
  5. Set max resolution (720p recommended for most sites)
  6. Enable "Auto Optimize" for automatic processing
  7. Click Save Settings

Quality Presets

Preset Speed Quality Best For
Fast Very Fast Good High-volume sites, frequent uploads
Balanced Fast Very Good Most sites (recommended)
Quality Slower Excellent Premium content, cinematic videos

Optimization Status

Each video displays optimization status in the edit screen:

  • Not Optimized - Video waiting for optimization (manual trigger available)
  • Queued - Added to background processing queue
  • Processing - FFmpeg currently optimizing the video
  • Optimized - Video optimized and ready for mobile playback
  • Failed - Optimization failed (original video still works)

Technical Details

FFmpeg Command Used
ffmpeg -y -i input.mp4 \
  -map 0:v:0 -map 0:a? \
  -c:v libx264 -preset veryfast -crf 23 \
  -profile:v high -level 4.1 \
  -pix_fmt yuv420p \
  -movflags +faststart \
  -c:a aac -b:a 128k \
  output_optimized.mp4

Why This Matters

Without Optimizer With Optimizer
Video loads slowly on mobile Instant playback start
Seek/jump takes seconds Immediate seeking response
High data usage Efficient streaming
Browser compatibility issues Universal yuv420p format
Large file sizes Optimized compression

Background Processing

Optimization runs via WP-Cron to prevent server overload:

  • One video processed at a time
  • Queue system prevents duplicate jobs
  • Processing timestamps tracked for monitoring
  • Failed jobs don't block the queue
Cron Job Recommendation

For reliable processing on low-traffic sites, set up a real cron job:

*/5 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Debug Mode

Media Optimizer includes a built-in debug system for troubleshooting optimization issues:

  • Log File: wp-content/uploads/pvh-optimized/logs/optimizer-debug.log
  • Admin Panel: View logs directly in VideoHub → Media Optimizer (when debug mode is enabled)
  • Log Levels: DEBUG (blue), INFO (green), WARNING (orange), ERROR (red)

Enable Debug Mode

To enable debug mode, edit the addon file and set:

pvh-media-optimizer.php
define( 'PVH_MEDIA_OPTIMIZER_DEBUG', true );

When enabled, the admin page shows a real-time log viewer with syntax highlighting and refresh/clear buttons.

Hooks for Developers

Available Hooks
// Triggered when optimization completes
do_action( 'pvh_video_optimized', $video_id, $optimized_path, $optimized_url );

// Filter video source URL in player
$file_url = apply_filters( 'pvh_video_player_source', $file_url, $video_id );

// Triggered when video is uploaded (before optimization)
do_action( 'pvh_video_uploaded', $video_id, $file_path );
💡
Best Practice: Check Status Column

In VideoHub → Videos list, the optimization status column shows which videos are optimized. Click "Optimize Now" for any video that hasn't been processed yet.

Selling Videos - Complete Guide

Turn your video content into a revenue stream with just 2 clicks. VideoHub's Premium Content addon makes selling videos incredibly simple.

💰
2-Click Video Selling

Mark any video as premium, set a price, and start selling. It's that simple!

Prerequisites

  • ✅ VideoHub core installed and activated
  • ✅ Premium Content addon enabled
  • ✅ WooCommerce installed and configured
  • ✅ Payment gateway set up (PayPal, Stripe, etc.)

Quick Start: Sell Your First Video

1

Create or Edit a Video

Go to VideoHub → Videos and create a new video or edit an existing one.

2

Enable Premium

In the Premium Content Settings box, check "Mark as Premium".

3

Set Your Price

Enter the price you want to charge (e.g., $9.99, €14.99).

4

Configure Preview (Optional)

Set preview duration in seconds. Users can watch this much before needing to purchase.

5

Publish & Start Selling!

Click Publish/Update. Your video is now for sale!

What Your Customers See

Scenario Customer Experience
Before Purchase
  • Premium badge on video card
  • Price displayed prominently
  • Preview plays (if enabled)
  • Blurred/locked content after preview
  • "Buy Now" button with price
After Purchase
  • "You own this video" badge
  • Full video access forever
  • Video appears in My Account → Purchased Videos

Purchase Flow

  1. Customer visits premium video page
  2. Watches preview (if available)
  3. Clicks "Buy Now - $X.XX" button
  4. Video automatically added to WooCommerce cart
  5. Customer completes checkout
  6. Order auto-completes (digital product)
  7. Instant access granted!

Managing Purchases

All video purchases are tracked in WooCommerce:

  • WooCommerce → Orders - View all video purchases
  • Order Details - See which videos were purchased
  • Refunds - Access automatically revoked on refund

Pricing Strategies

  • Single Video - $5-$50 per video
  • Course Series - Premium playlist with multiple videos
  • Exclusive Content - Behind-the-scenes, tutorials, etc.
  • Early Access - Premium for new releases, free after time
💡
Best Practice: Use Preview Wisely

Set preview to 30-60 seconds to hook viewers. Show the best part early to encourage purchases!

Selling Live Streams - Complete Guide

Monetize your live broadcasts with paid access. Perfect for webinars, concerts, exclusive events, and premium live content.

🔴
2-Click Live Stream Selling

Create a stream, set it as premium with a price, and sell tickets to your live event!

Prerequisites

  • ✅ VideoHub core installed and activated
  • ✅ Live Streaming addon enabled
  • ✅ WooCommerce installed and configured
  • ✅ An account on your chosen stream provider, such as YouTube, Twitch, Vimeo, or Dailymotion

Quick Start: Sell Your First Live Stream

1

Create a Live Stream

Go to VideoHub → Live Streams → Add New

2

Set Up Stream Details

Add title, description, thumbnail, and paste a supported live stream URL.

3

Enable Premium

Check "This is a Premium Stream" in the Premium Settings box.

4

Set Ticket Price

Enter the access price (e.g., $29.99 for a webinar, $49.99 for a concert).

5

Schedule & Publish

Set the stream status to "Upcoming" with scheduled date/time, then publish!

Use Cases for Paid Live Streams

Event Type Suggested Price Description
Webinars $19 - $99 Educational sessions, workshops, training
Live Concerts $15 - $50 Music performances, DJ sets
Sports Events $10 - $30 Live matches, tournaments
Exclusive Q&A $5 - $25 Fan meetups, AMAs
Conferences $49 - $299 Multi-speaker events, summits
Fitness Classes $10 - $30 Live workout sessions

Customer Experience

  1. Customer sees upcoming/live stream with price
  2. Clicks "Buy Access - $X.XX"
  3. Completes WooCommerce checkout
  4. Instant access to the stream
  5. Can watch live or replay (if you keep it available)

Before vs After Purchase

Before Purchase After Purchase
  • Stream thumbnail visible
  • Price badge displayed
  • Locked player overlay
  • "Buy Access" button
  • Stream description visible
  • Full stream player access
  • "You have access" badge
  • Live chat when enabled by your stream provider or by the PVH Live Chat addon
  • Stream in My Account

Promoting Your Paid Stream

  • Homepage Visibility - Streams appear in Live Streams section
  • Countdown Timer - Creates urgency for upcoming streams
  • Social Sharing - Share stream page URL
  • Email Marketing - Send stream link to your list
  • Early Bird Pricing - Offer discounts before event
🎯
Best Practice: Keep Replays Available

After your live stream ends, keep the status as "Ended" but don't delete it. Customers who purchased can still watch the replay, and new customers can buy access to the recording!

Managing Stream Access

  • WooCommerce Orders - Track all stream purchases
  • My Account Tab - Customers see purchased streams
  • Refunds - Access revoked automatically on refund
  • Admin Access - Admins always have full access

Official Addon Activation

The VideoHub free core does not require a paid license. Licenses are used only for optional official paid addons and bundles purchased from Polanger.com.

Finding Your Addon License Key

After purchasing an official addon or bundle, the license key is sent by email and is also available in your Polanger.com account.

  • Your order confirmation email
  • Your account on polanger.com → My Account → Orders
  • Your account on polanger.com → My Account → Licenses, when available

Installing and Activating an Official Addon

  1. Download the addon ZIP from your Polanger.com account.
  2. Install it from Plugins -> Add New -> Upload Plugin, or upload it from VideoHub -> Addons using the Official Addon Installer.
  3. If uploading from VideoHub -> Addons and the same addon is already installed, enable Replace existing addon package before submitting the ZIP.
  4. Return to VideoHub -> Addons to view addon status, dependencies, price, and license state.
  5. If the addon is paid, open the license action shown on the addon card.
  6. Paste the license key and click Activate License.
  7. Activate the addon from its card when the license and required dependencies are ready.
Key
License key privacy

For customer safety, the full license key is never printed back into the WordPress admin panel after saving. Users can always find the key in their Polanger.com account.

Status Labels

Status Description
Licensed The addon license is valid for this site and the addon can run.
License Required The addon is installed, but a valid license must be activated before it can run.
Expired or Inactive The license is not currently valid for this site. Protected paid addon features stay inactive until the license is renewed or reactivated.

Official Addon License Management

Installed paid addons show license status from the VideoHub -> Addons page. The license screen is intentionally not shown as a separate sidebar menu item to keep the admin clean.

Information Shown on Addon Cards

  • Licensed badge - Shows that the addon license is active.
  • Purchase date - Shown when the license server provides it.
  • Expiration date - Shows when the current license period ends.
  • Time left - Helps admins renew before expiration.
  • Site limit - Shows how many sites the license allows.
  • Renew link - Opens the related Polanger product page in a new tab.

Moving a License to Another Site

  1. Open the addon license screen from the addon card or from the admin notice link.
  2. Click Deactivate License on the old site.
  3. Install the same addon ZIP on the new site.
  4. Paste the same license key and activate it on the new site.

Renewing an Addon License

When an official paid addon license expires, protected paid addon features are paused on that site until the license is renewed. The free VideoHub core remains available.

Renewals are handled from Polanger.com. Early renewals add time to the current expiration date, so renewing before the deadline does not remove the remaining days.

💡
Need Help?

Contact us at contact@polanger.com for license-related issues.

Performance Architecture

VideoHub is built as a WordPress video engine, not just a visual gallery. The plugin keeps WordPress compatibility where it matters, while moving high-volume video activity into purpose-built data structures.

i
Balanced WordPress architecture

Videos, playlists, categories, tags, and admin editing stay inside WordPress post types and taxonomies. High-write or frequently queried activity such as views, reactions, comments, purchases, live chat, ad stats, and marketplace records use dedicated VideoHub tables where that approach is more efficient.

WordPress Scaling Boundaries

VideoHub is designed to make WordPress a strong video management engine, but WordPress should not be treated as a dedicated large-scale video delivery backend by itself. Very high concurrent playback, large upload volume, adaptive streaming, private media delivery, and heavy analytics need the same infrastructure decisions used by serious media products: caching, optimized hosting, object storage, CDN delivery, and background processing.

!
Do not stream every byte through PHP on high-traffic sites

The PHP stream proxy is useful as a compatibility or protected-delivery fallback, especially when server byte-range behavior is unreliable. For high-traffic public video playback, use direct CDN/object-storage delivery or a server-level protected delivery layer such as signed URLs, X-Sendfile, X-Accel-Redirect, or a private CDN workflow.

Site Type Recommended Setup Expectation
Small creator, course, membership, or community site Normal WordPress hosting, page caching, conservative upload limits, external embeds or optimized MP4 files. VideoHub can run comfortably when content volume and concurrent playback are moderate.
Growing video library with regular uploads Good VPS/managed WordPress hosting, object cache, media optimization, scheduled/background processing, CDN for uploads. WordPress manages the catalog and access layer while delivery load is reduced.
Paid/private videos or protected self-hosted media Signed URLs, protected CDN/object storage, or server-level file handoff. Use PHP proxy only where necessary. Access checks stay in WordPress; heavy file transfer should be handled outside long-running PHP requests whenever possible.
Large platform with thousands of concurrent viewers Dedicated media infrastructure, CDN, object storage, queue workers, analytics aggregation, search indexing, and database/object-cache planning. VideoHub can serve as the WordPress video engine, but the full stack must be planned like a media platform.

Media Delivery Recommendations

  • Use CDN/object storage for growth: WordPress should manage the video records, permissions, playlists, comments, and monetization; the CDN should carry the video bandwidth.
  • Keep PHP proxy as a fallback: It helps with compatibility and controlled delivery, but long video streams can occupy PHP workers under high concurrency.
  • Aggregate analytics: High-volume views and engagement should be summarized into stats tables or cached reports instead of recalculating from raw logs on every request.
  • Cache discovery surfaces: Home, Explore, trending, category sections, and search suggestions should stay bounded and cache-friendly.
  • Use background jobs for processing: Optimization, thumbnails, imports, and future adaptive streaming workflows should not depend on a single frontend page request.

Why VideoHub Uses Custom Tables

Video platforms generate a different type of load than normal blog content. A single popular video can create thousands of view events, reactions, comments, chat messages, purchases, or ad impressions. Storing all of that activity only in wp_postmeta would create large meta tables, slow lookups, and unnecessary joins. VideoHub separates those high-frequency operations into focused tables with predictable columns.

Data Type Storage Strategy Why It Helps
Videos, playlists, categories, tags WordPress post types and taxonomies Keeps admin editing, permalinks, REST, templates, and theme compatibility familiar.
Video views and video runtime metadata pvh_video_views, pvh_video_meta Keeps view tracking and frequently queried video metrics away from overloaded postmeta rows.
Reactions and comment votes pvh_reactions, pvh_comment_votes Fast lookup for user votes, duplicate prevention, and aggregated engagement counts.
Comments pvh_comments Supports threaded video comments, moderation states, likes, sorting, and profile comment lists without relying on the default WordPress comment table.
Shorts stats pvh_short_stats, pvh_short_likes, pvh_short_view_tokens Short-form video interactions are tracked separately so swipe/feed experiences do not overload regular postmeta.
Premium purchases and live stream purchases pvh_video_purchases, pvh_stream_purchases Access checks can be handled from compact purchase records instead of repeatedly scanning order metadata.
Live chat pvh_chat_rooms, pvh_chat_messages Chat messages are high-frequency records and need a structure that can be queried, cleaned, and paged efficiently.
Notifications pvh_notifications Unread badges, user notification lists, and addon event alerts use a compact indexed table instead of separate addon-specific notification stores.
Ads and marketplace workflows pvh_ad_stats, marketplace earnings, withdrawals, and vendor profile tables Monetization reporting and seller payouts need reliable, queryable records independent of visual video cards.

Performance Principles

  • Only load what is needed: Addon sections render only when the related addon is active and the feature is enabled.
  • No empty addon markup: Pages like Explore hide unavailable addon sections instead of outputting placeholder HTML.
  • Separated high-write data: Views, votes, comments, purchases, chat, and analytics use dedicated records instead of bloating core content tables.
  • WordPress-native content where appropriate: Videos still benefit from WordPress posts, taxonomies, capabilities, permalinks, and template overrides.
  • Query limits by default: Discovery surfaces such as Explore keep sections small and predictable, usually 6 cards per section.
  • Admin-only diagnostics: Debugging tools are not loaded for normal visitors, protecting frontend performance.

What This Means for Site Owners

On ordinary hosting, the goal is to avoid unnecessary work on every page load. VideoHub tries to keep public pages focused: query the content needed for the current screen, avoid inactive addon output, and keep high-volume records in tables designed for that type of data. This does not replace good hosting, caching, or media optimization, but it gives the plugin a stronger foundation than a purely postmeta-based video system.

What This Means for Developers

If you build integrations or official addons, follow the same rule: use WordPress posts/taxonomies for content that needs editorial workflows, and use dedicated tables or efficient storage for repeated events, logs, queues, counters, and transactional data. When extending UI surfaces, always check addon availability and keep queries bounded.

OK
Developer rule of thumb

If the data is content, WordPress post types are usually the right place. If the data is high-frequency activity, diagnostics, stats, queue records, or transaction history, use a purpose-built structure and expose it through hooks, filters, or helper APIs.

Notification Engine

VideoHub includes a lightweight core notification engine so official addons can send consistent user notifications without each addon building a separate notification system.

i
Core infrastructure, addon-driven events

The core provides the notification table, helper functions, REST endpoints, unread count, panel UI, mobile badge support, and diagnostics hooks. Addons decide when to create notifications, such as new messages, followers, post comments, reactions, purchases, approvals, or future live stream reminders.

What Users See

  • Desktop notification button: Logged-in users see a bell button near the VideoHub search/filter controls when the search surface is available.
  • Mobile and PWA button: Logged-in users see a notification item in the mobile bottom bar with a red unread badge.
  • Slide-out panel: The notification list opens only when the user clicks the button, keeping initial page loads light.
  • Unread badges: Notification badges show the unread count and collapse automatically when there is nothing new.
  • Community message badge: When PVH Community is active, the Messages menu item can show how many conversations contain unread messages.

Performance Model

Layer Behavior Why It Matters
Database Notifications are stored in wp_pvh_notifications with indexes for user, read status, creation time, type, and object lookup. Unread checks and recent notification lists stay fast without scanning general WordPress postmeta.
Initial page load The frontend loads only for logged-in users. The list itself is not rendered or fetched until the panel opens. Normal visitors do not receive notification assets, and logged-in users avoid unnecessary list queries.
Unread count Counts are cached briefly and cleared when notifications are created or marked read. The UI can show badges without repeatedly doing expensive work on every render.
Pagination The REST list endpoint loads a small page of notifications and supports cursor-based "load more" behavior. Long-running accounts do not need to load their full notification history at once.
Polling The core engine does not poll globally by default. Live features can add controlled polling only on the screens that need it, instead of slowing every VideoHub page.

Core Helper Functions

Addons and custom integrations should use the helper functions instead of writing directly to the notification table.

Create a notification
pvh_add_notification( $recipient_user_id, 'user_followed', array(
    'actor_id'    => $follower_user_id,
    'object_type' => 'user',
    'object_id'   => $follower_user_id,
    'url'         => $profile_url,
) );
Register a custom notification type
pvh_register_notification_type( 'video_approved', array(
    'label' => __( 'Video approved', 'polanger-videohub' ),
    'icon'  => 'check',
) );
Function Purpose
pvh_add_notification( $user_id, $type, $args ) Create a notification for a user.
pvh_register_notification_type( $type, $args ) Register an addon-specific type and icon.
pvh_get_notifications( $user_id, $args ) Fetch recent notifications with pagination support.
pvh_get_unread_notifications_count( $user_id ) Read the cached unread count for badge UI.
pvh_mark_notification_read( $notification_id, $user_id ) Mark one notification read for its owner.
pvh_mark_all_notifications_read( $user_id ) Mark all notifications read for a user.

REST Endpoints

  • GET /wp-json/pvh/v1/notifications/count - Returns the current user's unread notification count.
  • GET /wp-json/pvh/v1/notifications - Returns a paged list of notifications for the current user.
  • POST /wp-json/pvh/v1/notifications/read - Marks selected notifications read, or all when no IDs are passed.

Community Integration

PVH Community uses the core notification engine for follows, direct messages, message requests, accepted message requests, post comments, reactions, and mentions. If the core helper functions are unavailable, Community keeps a fallback path for compatibility, but the recommended path is the shared core engine.

OK
Diagnostics support

When the Frontend Diagnostics Tool is enabled, VideoHub reports notification engine status, table availability, database version, unread count, registered types, REST namespace, active badges, and notification REST request results. This makes notification problems easier to debug without exposing tools to normal visitors.

Frontend Diagnostics Tool

The Frontend Diagnostics Tool is an admin-only troubleshooting layer for VideoHub pages, shorts feeds, search surfaces, and self-hosted playback flows.

!
Admin-only by design

Diagnostics controls are available only to logged-in users who can manage site options. Normal visitors do not see the controls, and diagnostic assets are not loaded for them.

Where to Enable It

  1. Go to VideoHub -> Settings.
  2. Find Frontend Diagnostics Tool.
  3. Enable Enable Frontend Diagnostics Tool.
  4. Open a supported VideoHub frontend page while logged in as an administrator.

What It Can Inspect

Diagnostic Area What It Shows
Route detection Page type, current VideoHub surface, query flags, current object ID, taxonomy context, and supported page status.
Addon state Active VideoHub addons and runtime classes detected on the current request.
Self-hosted playback Final player source, optimizer decisions, proxy decisions, premium secure stream wrapping, local file paths, and source availability.
Browser player events Video element events such as play, waiting, loadedmetadata, canplay, playing, errors, duration, readyState, networkState, mute state, and currentSrc.
Network probe HEAD and byte-range checks for video sources, including HTTP status, content type, content length, accept ranges, and content range.
Shorts feed diagnostics Active slide source, iframe/video source type, autoplay state, related feed data, and failed requests.
Search diagnostics Search form state, live search requests, response payloads, result rendering, and frontend AJAX timing while the tool is active.
Recent server logs Per-admin diagnostic logs for the current debugging session, including source selection, stream wrapping, AJAX reports, and server-side hints.

Recommended Workflow

  1. Enable the diagnostics tool only while investigating a problem.
  2. Open the affected VideoHub page as an administrator.
  3. Use the floating diagnostics control or the single-video test button where available.
  4. Check Server Report first to confirm routing, addon state, source resolution, and access decisions.
  5. Check Browser Player Events for actual player state and media errors.
  6. Check Network Probe for HTTP status, range request support, content type, and blocked stream URLs.
  7. Copy the diagnostic output before changing settings, cache, server rules, or addon state.
  8. Disable the tool again after debugging to keep the admin surface clean.

Common Problems It Helps Find

  • Video never starts: Confirms whether the browser receives a playable source and whether range requests work.
  • Premium video access issue: Shows whether Premium Content wrapped the stream and whether the current user has access.
  • Optimized file mismatch: Shows whether the optimizer selected an optimized file and whether it exists on disk.
  • Search live results fail: Shows live search requests and frontend response handling while diagnostics are enabled.
  • Shorts autoplay issues: Shows active slide media type, iframe/video source, autoplay/mute state, and slide transitions.
  • Addon conflict suspicion: Shows active addon classes and can reveal when an expected addon is missing or inactive.
i
Safe for production troubleshooting

The tool is designed for administrator sessions. It should not expose diagnostic controls or extra scripts to logged-out visitors or normal users. Still, keep it disabled when you are not actively testing.

Template Override

Customize plugin templates by copying them to your theme.

How to Override

  1. Create a folder in your theme: your-theme/polanger-videohub/
  2. Copy template files from plugins/polanger-videohub-lite/templates/
  3. Edit the copied files in your theme folder

Available Templates

  • single-pvh_video.php - Single video page
  • archive-pvh_video.php - Video archive page
  • taxonomy-pvh_category.php - Category archive
  • single-pvh_playlist.php - Single playlist page
⚠️
Important:

After plugin updates, check if your overridden templates need updating to match new features.

🔧 Developer Documentation

VideoHub provides hooks at every stage of the video lifecycle, enabling developers to build powerful integrations and custom addons.

Hook API Stability: Public

Backward compatibility guaranteed within the same major version.
Hook API Version: 1.0

💡
Platform-Level Architecture

VideoHub is designed with a true addon ecosystem mindset. Every major feature point exposes hooks for external integration with LMS, APIs, caching systems, search indexes, analytics platforms, themes, and commerce workflows.

Engine
VideoHub manages videos so other plugins do not have to.

Think of VideoHub as a WordPress video engine. An LMS plugin, theme, membership plugin, forum plugin, or WooCommerce extension can store a VideoHub video ID and let VideoHub handle the player, thumbnails, provider support, playlists, access checks, and addon-powered workflows.

Key Integration Points

  • Video Lifecycle - Hooks for upload, import, update, delete, and status changes
  • Video Engine API - Select, render, and check access for VideoHub videos from other plugins
  • Template Injection - Add content at any point in video pages
  • Player Customization - Filter player arguments and output
  • AJAX Operations - Before/after hooks for all AJAX actions
  • Settings & Profile - Add custom tabs and content

Full Documentation

For complete hook documentation with all parameters and examples, see:

Documentation Files
/wp-content/plugins/polanger-videohub-lite/docs/DEVELOPER-HOOKS.md

Video Engine API

Use this API when another WordPress plugin or theme wants to use VideoHub videos without rebuilding upload logic, player logic, thumbnails, playlists, premium access, live support, or optimization logic.

API
Simple rule

Your plugin stores the VideoHub video ID. VideoHub renders the video. This keeps LMS lessons, product pages, forum posts, and theme layouts clean and future-proof.

What This Solves

Without VideoHub With VideoHub Engine API
LMS plugin stores random embed URLs in lessons. LMS plugin stores one VideoHub video ID and renders the VideoHub player.
Theme developer builds custom video cards and thumbnail logic. Theme developer calls pvh_get_video_card().
Commerce extension writes its own access logic. Commerce extension calls pvh_get_video_access_state().
Forum/community plugin handles uploads and playback itself. Forum/community plugin links to a VideoHub video and lets VideoHub handle playback.

Most Important Helper Functions

Function Use it when you need to...
pvh_get_video( $video_id ) Get the VideoHub video post object safely.
pvh_get_video_data( $video_id ) Get title, thumbnail, duration, views, permalink, source, and access state as an array.
pvh_get_videos( $args ) Query VideoHub videos by category, tag, author, IDs, search, or limit for custom layouts.
pvh_render_video( $video_id, $args ) Return complete player HTML for a video. Echo it in your template.
pvh_the_video( $video_id, $args ) Echo the complete player directly.
pvh_get_video_card( $video_id ) Render a VideoHub-style video card inside a theme, block, or plugin template.
pvh_user_can_watch_video( $video_id, $user_id ) Check if a user can watch a video, including premium addon access when active.
pvh_get_video_access_state( $video_id, $user_id ) Get a detailed access array: allowed, premium required, login required, price, status.
pvh_get_attached_video_id( $post_id ) Get the VideoHub video ID attached to an external post by the picker integration.
pvh_render_video_picker_field( $args ) Add a reusable admin field that lets editors select a video from the VideoHub library.

Example 1: Render One Video in Any Template

If you already know the VideoHub video ID, render it like this:

PHP
<?php
$video_id = 123;

echo pvh_render_video( $video_id, array(
    'context' => 'custom_template',
) );
?>

Example 2: Add VideoHub Picker to an LMS Lesson

This is the easiest integration. Your LMS plugin only tells VideoHub which post type needs a video picker.

PHP
add_filter( 'pvh_video_picker_post_types', function( $post_types ) {
    $post_types[] = 'lesson';       // Example LMS lesson post type.
    $post_types[] = 'sfwd-lessons'; // Example LearnDash lesson post type.

    return $post_types;
} );

VideoHub will add a VideoHub Video meta box to those edit screens. The selected video ID is saved in this post meta key:

Meta Key
_pvh_attached_video_id

Example 3: Show the Lesson Video on the Frontend

Inside your LMS lesson template, get the selected VideoHub video ID and render it:

PHP
<?php
$video_id = pvh_get_attached_video_id( get_the_ID() );

if ( $video_id ) {
    echo pvh_render_video( $video_id, array(
        'context' => 'lms_lesson',
    ) );
}
?>

Example 4: Query Videos for a Custom Layout

Use pvh_get_videos() when you want a theme, LMS page, or custom block to list VideoHub videos without writing the whole query layer yourself.

PHP
<?php
$videos = pvh_get_videos( array(
    'category' => 'education',
    'limit'    => 12,
) );

foreach ( $videos as $video ) {
    echo pvh_get_video_card( $video->ID );
}
?>

Example 5: Check Access Before Showing a Custom Button

Use this when your plugin needs to decide what text or action to show around the video.

PHP
<?php
$video_id = 123;
$state    = pvh_get_video_access_state( $video_id, get_current_user_id() );

if ( $state['can_watch'] ) {
    echo '<a class="button" href="' . esc_url( get_permalink( $video_id ) ) . '">Watch lesson video</a>';
} elseif ( $state['requires_login'] ) {
    echo '<a class="button" href="' . esc_url( wp_login_url() ) . '">Login to watch</a>';
} elseif ( $state['is_premium'] ) {
    echo '<span class="notice">Premium video access required.</span>';
}
?>

Example 6: Add a Manual Picker Field to Your Own Meta Box

If you already have your own meta box, call the picker field yourself and save the selected ID in your own meta key.

!
Manual fields are display-only until you save them.

When you use pvh_render_video_picker_field() inside your own meta box, your plugin must handle nonce verification, capability checks, and saving the submitted meta value.

PHP
add_action( 'admin_enqueue_scripts', function() {
    if ( function_exists( 'pvh_enqueue_video_picker_assets' ) ) {
        pvh_enqueue_video_picker_assets();
    }
} );

echo pvh_render_video_picker_field( array(
    'name'        => '_my_lesson_videohub_video_id',
    'selected'    => absint( get_post_meta( get_the_ID(), '_my_lesson_videohub_video_id', true ) ),
    'label'       => 'Lesson Video',
    'description' => 'Choose a video from VideoHub. Your plugin only stores the video ID.',
) );

Change the Automatic Meta Key

If your plugin wants the automatic picker to save into a custom meta key, use this filter:

PHP
add_filter( 'pvh_video_picker_meta_key', function( $meta_key, $post_type ) {
    if ( 'lesson' === $post_type ) {
        return '_lesson_videohub_video_id';
    }

    return $meta_key;
}, 10, 2 );

Important Developer Rule

!
Do not store raw video URLs when you can store a VideoHub video ID.

Raw URLs bypass VideoHub features. Video IDs keep your integration compatible with playlists, thumbnails, self-hosted playback, Premium Content, Live Streaming, Media Optimizer, analytics, and future official addons.

Hooks & Filters Reference

Core hooks available throughout VideoHub.

Template Action Hooks

Hook Location Description
pvh_before_single_video Single video page Before video content
polanger_videohub_video_actions Below video title Add action buttons (like, share)
polanger_videohub_after_video_details After description Add content after video details
polanger_videohub_after_video_content After main content Add comments, related content
pvh_video_sidebar_top Sidebar top Add sidebar content (Live Chat uses this)
pvh_before_archive_content Archive pages Before video grid
pvh_user_dropdown_menu_items User menu Add items to user dropdown

Filter Hooks

Filter Parameters Description
pvh_video_player_args $args, $video_id Modify player settings (autoplay, poster, DRM)
pvh_video_player_source $url, $video_id Filter video source URL
polanger_videohub_video_player $html, $video_id, $args Filter complete player HTML
pvh_settings_tabs $tabs Add custom settings tabs
pvh_profile_tabs $tabs, $user, $is_own Add custom profile tabs

Example: Add Content After Video

PHP
add_action( 'polanger_videohub_after_video_details', function( $video_id ) {
    echo '<div class="my-custom-section">';
    echo '<h3>Related Products</h3>';
    // Display related products
    echo '</div>';
} );

Example: Filter Player Arguments

PHP
add_filter( 'pvh_video_player_args', function( $args, $video_id ) {
    // Disable autoplay for premium videos
    if ( get_post_meta( $video_id, '_is_premium', true ) ) {
        $args['autoplay'] = false;
    }
    
    // Add custom poster
    $args['poster'] = get_post_meta( $video_id, '_custom_poster', true );
    
    return $args;
}, 10, 2 );

Video Lifecycle Hooks

These hooks fire at key moments in a video's lifecycle, enabling integrations with LMS, APIs, caching systems, search indexes, and analytics.

Hook When Parameters
pvh_video_uploaded Video file uploaded $video_id, $file_path
pvh_video_imported Video imported from YouTube/Vimeo $post_id, $provider_id, $video_data
pvh_video_updated Video metadata saved $post_id, $post
pvh_video_deleted Before video is deleted $post_id, $post
pvh_video_status_changed Status changes (draft→publish) $post_id, $old_status, $new_status
pvh_video_optimized After FFmpeg optimization $video_id, $output_file, $output_url, $stats

Example: Track Status Changes

PHP
add_action( 'pvh_video_status_changed', function( $post_id, $old_status, $new_status ) {
    if ( $new_status === 'publish' && $old_status !== 'publish' ) {
        // Video just published - notify subscribers
        my_notify_subscribers( $post_id );
    }
    
    if ( $new_status === 'trash' ) {
        // Video moved to trash - update analytics
        my_analytics_track( 'video_trashed', $post_id );
    }
}, 10, 3 );

Example: Sync with External Search Index

PHP
// Add to search index when video is published
add_action( 'pvh_video_status_changed', function( $post_id, $old, $new ) {
    if ( $new === 'publish' ) {
        my_search_index_add( $post_id );
    }
}, 10, 3 );

// Remove from search index when deleted
add_action( 'pvh_video_deleted', function( $post_id ) {
    my_search_index_remove( $post_id );
} );

JavaScript Player Events

VideoHub 1.5.0 introduces a comprehensive JavaScript player events system for ads, analytics, and custom interactions.

🎬
Perfect for Video Ads Integration

Use these events to implement pre-roll, mid-roll, and post-roll ads with Google IMA SDK, AdSense for Video, or any VAST-compatible ad server.

Global Player API

Access the player through the global window.PVH_Player object:

Available Events

Event Description Data
ready Player initialized player, videoId
play Video started/resumed videoId, currentTime, duration
pause Video paused videoId, currentTime, duration
ended Video finished videoId, duration
timeupdate Time changed (4/sec) videoId, currentTime, duration, percent
milestone Progress milestone (25%, 50%, 75%, 100%) videoId, milestone, currentTime
cuepoint Cue point triggered (for mid-roll ads) videoId, time, index, data

Listening to Events

JavaScript
// Method 1: Using PVH_Player.on()
PVH_Player.on('play', function(data) {
    console.log('Video started:', data.videoId);
});

PVH_Player.on('milestone', function(data) {
    if (data.milestone === 50) {
        console.log('User watched 50% of video');
    }
});

// Method 2: Using DOM events
document.addEventListener('pvh:player:ended', function(e) {
    gtag('event', 'video_complete', { video_id: e.detail.videoId });
});

Mid-Roll Ads with Cue Points

JavaScript
// Add cue points for mid-roll ad breaks
PVH_Player.on('ready', function() {
    PVH_Player.addCuePoint(30, { type: 'midroll' });  // 30 seconds
    PVH_Player.addCuePoint(300, { type: 'midroll' }); // 5 minutes
});

// Listen for cue point triggers
PVH_Player.on('cuepoint', function(data) {
    PVH_Player.pause();  // Pause video
    showAd();            // Show your ad
    PVH_Player.play();   // Resume after ad
});

Player Control Methods

Method Description
PVH_Player.pause() Pause video (for ad playback)
PVH_Player.play() Resume video (after ad)
PVH_Player.seek(time) Seek to specific time in seconds
PVH_Player.getCurrentTime() Get current playback position
PVH_Player.getDuration() Get video duration
PVH_Player.addCuePoint(time, data) Add cue point for mid-roll ads
PVH_Player.resetCuePoints() Reset all cue points (for replay)
📖
Full Documentation

For complete examples including Google IMA SDK integration, see docs/DEVELOPER-HOOKS.md

Building External Addons

Create your own addons that integrate with VideoHub without modifying core files.

🎯
Why External Addons?

External addons are independent plugins that hook into VideoHub. They survive core updates and can be distributed separately.

Minimum Bootstrap File

This is the entry point for any external addon. Copy this template to start your addon:

pvh-my-addon/pvh-my-addon.php
<?php
/**
 * Plugin Name: PVH Sample Addon
 * Description: Sample external addon for Polanger VideoHub
 * Version: 1.0.0
 * Author: Your Name
 * Requires Plugins: polanger-videohub-lite
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Bootstrap - Wait for WordPress to fully load
 */
add_action( 'plugins_loaded', function () {

    // Check if VideoHub is active
    if ( ! defined( 'POLANGER_VIDEOHUB_VERSION' ) ) {
        return; // VideoHub not installed, do nothing
    }

    /**
     * Wait for VideoHub addon system to be ready
     * This ensures all core classes are available
     */
    add_action( 'polanger_videohub_addons_loaded', function () {
        
        // Initialize your addon here
        pvh_sample_addon_init();

    } );

} );

/**
 * Initialize addon functionality
 */
function pvh_sample_addon_init() {

    /**
     * Example: Hook into video import
     */
    add_action( 'pvh_video_imported', function ( $post_id, $provider_id, $video_data ) {
        // Custom logic: log, webhook, tagging, etc.
        error_log( "Video imported: {$post_id} from {$provider_id}" );
    }, 10, 3 );

    /**
     * Example: Add content to video page
     */
    add_action( 'polanger_videohub_after_video_details', function ( $video_id ) {
        echo '<div class="pvh-sample-addon-box">';
        echo 'Content added by external addon';
        echo '</div>';
    } );

    /**
     * Example: Add settings tab
     */
    add_filter( 'pvh_settings_tabs', function ( $tabs ) {
        $tabs['my-addon'] = array(
            'label' => 'My Addon',
            'icon'  => 'dashicons-admin-generic',
        );
        return $tabs;
    } );

    add_action( 'pvh_settings_tab_content_my-addon', function () {
        echo '<h2>My Addon Settings</h2>';
        // Render your settings form here
    } );

}

Why This Structure?

⚠️
Important Load Order

VideoHub loads in this order: plugins_loaded → Core Classes → Addon Manager → Provider Manager. The polanger_videohub_addons_loaded hook fires after everything is ready.

Addon File Structure

Recommended Structure
wp-content/plugins/pvh-my-addon/
├── pvh-my-addon.php      ← Main bootstrap file
├── admin/
│   └── views/            ← Admin templates
├── public/
│   ├── css/              ← Frontend styles
│   ├── js/               ← Frontend scripts
│   └── views/            ← Frontend templates
└── includes/             ← PHP classes

AJAX Hooks

Hooks that fire before and after AJAX operations, useful for logging, validation, and rate limiting.

Upload Hooks

Hook When Parameters
pvh_before_ajax_upload Before upload processing $file, $user_id, $settings
pvh_after_ajax_upload After successful upload $video_id, $attachment_id, $upload, $user_id

Example: Log Upload Attempts

PHP
// Log all upload attempts
add_action( 'pvh_before_ajax_upload', function( $file, $user_id, $settings ) {
    error_log( "Upload attempt by user {$user_id}: {$file['name']}" );
}, 10, 3 );

// Track successful uploads
add_action( 'pvh_after_ajax_upload', function( $video_id, $attachment_id, $upload, $user_id ) {
    // Update user upload count
    $count = (int) get_user_meta( $user_id, 'total_uploads', true );
    update_user_meta( $user_id, 'total_uploads', $count + 1 );
}, 10, 4 );

Example: Rate Limiting

PHP
add_action( 'pvh_before_ajax_upload', function( $file, $user_id, $settings ) {
    $last_upload = get_user_meta( $user_id, 'last_upload_time', true );
    
    // Require 60 seconds between uploads
    if ( $last_upload && ( time() - $last_upload ) < 60 ) {
        wp_send_json_error( array(
            'message' => 'Please wait before uploading again.'
        ) );
    }
    
    update_user_meta( $user_id, 'last_upload_time', time() );
}, 10, 3 );
Full Documentation

For complete hook documentation with all parameters, see docs/DEVELOPER-HOOKS.md in the plugin folder.

CSS Customization

VideoHub uses CSS variables for easy customization.

CSS Variables

Add to your theme's CSS
:root {
    /* Primary Colors */
    --pvh-primary: #e50914;
    --pvh-primary-hover: #c40812;
    
    /* Text Colors */
    --pvh-text: #0f0f0f;
    --pvh-text-secondary: #606060;
    
    /* Background Colors */
    --pvh-bg: #f9f9f9;
    --pvh-bg-elevated: #ffffff;
    --pvh-card-bg: #ffffff;
    
    /* Border & Shadow */
    --pvh-border: #e5e5e5;
    --pvh-radius: 12px;
    --pvh-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    
    /* Card Width */
    --pvh-card-width: 240px;
}

Dark Mode

Dark Mode Variables
@media (prefers-color-scheme: dark) {
    :root {
        --pvh-text: #ffffff;
        --pvh-text-secondary: #aaaaaa;
        --pvh-bg: #0f0f0f;
        --pvh-bg-elevated: #1a1a1a;
        --pvh-card-bg: #1a1a1a;
        --pvh-border: #303030;
    }
}

Frequently Asked Questions

How do I add a video?

Go to VideoHub → Add New in your WordPress admin. Enter the video title, description, and video source (URL, file, or embed code).

Can I use YouTube videos?

Yes! Simply paste the YouTube URL in the Video URL field and VideoHub will automatically embed it.

How do I customize the layout?

Go to VideoHub → Settings to change videos per page, columns per row, and other display options.

Can I override templates?

Yes! Copy template files from /plugins/polanger-videohub-lite/templates/ to /themes/your-theme/polanger-videohub/ and customize them.

Why isn't Fetch Info working?

Make sure you have entered valid API keys in VideoHub → Settings → API Keys. Click the "Test" button to verify each key.

How do I enable Shorts?

PVH Shorts is an optional addon. Install and activate it first, then go to VideoHub -> Shorts to add vertical videos.

Is VideoHub compatible with Elementor?

Yes! Use the Shortcode widget in Elementor and paste any VideoHub shortcode. Full-width sections are supported.

Troubleshooting

Videos Not Displaying

  • Check if videos are published (not draft)
  • Verify the shortcode is correct
  • Clear any caching plugins
  • Check for JavaScript errors in browser console

404 Errors on Video Pages

  • Go to Settings → Permalinks
  • Click "Save Changes" to flush rewrite rules
  • Clear cache if using a caching plugin

API Key Errors

  • Verify the API key is correct
  • Check if the API is enabled in your Google/Vimeo console
  • Ensure you haven't exceeded API quota limits
  • Check if API key has proper permissions

Styling Issues

  • Check for CSS conflicts with your theme
  • Use browser inspector to identify conflicting styles
  • Add custom CSS with higher specificity if needed

Planned Official Addons

VideoHub is designed as a video engine that can grow through dedicated addon packages. The items below describe product directions we are exploring for future official addons. They are not date-based commitments and may change based on customer feedback, platform requirements, and technical compatibility.

i
Planning note

Planned addon ideas are not required for the free core plugin. They show where the VideoHub ecosystem can grow for stores, creators, publishers, developers, and advanced video platforms.

Planned: AI Video Tools Addon

Future official addon

An AI-assisted workflow addon for creators and publishers who manage larger video libraries.

Potential Features

  • AI-powered metadata generation for videos: Generate or improve titles, summaries, descriptions, and SEO-friendly metadata for VideoHub records.
  • Automatic keyword extraction: Suggest relevant tags from video metadata, transcripts, or descriptions.
  • AI category mapping: Suggest the best existing VideoHub categories for each video to keep large libraries organized.
  • Automatic transcript and subtitle generation: Create transcripts and subtitle/caption workflows for uploaded videos where supported.
  • Thumbnail suggestions: Generate attractive thumbnail suggestions for uploaded videos using AI-assisted image workflows.
  • AI Shorts Generator: Analyze long videos, detect chapters or highlights, and suggest short-form clips that could become Shorts.
  • Chapter and highlight suggestions: Suggest chapter markers, important moments, or short summaries for long videos.
  • AI content moderation: Help review titles, descriptions, comments, and live chat messages before publication.
  • Content repurposing: Prepare social snippets, short descriptions, and promotional summaries from one video record.

Why This Matters

As a video library grows, manual metadata work becomes slow and inconsistent. AI tools can reduce repetitive work while keeping the site owner in control of final publishing decisions.

Planned: Third-Party Developer Marketplace

Future ecosystem direction

VideoHub is designed to support official addons as well as future third-party extensions developed by the community.

Planned Features

  • Community addons: Allow developers to build specialized VideoHub extensions for niche workflows.
  • Third-party developer marketplace: Create a future discovery layer for compatible VideoHub addons.
  • Developer verification: Help site owners identify trusted addon authors and maintained packages.
  • Addon compatibility badges: Show which VideoHub versions and addon dependencies a package supports.
  • Developer documentation improvements: Continue expanding hooks, filters, shortcode, and addon packaging documentation.

Why This Matters

A strong video platform grows through an ecosystem, not only through core updates. A future marketplace direction helps developers see VideoHub as a platform they can build on.

Changelog

Version 1.9.3

July 2, 2026

Translation readiness, cleaner public count strings, and clearer admin technical notices.

Localization

  • Improved: Core, comments, reactions, and search interface strings are prepared more consistently for translation workflows.
  • Improved: Playlist, category, and public count strings now include clearer translator context.
  • Improved: Provider and import helper text is easier for translators and site owners to understand.

Admin Notices

  • Improved: Dashboard and diagnostics notices use clearer placeholder context for translated technical messages.

Version 1.9.2

July 2, 2026

Core notification engine, admin-only diagnostics improvements, stronger addon bootstrap safety, and updated official bundle alignment.

Core Notifications & Diagnostics

  • New: VideoHub now includes a lightweight notification engine with a dedicated notification table, unread counters, REST endpoints, helper functions, and notification type registration support.
  • Improved: The Frontend Diagnostics Tool can now report clearer route, runtime, notification, and supported-surface context while remaining strictly admin-only.
  • Improved: User interface integrations can surface unread message and notification counts more consistently across desktop, mobile, and PWA-style surfaces.

Official Addon Ecosystem

  • New: PVH Community is now documented as the community layer for creator walls, global feeds, follows, private messaging, notifications, and moderation-ready workflows.
  • Improved: The User & Community bundle is now aligned around PVH Auth, PVH Community, PVH Channels, and PVH Uploads using one shared bundle license flow.
  • Improved: The Monetization bundle flow for Premium Content and Marketplace is reinforced so both addons share the same license package behavior.
  • Improved: Official addon admin bootstraps can register admin-only license/card metadata without loading public runtime features unnecessarily.

Stability

  • Improved: Optional feature checks are safer around missing or inactive addon data, reducing unnecessary public queries and avoiding confusing empty states.

Version 1.9.1

June 28, 2026

WordPress.org release polish, safer addon package replacement, refreshed public links, and clearer bundled documentation.

Core Package & Release Readiness

  • Improved: WordPress.org release metadata now targets the 1.9.1 maintenance release.
  • Improved: Product, documentation, demo, developer documentation, and GitHub links now point to the current public resources.
  • Improved: Official addon ZIP uploads now require an explicit replacement option before an existing package is overwritten.
  • Improved: Addon installation guidance now explains both standard WordPress plugin uploads and the built-in VideoHub addon manager.

Documentation & Developer Resources

  • Improved: Free core features and optional official addons are described more clearly across the bundled docs.
  • Improved: Developer documentation metadata now reflects the current VideoHub release.
  • Fixed: Outdated text that could describe optional addons as included core features.

Version 1.9.0

June 28, 2026

Live search reliability, cleaner discovery grids, safer custom-table checks, stronger comment discovery, and expanded diagnostics documentation.

Search & Discovery

  • Improved: PVH Search live results now handle fast typing, repeated searches, and overlapping AJAX responses more reliably.
  • Improved: Search suggestions now decode encoded characters before display, so titles with special characters remain readable.
  • Improved: Admin-only search diagnostics now provide better live request, response, timing, and rendering details when the Frontend Diagnostics Tool is enabled.
  • Improved: Explore page video cards now use a predictable 3-column desktop layout, with cleaner tablet and mobile breakpoints.
  • Improved: Explore shorts now fit cleanly into the available area without empty-column visual gaps.

Comments & Community

  • Improved: Popular Comments first highlights liked comments from the last 7 days, then fills remaining slots with recent approved comments.
  • Improved: Comment discovery can include supported VideoHub content types such as videos, shorts, and live streams.
  • Improved: Discovery comment cards link back to the related content more safely and handle missing user data more gracefully.

Core Stability, Performance & Documentation

  • Improved: Optional-feature custom table checks are safer, preventing missing addon tables from creating public database warnings.
  • Improved: Responsive layout isolation for Explore cards reduces conflicts with global video and shorts card styles.
  • Improved: Performance architecture documentation now explains why VideoHub uses WordPress content structures together with dedicated activity tables.
  • Improved: Frontend Diagnostics Tool documentation now explains route detection, browser events, network probes, player source reports, server logs, and search diagnostics.

Fixes

  • Fixed: A live search timing issue where stale or overlapping responses could make instant results appear inconsistent.
  • Fixed: Search suggestion titles could show encoded entities such as &amp; instead of readable characters.
  • Fixed: Navigation Panel conditional menu checks used an outdated premium purchase table reference in some cases.

Version 1.8.1

June 27, 2026

Core addon management improvements, a calmer search experience, clearer comment moderation visibility, and cleaner frontend comment pagination.

Core, Addons & Setup

  • Improved: Optional official addons can now be installed as standard WordPress plugins while still being shown and managed from VideoHub -> Addons.
  • Improved: Paid and optional addon folders stay outside the free core update path, helping site owners update VideoHub Core without removing separately installed addons.
  • Improved: Addon discovery, installed states, activation states, and dependency messaging are clearer for official standalone addon plugins.
  • Improved: Setup wizard choices stay aligned with the main settings area, including homepage selection and default core addon preferences.
  • Improved: The setup wizard is easier to revisit from the settings experience after the first installation.
  • Improved: Admin settings fields, including video and category slug controls, stack more naturally on smaller screens.
  • Improved: Homepage carousel hero spacing, category section ordering, and mobile section rhythm are more consistent across VideoHub layouts.

PVH Comments

  • Improved: Pending comments now surface in the VideoHub admin menu count for users who can moderate comments.
  • Improved: Comment moderation status tabs keep administrators inside the VideoHub admin context.
  • Improved: Frontend comment loading is more stable when visitors move between videos, shorts, sort options, and comment panels quickly.
  • Improved: Empty comment sections now keep a cleaner no-comments state and only show pagination controls when more approved comments are available.

PVH Search

  • Improved: Primary type filters such as All, Videos, Shorts, Playlists, and Live can be selected without immediately launching a search.
  • Improved: Selected filters are applied through the search action, giving visitors a more predictable search flow.
  • Improved: Active filter display is cleaner, with less duplicated UI and a clearer reset action near the primary filter row.
  • Improved: Mobile spacing around the search interface is more comfortable on homepage, category, shorts, playlist, and archive pages.

Refinements

  • Fixed: A filter panel toggle case where the PVH Search drawer could fail to open in some layouts.
  • Fixed: A comment pagination edge case where "Load more comments" could remain visible when a video or short had no approved comments.

Version 1.8.0

June 25, 2026

Mobile experience polish, Shorts playback improvements, safer premium playback, cleaner addon workflows, and critical responsive fixes.

Mobile Experience & Responsive Polish

  • Improved: Mobile video cards now use cleaner spacing, better title wrapping, and more consistent author/view metadata alignment.
  • Improved: Homepage sections adapt more naturally in both carousel and grid modes across phone, tablet, and desktop breakpoints.
  • Improved: Single video layouts keep player overlays, author blocks, action areas, and purchase prompts easier to read on small screens.
  • Improved: Playlist item labels and premium price badges remain readable over thumbnails and active playlist backgrounds.
  • Improved: Channel and profile mobile headers now use stronger contrast, full-width summary panels, and better dark-theme readability.
  • Improved: Upload and edit screens are smoother on mobile, including seller payout profile updates without leaving the current page.

Shorts & Player Experience

  • Improved: Shorts carousel arrows now sit in more natural positions, hide when scrolling is not needed, and behave better on mobile.
  • Improved: Shorts thumbnails have a clearer play affordance on hover/focus without adding visual clutter.
  • Improved: Fullscreen Shorts autoplay is more reliable when moving between slides and when continuing to the next short.
  • Improved: Shorts progress controls are easier to use because title, author, and description content no longer blocks the seek area.
  • Improved: Volume behavior is more consistent for uploaded videos and embedded Shorts after the user interacts with playback.

Core UI, Search & Addon Workflows

  • Improved: Search filters no longer flash an empty active-filter state during initial page load.
  • Improved: Author/profile links only become clickable when the related Auth or Channels addon is available.
  • Improved: Self-hosted videos without thumbnails now get lightweight browser-side preview placeholders without generating server image files.
  • Improved: Addon cards now present pricing, installed state, license state, renewal details, and dependency information more clearly.
  • Improved: Dashboard cards now respect optional addon availability so addon-dependent panels do not appear when the addon is inactive.
  • Improved: Admin video and shorts lists include a dedicated views column for quicker content review.
  • Improved: Admin-only playback diagnostics now provide clearer server/browser/network reports while staying unloaded for regular visitors.

Critical Fixes

  • Fixed: Protected playback failures caused by optimized/proxied video URLs being wrapped by premium secure streaming in the wrong order.
  • Fixed: Unavailable profile links could lead to 404 pages when Auth or Channels were inactive.
  • Fixed: Responsive conflicts that could misalign premium overlays, channel headers, or addon license details on mobile screens.

Version 1.7.0

March 31, 2026

Premium Content WooCommerce order meta fix, Marketplace reliability, PVH Live Chat profanity filter, and admin improvements.

💳 Premium Content (WooCommerce)

  • NEW: Public order line meta key pvh_video_info (ORDER_ITEM_VIDEO_SUMMARY_KEY) stores a readable video summary (title, ID, price) at checkout
  • Fixed: WooCommerce admin order item details no longer show an empty meta area when internal _pvh_video_id, _pvh_video_title, and _pvh_video_price are hidden via woocommerce_hidden_order_itemmeta
  • Improved: woocommerce_order_item_get_formatted_meta_data — legacy line items that only had hidden internal keys now receive a synthetic visible row; placeholder id new-pvh-{order_item_id} follows WooCommerce save rules for editable orders
  • Improved: woocommerce_order_item_display_meta_key — maps pvh_video_info to the translated "Video" label in admin and meta edit table
  • Improved: format_video_line_summary_value() helper for consistent summary formatting

🏪 Marketplace & VideoHub admin

  • Improved: Vendor payout profile addon path handling, IBAN mod-97 validation, uninstall cleanup
  • Improved: Earnings — available dates, statistics SQL, top lists, insert safety
  • Improved: Withdrawals — ordering, currency checks, safer reject transaction handling
  • Improved: WooCommerce marketplace hooks — full refund flows, gross amount filter, refund meta deduplication
  • Improved: Marketplace settings resolution and vendor dashboard toggle
  • Improved: Admin notices, settings URLs, sanitize/merge on save, VideoHub settings persistence
  • Improved: Vendor public — dashboard flag, AJAX vendor verification, earning estimate currency
  • Improved: Admin dashboard marketplace earnings table queries and wc_price display

💬 PVH Live Chat (addon v1.0.2)

  • NEW: Profanity filter — "Blocked words or phrases" at the bottom of VideoHub → Settings → Chat; stored as profanity_blocklist inside pvh_live_chat_settings
  • Improved: Case-insensitive substring matching (UTF-8 via mb_stripos when available); up to 80 characters per line
  • Improved: Filtered messages show a standard English notice for all viewers except administrators; only manage_options users see original text — message authors see the placeholder like other viewers
  • Improved: Output-side filtering only; database text unchanged; message_filtered flag and pvh-chat-message-filtered class for styling
  • Fixed: Message cache uses raw rows and per-request formatting so profanity filtering and delete permissions are correct per user (cache key _messages_v2)

Version 1.6.1

March 2026

Hero Section customization, Comments addon profile tab, and UI improvements!

🎬 Hero Section - Multiple Layouts

  • NEW: 4 different hero layout options - Featured Hero, Magazine Style, Single Hero, Grid Style
  • NEW: Visual preview cards for layout selection in admin settings
  • NEW: Separate CSS files for each layout (hero-base.css, hero-netflix.css, hero-magazine.css, hero-single.css, hero-grid.css)
  • NEW: Separate PHP templates for each layout
  • NEW: Responsive design for all layouts (desktop, tablet, mobile)
  • NEW: Auto-recommended video count based on selected layout

🎯 Hero Video Customization

  • NEW: Video Source selection - Trending Videos (Auto) or Custom Selection
  • NEW: Custom video picker with AJAX search
  • NEW: Drag-to-reorder selected videos (jQuery UI Sortable)
  • NEW: Remove videos with X button
  • NEW: Selected videos displayed with blue border for visibility
  • NEW: Fallback to trending if no custom videos selected

💬 Comments Addon - Profile Tab

  • NEW: "Comments" tab added to user profile page
  • NEW: List all user's comments across videos
  • NEW: Inline comment editing with save/cancel buttons
  • NEW: Comment deletion with confirmation modal
  • NEW: Comment card shows video thumbnail, title, date, likes/dislikes
  • NEW: AJAX-powered edit and delete functionality
  • NEW: Responsive design for mobile

🔧 Bug Fixes & Improvements

  • Fixed: Featured hero styles now properly scoped to prevent theme conflicts
  • Fixed: Magazine layout medium cards now stack vertically (not side by side)
  • Fixed: Hero layouts no longer conflict with each other's CSS
  • Improved: Hero video selector UI - cleaner design, no thumbnails, full-width input
  • Improved: Admin settings hero layout selector uses full available width

Version 1.6.0

February 2026

Major release: NEW Ads addon for video monetization, Navigation Panel addon, Admin Dashboard, Auth addon enhancements with Watch History & Liked Videos, and Search addon improvements!

💰 NEW: Ads Addon

  • NEW: Pre-roll ads - Show ads before video playback (works with all video types)
  • NEW: Mid-roll ads - Show ads during video playback (self-hosted videos only)
  • NEW: Display ads - Above video, below video, and below comments positions
  • NEW: In-feed ads - Inject ads between videos in grids and carousels
  • NEW: Shorts ads - Full-screen ads between shorts while scrolling
  • NEW: Ad type support - Custom HTML/AdSense code or Image + URL
  • NEW: Skip button with customizable countdown timer
  • NEW: Impression and click tracking with statistics
  • NEW: Ad statistics dashboard with daily breakdown
  • NEW: Premium user ad hiding (for Premium Content/Marketplace purchasers)
  • NEW: YouTube/Vimeo embed support for pre-roll ads
  • NEW: Settings page integrated into VideoHub Settings

🎯 NEW: Navigation Panel Addon

  • NEW: Collapsible sidebar navigation panel
  • NEW: Customizable menu items (Home, Explore, Subscriptions, Library, History, Liked Videos, My Videos, My Channel)
  • NEW: Video categories section with video count badges
  • NEW: User subscriptions section with channel avatars
  • NEW: Panel position settings (left/right)
  • NEW: Adjustable panel width and collapsed width
  • NEW: Mobile drawer support with hamburger menu
  • NEW: Dark mode support
  • NEW: Lucide icons integration
  • NEW: Settings page for full customization

📊 NEW: Admin Dashboard

  • NEW: Real-time statistics overview (videos, shorts, playlists, live streams)
  • NEW: Total views and channel statistics
  • NEW: Top 10 most viewed videos leaderboard
  • NEW: Top 10 channels by total views
  • NEW: Top uploaders ranking
  • NEW: Recent videos list with quick actions
  • NEW: Active live streams monitoring
  • NEW: System health checks with root cause analysis
  • NEW: FFmpeg status detection
  • NEW: Disk space monitoring with warnings
  • NEW: Directory permissions checker
  • NEW: Storage usage breakdown (videos, HLS, temp)
  • NEW: Quick links and documentation access

👤 Auth Addon Enhancements

  • NEW: Watch History tab in user profile
  • NEW: Liked Videos tab in user profile
  • NEW: Settings to enable/disable history and liked tabs
  • NEW: Clear all history functionality
  • NEW: Remove individual history items
  • NEW: Watch history database table with timestamps

🔍 Search Addon Improvements

  • NEW: Customizable search filters via settings page
  • NEW: Enable/disable individual filters (category, tag, duration, date, sort)
  • NEW: Filter order customization
  • NEW: Improved filter UI consistency

🔧 Bug Fixes & Improvements

  • Fixed: Permalink flush on addon activation (no more 404 errors)
  • Fixed: Core CSS styling issues
  • Fixed: Live Chat addon CSS problems
  • Improved: Addon activation now auto-flushes rewrite rules

Version 1.5.0

February 2026

Major release: NEW Marketplace addon for multi-vendor video sales! Complete earnings system, withdrawal management, and admin dashboard with sales analytics.

🏪 NEW: Marketplace Addon

  • NEW: Complete vendor earnings system with automatic commission calculation
  • NEW: Vendor payout profiles with bank/IBAN details
  • NEW: Withdrawal request system with admin approval workflow
  • NEW: Configurable holding period before earnings become available
  • NEW: Minimum withdrawal amount setting
  • NEW: Admin dashboard with sales overview charts (Week/Month/Year)
  • NEW: Top vendors and top selling videos leaderboards
  • NEW: Pending earnings and withdrawals badges with pulse animation
  • NEW: Quick action buttons for releasing earnings and processing withdrawals
  • NEW: WooCommerce order integration for automatic earning creation
  • NEW: Refund handling with withdrawn earnings protection
  • NEW: Vendor profile tab in WooCommerce My Account
  • NEW: Earnings history and withdrawal status for vendors
  • NEW: Comprehensive hook system for third-party integrations
  • NEW: Cron job for automatic pending earnings release

🔧 Bug Fixes & Improvements

  • Fixed: Self-hosted video playback issues on video and shorts pages
  • Fixed: User avatar display on video and shorts pages
  • Fixed: Mark as Paid button not working for withdrawals
  • Fixed: ORDER BY SQL sanitization issues in marketplace queries

🛠️ Developer Improvements

  • Enhanced: Hook system with 50+ new action and filter hooks
  • Added: Marketplace-specific hooks for earnings, withdrawals, and vendor profiles
  • Added: Comprehensive DEVELOPER-HOOKS.md documentation
  • Improved: Video lifecycle hooks documentation

Version 1.4.0

January 2026

Major release: NEW Media Optimizer addon for self-hosted videos with FFmpeg-powered optimization. Massive mobile performance improvements!

🚀 NEW: Media Optimizer Addon

  • NEW: Auto-optimize self-hosted MP4 videos with FFmpeg
  • NEW: Background processing via WP-Cron queue system
  • NEW: Fast Start (moov atom) - videos play instantly on mobile
  • NEW: Mobile-compatible yuv420p encoding for universal device support
  • NEW: Quality presets: Fast, Balanced, Quality
  • NEW: Resolution control: 480p, 720p, 1080p max options
  • NEW: Duplicate protection - same video never processes twice
  • NEW: Safe fallback to original video if optimization fails
  • NEW: Per-video optimization status in admin
  • NEW: Admin settings page with FFmpeg detection
  • NEW: WP-Cron warning for low-traffic sites
  • NEW: pvh_video_optimized action hook for addon integration
  • NEW: Player auto-switches to optimized version when available
  • NEW: Original file preservation option
  • NEW: Processing timestamps (queued_at, started_at, finished_at)

🔧 Core Improvements

  • Improved: Upload hook pvh_video_uploaded triggered after video save
  • Improved: Player filters video source via pvh_video_player_source
  • Improved: URL validation for optimized video sources

Version 1.3.2

December 2025

Major improvements: Live stream layout, video re-upload, mobile responsive, search filters overhaul.

📺 Live Streaming Addon - Layout & Theme Compatibility

  • Improved: Live stream single page now displays correctly on all themes
  • Improved: Theme-agnostic CSS approach - no longer overrides header/footer styles
  • Improved: Content container properly contained within theme layout
  • Improved: Video player and sidebar grid layout optimized for live streams
  • Added: Inline CSS reset targeting only plugin content elements
  • Added: Responsive grid layout (1fr + 402px sidebar on desktop, single column on mobile)

📤 Uploads Addon - Video Re-upload & Thumbnail Fixes

  • Added: Video re-upload feature for missing/deleted video files
  • Added: "Video Not Found" notice with upload button when video file is missing
  • Added: Server-side video file existence check for self-hosted videos
  • Added: AJAX handler for video re-upload with progress indicator
  • Added: Automatic old attachment cleanup on re-upload
  • Fixed: Thumbnail upload button infinite recursion error
  • Improved: Video edit page now detects and handles missing video files gracefully

📱 Auth Addon - Mobile Responsive Improvements

  • Improved: Profile page video titles now display fully without truncation on mobile
  • Improved: Shorts cards now show title overlay on mobile devices
  • Added: Short title element to profile shorts grid template
  • Added: CSS styles for pvh-short-title with text shadow for readability
  • Improved: Shorts card minimum height increased for better visibility
  • Improved: Shorts overlay always visible on mobile for better UX

📺 Channels Addon - Mobile Button Layout

  • Improved: Channel action buttons stack vertically on mobile (480px and below)
  • Improved: View Channel and Edit Channel buttons now full-width on mobile
  • Improved: Subscribe button properly sized and positioned on mobile
  • Added: Flex-wrap and responsive gap for button containers

🔍 Search Addon - Filter System Overhaul (v1.1.0)

  • Improved: All filter types (Videos, Shorts, Playlists) now work correctly
  • Improved: Upload date filter properly filters search results
  • Improved: Duration filter (Short, Medium, Long) functioning correctly
  • Improved: Sort by options (Relevance, Date, Views) working as expected
  • Improved: Category filter integration with search results
  • Improved: Filter state persistence when navigating between pages
  • Improved: Apply Filters button now triggers search with selected filters
  • Improved: URL parameter handling for filter state
  • Improved: Filter chips visual feedback for active filters

🎨 CSS & UI Enhancements

  • Improved: Category page inline CSS for consistent layout
  • Improved: Video grid responsive behavior on all screen sizes
  • Improved: Shorts carousel card sizing on mobile (140px width, 250px height)
  • Improved: Profile section video card hover effects
  • Added: Theme-agnostic container reset for live stream pages
  • Added: Sidebar hiding for live stream single pages

🛠️ Code Quality & Performance

  • Improved: CSS specificity targeting only plugin elements
  • Improved: Event handling in uploads.js to prevent recursion
  • Improved: File existence validation before video playback
  • Removed: Aggressive theme CSS overrides that affected header/footer

Version 1.3.1

November 2025

Critical search addon fixes: AJAX, filters, modern design, debug cleanup.

🔍 Search Addon - Major AJAX & Filter Fixes (PVH Search v1.1.0)

  • Fixed: AJAX search returning "-1 Forbidden" error due to multiple pvh_search script localizations causing nonce mismatch
  • Fixed: Prevented duplicate enqueue_assets() calls with $assets_enqueued flag
  • Fixed: Removed duplicate script localization from load_search_template and inline template
  • Fixed: Shorts and Playlist type filters not carrying over when navigating from other pages to search page
  • Fixed: goToSearchPage now passes all active filters (type, upload_date, duration, sort_by, category) as URL parameters
  • Fixed: checkUrlParams now reads filter parameters from URL and activates corresponding chips and filter buttons
  • Fixed: "Apply filters" button now triggers search (previously only closed the panel)
  • Fixed: Filter button clicks no longer auto-search; user selects filters then clicks "Apply" for batch application
  • Fixed: Inline search script race condition - now polls for PVHSearch availability and skips if checkUrlParams already started search
  • Improved: Modern card-based design for search results on desktop and mobile
  • Improved: Search result cards with 12px border-radius, clean typography, and proper spacing
  • Improved: Responsive search results - full-width cards on mobile, side-by-side on desktop
  • Improved: Thumbnail styling with 8px border-radius and 280px width on desktop
  • Improved: Duration badge with monospace font for better readability
  • Removed: All debug console.log statements from search.js
  • Removed: All debug file logging from pvh-search.php AJAX handler
  • Removed: All debug inline script logs from search-results.php template
  • Removed: debug-ajax.log file

Version 1.3.0

October 2025

Major update with new Live Chat addon and external addon support!

💬 New Addon: PVH Live Chat

  • Added: Real-time chat system for videos and live streams
  • Added: Video sidebar chat panel UI with modern design
  • Added: Adaptive polling (3s active, 10s slow, 25s idle)
  • Added: Message rate limiting (user + IP based)
  • Added: Typing indicators with debounce
  • Added: Soft delete with audit trail (deleted_at, deleted_by)
  • Added: Permission system (purchasers only for premium content)
  • Added: Delete permissions for message author, admin, and content owner
  • Added: XSS protection with sanitize pipeline
  • Added: Cache layer with Object Cache + Transient fallback
  • Added: Cache version mechanism for stale cache detection
  • Added: Transport interface for future WebSocket/Pusher support
  • Added: REST API endpoints (fetch, send, typing, delete)
  • Added: Admin settings tab with polling intervals and rate limits
  • Added: Uninstall cleanup with optional data deletion
  • Added: Database tables with optimized indexes (room_id, id)

🔧 Addon Manager - External Plugin Support

  • Added: Support for addons installed as separate WordPress plugins
  • Added: PVH Addon header detection (PVH Addon: true)
  • Added: Auto-activation for external plugin addons
  • Added: register_external_addon() method for programmatic registration
  • Added: is_external_addon() helper method

⚙️ Settings System - Dynamic Addon Tabs

  • Added: pvh_settings_tabs filter for addon settings tabs
  • Added: pvh_settings_tab_content_{tab} action for tab content
  • Added: pvh_settings_save action for addon settings save
  • Added: Automatic form handling with nonce verification

🎬 Template Hooks

  • Added: pvh_video_sidebar_top hook for video page sidebar
  • Added: pvh_live_stream_sidebar_top hook for live stream sidebar

🛡️ Security & Performance

  • Added: IP-based brute-force protection for chat
  • Added: Server-side hard limit clamp (min 1, max 100 messages)
  • Added: Defensive null/array checks throughout codebase
  • Added: Cache invalidation on message send
  • Improved: Rate limiting with transient-based tracking

📐 Template Width Fixes

  • Fixed: Category archive page now full-width (removed theme container conflicts)
  • Fixed: Latest videos page full-width layout
  • Fixed: Trending videos page full-width layout
  • Fixed: Playlist archive page full-width layout
  • Fixed: Single playlist page full-width layout
  • Fixed: Search results page full-width layout
  • Added: pvh-full-width body class for template pages

🔍 Search Addon Fixes

  • Fixed: Search bar not loading on category pages
  • Fixed: Search bar not loading on latest videos page
  • Fixed: Search bar not loading on trending videos page
  • Fixed: Search bar not loading on playlist pages
  • Fixed: Search addon now loads on all VideoHub template pages
  • Improved: Conditional asset loading for search addon

🎬 Playlist Template Fixes

  • Fixed: Playlist archive page layout and styling
  • Fixed: Playlist card hover effects
  • Fixed: Playlist video count display
  • Fixed: Playlist thumbnail grid layout
  • Improved: Playlist page responsive design

📹 Video Edit Page Fixes

  • Fixed: Embed videos from other sites not displaying in preview
  • Fixed: Video source detection for embed codes
  • Fixed: iframe embed preview in admin editor
  • Improved: Video URL vs embed code handling

🎨 UI/UX Improvements

  • Fixed: Various template container width issues
  • Fixed: Theme conflicts on archive pages
  • Improved: Consistent full-width layout across all VideoHub pages
  • Improved: Mobile responsive layouts for all templates

Version 1.2.1

September 2025

Major update with new PWA addon and dozens of fixes!

📱 New Addon: PVH PWA (Progressive Web App)

  • Added: Transform VideoHub into an installable mobile app
  • Added: Dynamic manifest.json via REST API endpoint
  • Added: Service Worker with offline fallback support
  • Added: Install prompt banner for Chrome/Edge and iOS Safari
  • Added: PWA mode detection with body classes
  • Added: Hide header/footer options in standalone mode
  • Added: Customizable app name, icons, theme colors
  • Added: Admin settings in Mobile tab with detailed help texts
  • Added: iOS Safari apple-touch-icon support
  • Added: Inline offline fallback page (no WP dependency)
  • Added: Cache-Control no-store header for manifest

⚙️ Homepage Settings Fixes

  • Fixed: Featured Channels settings not saving issue
  • Added: show_featured_channels sanitization in sanitize_homepage_options
  • Added: featured_channels_title, featured_channels_count, featured_channels_orderby fields

📺 Channels Addon - Major Updates

  • Added: Channels archive page template (/channels/)
  • Added: Modern channel cards with banner, avatar, stats
  • Added: Search functionality for channels
  • Added: Sort by subscribers, newest, oldest, name (A-Z)
  • Added: Pagination (24 channels per page)
  • Added: Responsive grid (4 → 3 → 2 → 1 columns)
  • Added: Empty state with "Create Channel" button
  • Added: Automatic rewrite rules flush on activation
  • Fixed: "See all" link now works correctly
  • Fixed: Icon spacing in channels archive page header
  • Fixed: Channels archive page now full-width
  • Fixed: Avatar clipping issue in homepage channel cards

📺 Channel Detail Page Improvements

  • Improved: Stats (Subscribers, Videos) moved to top-right corner on desktop
  • Improved: Description positioned below avatar and name
  • Improved: Avatar sizing optimized (90px mobile, 120px desktop)
  • Improved: Mobile layout - vertical stacking, centered elements
  • Fixed: Banner height adjustments (180px mobile, 220px desktop)

📺 Channel Profile Tab Visibility

  • Fixed: Other users can now see public channels on profiles
  • Added: "Channel" tab visible on other users' profiles
  • Added: Subscribe button on other users' channel tab
  • Fixed: Private/Unlisted channels hidden from other users

🔐 Auth Addon - Login Redirect Fix

  • Fixed: Login now redirects to current page instead of homepage
  • Added: current_url parameter sent from JavaScript
  • Improved: User stays on the same page after login

🔍 Search Addon Improvements

  • Improved: Desktop layout - user menu/auth moved to left, search centered, filter on right
  • Improved: Search button now shows only icon (text removed for cleaner UI)
  • Added: CSS media query for 1024px+ desktop layout

📱 Mobile Bottom Navigation Bar (NEW!)

  • Added: Bottom navigation bar for mobile devices
  • Added: Home, Videos, Shorts, Categories, Profile tabs
  • Added: Active state highlighting for current page
  • Added: Smooth animations and transitions
  • Added: Auto-hide on scroll down, show on scroll up
  • Added: Safe area support for notched devices (iPhone X+)
  • Added: Settings to enable/disable in Mobile tab
  • Added: Customizable tab visibility options

🎨 UI/UX Improvements

  • Improved: Channel card avatar sizing with min-width/min-height
  • Improved: Object-position center for better avatar display
  • Fixed: Theme container conflicts on channels archive page
  • Improved: Channel profile card stats positioning
  • Added: Multiple body classes for PWA mode styling

Version 1.2.0 - Big Update 🎉

August 2025

Major release with 3 new addons and significant improvements!

🔐 New Addon: PVH Auth

  • Added: Complete frontend authentication system
  • Added: Custom login page at /login/
  • Added: Custom registration page at /register/
  • Added: User profile pages at /profile/{username}/
  • Added: Profile editing with avatar and cover image upload
  • Added: User dropdown menu in header
  • Added: Configurable registration fields
  • Added: Social links support on profiles
  • Added: Extensible profile tabs system

📺 New Addon: PVH Channels

  • Added: Channel system with public channel pages
  • Added: Channel creation from frontend
  • Added: Channel customization (banner, avatar, description)
  • Added: Unique @handle for each channel
  • Added: Subscriber system with counts
  • Added: Channel tabs (Videos, About, Playlists)
  • Added: Channel visibility options (Public, Unlisted, Private)
  • Added: Admin approval workflow for channels
  • Added: Multiple channels per user option

📤 New Addon: PVH Uploads

  • Added: Frontend video upload system
  • Added: Modern drag & drop upload interface
  • Added: Real-time upload progress tracking
  • Added: Video details form (title, description, category, tags)
  • Added: Custom thumbnail upload
  • Added: Video visibility options
  • Added: Daily and monthly upload quotas
  • Added: Video moderation/approval workflow
  • Added: Duplicate upload prevention

🎬 Video Status System

  • Added: Pending video status with "under review" message
  • Added: Suspended video status with reason display
  • Added: Status notices for video owners
  • Added: Video unavailable page for non-accessible videos

⚙️ Settings & UI Improvements

  • Added: Auth, Channels, Uploads settings tabs
  • Improved: Upload page with guided publishing design
  • Improved: Video edit page styling
  • Improved: Profile and channel page layouts
  • Fixed: JavaScript infinite recursion on upload page
  • Fixed: WP_Error handling in video edit page
  • Fixed: Taxonomy name mismatches

Version 1.1.8

July 2025
  • Fixed: Shorts like/dislike functionality now persists correctly after page refresh
  • Fixed: Shorts titles visibility on archive page - now always visible on mobile, hover on desktop
  • Fixed: Shorts titles color changed to white with text shadow for better readability
  • Fixed: Mobile Plyr player play button now hides correctly during video playback
  • Fixed: Double progress bar issue on Plyr video player
  • Fixed: Settings menu text visibility in Plyr player
  • Improved: User like tracking system for Shorts with database persistence
  • Improved: Mobile responsive styles for Shorts player

Version 1.1.7

June 2025
  • Fixed: Self-hosted provider API test now returns success message
  • Fixed: Vimeo API key instructions updated with correct URL
  • Improved: API key testing feedback messages

Version 1.1.6

May 2025
  • Added: Legacy package conflict detection and auto-deactivation
  • Fixed: Plugin conflict when multiple VideoHub packages are active
  • Improved: License activation flow

Version 1.1.5

April 2025
  • Added: Plyr video player integration for self-hosted videos
  • Added: Custom video player controls and styling
  • Improved: Video player responsive behavior on mobile devices

Version 1.1.4

March 2025
  • Added: Premium Content addon for selling videos
  • Added: WooCommerce integration for video purchases
  • Improved: Video card hover effects

Version 1.1.3

February 2025
  • Added: Live Streaming addon
  • Added: Supported provider and custom stream support
  • Fixed: Video thumbnail generation for YouTube Shorts

Version 1.1.2

January 2025
  • Added: Author profile page with video statistics
  • Added: Video filtering by author
  • Improved: Related videos algorithm

Version 1.1.1

December 2024
  • Fixed: Bulk import progress indicator
  • Fixed: Category filter on videos page
  • Improved: Admin UI styling consistency

Version 1.1.0

November 2024
  • Added: Bulk video import from YouTube playlists and channels
  • Added: Video duration display on thumbnails
  • Added: Trending videos section
  • Improved: Homepage layout options
  • Improved: Mobile navigation

Version 1.0.0

October 2024
  • Initial Release
  • Video custom post type
  • Category and tag taxonomies
  • YouTube, Vimeo, Dailymotion support
  • Self-hosted video support
  • View counter
  • Related videos
  • Autoplay feature
  • Playlist system
  • Addon system
  • Shortcodes
  • Responsive templates
  • PVH Shorts addon
  • PVH Search addon
  • PVH Reactions addon
  • PVH Comments addon