Plugin Docs
Everything you need to install, configure, and use the apiJAV WordPress plugin system — v3.4.0.
Introduction
apiJAV is a WordPress plugin system that lets you host videos on one WordPress site (server) and import and display them on another (client) — automatically, with full metadata, taxonomy support, permanent embed URLs, and an auto-import scheduler.
Client Plugin — APIJAV v3.4.0
Connects to the server, lets you browse, filter, import, and manage videos locally with full meta and taxonomy sync.
Bulk Import
Import thousands of videos by page range in one click. Real-time progress, pause/resume/cancel, duplicate detection.
Auto-Import Scheduler
Set a cron schedule (6h / 12h / 24h) to automatically pull new videos from the server without manual intervention.
Webhook Receiver
Server can push new post notifications instantly. Client auto-imports triggered posts in real time via HMAC-signed webhooks.
Stats Sync
Automatically sync view counts and like counts from the server on a schedule. Keep your local posts up-to-date.
Permanent Tokens
Embed URLs are generated with permanent tokens — safe to store in your database forever. Never need refreshing unless server keys change.
How It Works
The system works as a source-destination pair. Your server site holds the original video posts. Your client site pulls them via REST API and creates local WordPress posts with all metadata preserved.
Server Site (My Video API Manager) └─ Hosts original video posts └─ Exposes REST API at /wp-json/myvideo/v1/ └─ Generates permanent embed tokens └─ Sends webhooks on new post publish ↕ REST API calls over HTTPS Client Site (APIJAV v3.4.0) └─ Browses server via admin panel └─ Bulk imports with live progress └─ Auto-scheduler pulls new posts (6h/12h/24h) └─ Webhook receiver for instant push └─ Stats sync updates views/likes on schedule └─ Stores embed URL permanently in post meta └─ Theme renders iframe from stored meta
Features — v3.4.0
- Browse & Search — filter by category, tag, actor, studio, date, views
- Bulk Import — import by page range (e.g. page 26 → 1), up to 1000 videos per page
- Import All — one-click import of all available videos across all pages
- Import Queue — background queue processes imports without blocking the browser
- Auto-Import Scheduler — cron-based scheduler: every 6h, 12h, or 24h. Filter by category/tag/studio
- Stats Sync Scheduler — separate cron to sync view/like counts from server on a schedule
- Webhook Receiver — receive instant push notifications from server; HMAC-signed for security
- Duplicate Detection — single SQL batch query checks thousands of IDs instantly
- Live Progress — real-time progress bar, per-row status, pause/resume/cancel controls
- Auto Page Switch — table view automatically follows the currently importing page
- Cache Control — configurable transient cache + one-click clear
- Taxonomy Sync — categories, tags, actors, studios all created locally on import
- Thumbnail Localization — optionally download thumbnails to your local media library
- Sync-on-Duplicate — optional mode to update existing posts instead of skipping
- API Key Auth — optional X-API-Key header support for private servers
Download
The plugin zip contains everything: the client plugin (APIJAV v3.4.0) plus the recommended theme. Download it for free from the link below.
APIJAV Plugin & Theme v3.4.0
Includes: Client plugin · Recommended theme · Full feature set
Requirements
| Requirement | Minimum | Notes |
|---|---|---|
| WordPress | 5.8+ | REST API must be enabled (default) |
| PHP | 8.0+ | Plugin uses PHP 8.x typed properties |
| MySQL | 5.7+ / MariaDB 10.3+ | For import queue table |
| Server | Any WP REST API site | Running My Video API Manager plugin |
| HTTPS | Recommended | Required for webhook registration |
Client Plugin — Installation
Install APIJAV on the WordPress site where you want to import and display videos.
Download the Plugin
Download apijav-v3.4.0.zip — contains the plugin and theme.
Upload & Activate
Go to Plugins → Add New → Upload Plugin. Upload my-video-public-api.zip and activate.
Enter API URL
Go to APIJAV → Settings and enter your server site's URL (e.g. https://server.apijav.com). Click Save, then Test Connection.
Install the Theme
Go to Appearance → Themes → Add New → Upload Theme. Upload the theme zip from the download package and activate it.
Start Importing
Go to APIJAV → Browse Videos to import individually, or APIJAV → Bulk Import to import thousands at once.
Connecting to the Server
In APIJAV → Settings, enter the full URL of your server site — no trailing slash, no /wp-json path.
✅ Correct: https://server.apijav.com https://myserver.com https://hentai.apijav.com ❌ Wrong: https://server.apijav.com/ # trailing slash https://myserver.com/wp-json # don't add the path
| Setting | Description |
|---|---|
| api_url | Server site URL. Required. No trailing slash. |
| api_key | Optional. Sent as X-API-Key header. Configure the same key on the server. |
| per_page | Default posts per page for Browse. Max 100. |
| cache_minutes | How long to cache API responses. 0 = no cache. |
| localize_thumbs | Download thumbnails to local media library instead of hotlinking. |
| sync_on_duplicate | Update existing posts instead of skipping on re-import. |
Browse Videos
The Browse Videos page lets you search and filter the server's videos and import them one at a time.
- Search — filter by keyword, category, tag, actor, studio
- Import button — each card has an ⬇ Import button. Already-imported videos show a green ✅ badge
- Batch check — imported status is checked in a single DB query per page load
- Preview — click ▶ Preview to open the player modal before importing
Bulk Import
The Bulk Import page lets you import thousands of videos in a single session with real-time progress tracking.
Step 1 — Choose Filter
Select a Category, Tag, and/or Studio to narrow the import, or leave all blank to import everything. Set Videos Per Page (100, 500, or 1000).
Click Load Video Info to see the total count and page count. This automatically clears stale cache so you always get accurate numbers.
Step 2 — Set Page Range
Set From Page and To Page. Import always runs highest page → lowest (oldest-first, newest-last).
Or click ⚡ Import All Pages to queue every page automatically.
Step 3 — Start Import
Click ▶ Start Import. The system will:
- Load all pages in the queue sequentially
- Check which videos are already imported (batch SQL query — no per-video queries)
- Build a flat queue of only new videos
- Import them one by one with 150ms between each
- Auto-update the table view as each page completes
Controls
- ▶ Start / ⏸ Pause / ▶ Resume — pause and resume at any point, safely
- ✕ Cancel — stops the import; already-imported posts are retained
- Live stats — shows Imported / Already Imported / Errors / Remaining in real time
| Delay | When |
|---|---|
| 150ms | Between each successful import |
| 500ms | After a failed import (retry buffer) |
Import Queue
The Import Queue is a database-backed background task system. When bulk imports or the scheduler adds jobs, they go into a queue table (wp_mvapic_queue) and are processed via WP-Cron.
- Jobs persist across page reloads and server restarts
- Each job has a status:
pending,processing,done,error - The queue table is created on plugin activation and updated safely on every load
- View queue status under APIJAV → Queue
Auto-Import Scheduler
The Scheduler automatically imports new videos from the server without any manual action. Configure it under APIJAV → Scheduler.
Auto-Import Cron
| Setting | Description |
|---|---|
| Enabled | Turn automatic importing on/off |
| Schedule | Every 6 hours, 12 hours, or 24 hours |
| Per Run | Maximum videos to import per cron run |
| Category / Tag / Studio | Optional filters — only import matching content |
Stats Sync Cron
A separate cron job syncs view and like counts from the server to your local posts. Configure independently with its own schedule.
Webhook Receiver
The webhook system allows the server to push notifications instantly when a new post is published. Your client site imports it in real time without waiting for the next cron run.
Setup
- Go to APIJAV → Webhook on your client site
- Enable the webhook receiver and copy your webhook URL
- Click Auto Register to automatically register your client URL on the server, or enter it manually in the server's webhook settings
Security
All webhook payloads are verified using HMAC-SHA256 signatures. The shared secret is auto-generated on activation. Without the correct secret, incoming payloads are rejected with HTTP 403.
| Setting | Description |
|---|---|
| enabled | Enable/disable the webhook REST endpoint |
| secret | 32-char auto-generated HMAC secret. Must match server. |
| auto_register | Automatically register this client's URL on the server on save |
Webhook endpoint: /wp-json/mvapic/v1/webhook
Import by ID
Go to APIJAV → Import by ID to import a single video by its remote post ID. You can preview the player before importing.
Remote Post ID: 12345 → Fetches from: https://server.apijav.com/wp-json/myvideo/v1/posts/12345 → Creates local post with all meta + embed URL
Imported Posts
The Imported Posts page shows all locally imported videos. From here you can:
- Edit — open the WordPress post editor
- Play — open the embed URL in a new tab
- Refresh All Embeds — re-fetches embed URLs from the server (only needed if server secret keys changed)
Meta Fields
Each imported post gets these WordPress post meta fields, which your theme can read:
| Meta Key | Content |
|---|---|
| embed | Full iframe HTML — ready to output via ACF or get_post_meta. |
| embed_url | Plain embed URL without iframe wrapper. |
| thumb | Thumbnail image URL (or local URL if localization on). |
| post_views_count | View count from the source server. |
| likes_count | Like count from the source server. |
| dislikes_count | Dislike count. |
| hd_video | 'on' if HD, empty string if not. |
| code | Video code/ID from the server (used for duplicate detection). |
| duration_hh | Duration hours component. |
| duration_mm | Duration minutes component. |
| duration_ss | Duration seconds component. |
| video_duration_combined | Full duration string, e.g. 01:23:45. |
| _mvapic_remote_id | Remote post ID — primary duplicate detection key. |
| _mvapic_server_url | Source server URL. |
Example Theme Usage
// Output the embed in your single.php or template $embed = get_post_meta( get_the_ID(), 'embed', true ); if ( $embed ) { echo $embed; // outputs the full <iframe> tag } // Or get the plain URL and thumbnail $url = get_post_meta( get_the_ID(), 'embed_url', true ); $thumb = get_post_meta( get_the_ID(), 'thumb', true ); $views = get_post_meta( get_the_ID(), 'post_views_count', true ); $hd = get_post_meta( get_the_ID(), 'hd_video', true ); // 'on' or ''
Caching
API responses are cached using WordPress transients. Duration is set in APIJAV → Settings.
- Browse Videos — cached per unique filter combination
- Filter options — cached 6 hours (
mvapic_filters_v3transient) - Bulk Import — always fetches fresh (cache bypassed)
- Embed URLs / Player — never cached, always fresh
To clear all cached data: APIJAV → Settings → Clear Cache. The Bulk Import "Load Video Info" button also clears the posts cache automatically before fetching.
Taxonomies
On import, the plugin maps server taxonomies to local WordPress taxonomies:
| Server Field | Local Taxonomy | Notes |
|---|---|---|
| categories | category (built-in) | Created if not exists |
| tags | post_tag (built-in) | Created if not exists |
| actors | actors (custom) | Must be registered by your theme |
| studio | studio (custom) | Auto-registered by the plugin on init |
actors taxonomy must be registered by your theme or a separate plugin before import. The plugin auto-registers studio but leaves actors to the theme. If not registered, actor terms are silently skipped on import.FAQ
Where do I download the plugin?
Download it free from this TG link. The zip includes both the plugin and the recommended theme.
Why does the page count change after I change per_page?
Page count is ceil(total_videos / per_page). Always click Load Video Info after changing per-page — it clears stale cache and fetches the updated count.
Can I run multiple bulk imports at the same time?
Not recommended. Two parallel imports on the same site may cause duplicate detection to miss posts mid-import. Run one at a time.
What happens if an import fails midway?
Already-imported posts are safe in your database. Failed items show a red ❌ badge. Re-run the same page range — previously imported videos are detected and skipped automatically.
Are embed URLs permanent?
Yes. Server tokens never expire. Only use Refresh Embeds if the server's WordPress secret keys were regenerated.
My categories/tags/studios dropdown is empty
Go to APIJAV → Settings → Clear Cache then reload. Filter dropdowns sample up to 100 posts from the first API page.
The webhook isn't triggering imports
Check that: (1) the receiver is enabled in APIJAV → Webhook, (2) the secret matches on both server and client, (3) the client URL is correctly registered on the server, and (4) your client site is publicly reachable over HTTPS.