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.

FLOW
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

📦 my-video-public-api.php 🎨 Theme included ⚡ Bulk Import ⏰ Scheduler 🔔 Webhook
Free Download
100% Free The plugin and theme are completely free to download and use. No license key required.

Requirements

RequirementMinimumNotes
WordPress5.8+REST API must be enabled (default)
PHP8.0+Plugin uses PHP 8.x typed properties
MySQL5.7+ / MariaDB 10.3+For import queue table
ServerAny WP REST API siteRunning My Video API Manager plugin
HTTPSRecommendedRequired for webhook registration

Client Plugin — Installation

Install APIJAV on the WordPress site where you want to import and display videos.

1

Download the Plugin

Download apijav-v3.4.0.zip — contains the plugin and theme.

2

Upload & Activate

Go to Plugins → Add New → Upload Plugin. Upload my-video-public-api.zip and activate.

3

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.

4

Install the Theme

Go to Appearance → Themes → Add New → Upload Theme. Upload the theme zip from the download package and activate it.

5

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.

Example URLs
✅ 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
SettingDescription
api_urlServer site URL. Required. No trailing slash.
api_keyOptional. Sent as X-API-Key header. Configure the same key on the server.
per_pageDefault posts per page for Browse. Max 100.
cache_minutesHow long to cache API responses. 0 = no cache.
localize_thumbsDownload thumbnails to local media library instead of hotlinking.
sync_on_duplicateUpdate 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
ℹ️
Page 1 = Newest videos — The API orders by date descending by default. Page 1 has the most recently published videos.

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.

⚠️
Last page has fewer videos — This is normal. With 25,631 videos at 1000/page, page 26 has 631 videos. The import handles this correctly and moves on automatically.

Step 3 — Start Import

Click ▶ Start Import. The system will:

  1. Load all pages in the queue sequentially
  2. Check which videos are already imported (batch SQL query — no per-video queries)
  3. Build a flat queue of only new videos
  4. Import them one by one with 150ms between each
  5. 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
DelayWhen
150msBetween each successful import
500msAfter a failed import (retry buffer)
⏱️
Estimated time: At 150ms delay, expect ~1–3 min per 100 videos. A 25,000-video import may take several hours. Use Pause/Resume freely — it picks up exactly where you left off.

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

SettingDescription
EnabledTurn automatic importing on/off
ScheduleEvery 6 hours, 12 hours, or 24 hours
Per RunMaximum videos to import per cron run
Category / Tag / StudioOptional 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.

ℹ️
Last run info — The scheduler stores the last run time, imported count, skipped count, and error count. The Scheduler page shows the last 50 run summaries.

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

  1. Go to APIJAV → Webhook on your client site
  2. Enable the webhook receiver and copy your webhook URL
  3. 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.

SettingDescription
enabledEnable/disable the webhook REST endpoint
secret32-char auto-generated HMAC secret. Must match server.
auto_registerAutomatically 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.

Example
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 KeyContent
embedFull iframe HTML — ready to output via ACF or get_post_meta.
embed_urlPlain embed URL without iframe wrapper.
thumbThumbnail image URL (or local URL if localization on).
post_views_countView count from the source server.
likes_countLike count from the source server.
dislikes_countDislike count.
hd_video'on' if HD, empty string if not.
codeVideo code/ID from the server (used for duplicate detection).
duration_hhDuration hours component.
duration_mmDuration minutes component.
duration_ssDuration seconds component.
video_duration_combinedFull duration string, e.g. 01:23:45.
_mvapic_remote_idRemote post ID — primary duplicate detection key.
_mvapic_server_urlSource server URL.

Example Theme Usage

PHP
// 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_v3 transient)
  • 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 FieldLocal TaxonomyNotes
categoriescategory (built-in)Created if not exists
tagspost_tag (built-in)Created if not exists
actorsactors (custom)Must be registered by your theme
studiostudio (custom)Auto-registered by the plugin on init
⚠️
Actors taxonomy — The 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.