PHPackages                             wefabric/wp-video-indexer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wefabric/wp-video-indexer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wefabric/wp-video-indexer
=========================

Indexes platform videos in WordPress post content as VideoObject schema markup.

v1.0.7(3mo ago)0181—2.8%proprietaryPHPPHP &gt;=7.4

Since Mar 26Pushed 3mo agoCompare

[ Source](https://github.com/wefabric/wp-video-indexer)[ Packagist](https://packagist.org/packages/wefabric/wp-video-indexer)[ RSS](/packages/wefabric-wp-video-indexer/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

wefabric/wp-video-indexer
=========================

[](#wefabricwp-video-indexer)

Indexes YouTube and Vimeo videos found in WordPress post content and ACF fields as `VideoObject` schema markup (JSON-LD).

How it works
------------

[](#how-it-works)

1. On `save_post`, the package scans `post_content` and all ACF fields for YouTube and Vimeo URLs (including iframe embed URLs).
2. For each unique video found, it fetches metadata via the platform's oEmbed API and builds a `VideoObject` schema.
3. The schemas are cached in post meta, keyed by URL. On subsequent saves, already-cached videos are reused without a new HTTP request.
4. On `wp_head` (singular pages only), the cached schemas are output as `` tags.

Installation
------------

[](#installation)

The package is available on [Packagist](https://packagist.org/packages/wefabric/wp-video-indexer).

```
composer require wefabric/wp-video-indexer:^1.0
php artisan package:discover
```

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- WordPress
- Themosis framework (for hook registration and service container)
- `wefabric/wp-support` (for `WPSupport::addHooks`)

Supported URL formats
---------------------

[](#supported-url-formats)

### YouTube

[](#youtube)

FormatExampleWatch URL`https://youtube.com/watch?v=ID`Short URL`https://youtu.be/ID`Embed iframe`https://youtube.com/embed/ID`Legacy embed`https://youtube.com/v/ID`### Vimeo

[](#vimeo)

FormatExampleStandard URL`https://vimeo.com/ID`URL with query params`https://vimeo.com/ID?fl=pl&fe=vl`Embed iframe`https://player.vimeo.com/video/ID`Channel URL`https://vimeo.com/channels/name/ID`Structure
---------

[](#structure)

```
src/
├── Hooks/
│   └── VideoIndexerHook.php            Registers save_post + wp_head, delegates to services
├── Providers/
│   └── ServiceProvider.php             Laravel service provider (auto-discovered)
└── Services/
    ├── VideoSchemaServiceInterface.php  Contract for all platform services
    ├── VideoSchemaCacheService.php      Scans content, fetches/reuses schemas, saves to post meta
    ├── VideoSchemaOutputService.php     Reads post meta and outputs JSON-LD script tags
    ├── YouTubeSchemaService.php         YouTube oEmbed fetching and schema generation
    └── VimeoSchemaService.php           Vimeo oEmbed fetching and schema generation

```

Adding a new platform
---------------------

[](#adding-a-new-platform)

Each platform is a service class implementing `VideoSchemaServiceInterface`:

```
interface VideoSchemaServiceInterface
{
    public function matches(string $url): bool;
    public function extractId(string $url): ?string;
    public function fetchSchema(string $url): array;
}
```

1. Create a new service class implementing the interface:

```
class DailymotionSchemaService implements VideoSchemaServiceInterface
{
    public function matches(string $url): bool
    {
        return strpos($url, 'dailymotion.com') !== false;
    }

    public function extractId(string $url): ?string
    {
        // extract ID from URL
    }

    public function fetchSchema(string $url): array
    {
        // fetch oEmbed data and return a VideoObject schema array
    }
}
```

2. Register it in `VideoIndexerHook::$services`:

```
protected array $services = [
    YouTubeSchemaService::class,
    VimeoSchemaService::class,
    DailymotionSchemaService::class, // add here
];
```

No other changes are needed.

Testing
-------

[](#testing)

```
composer install
./vendor/bin/phpunit
```

Tests cover `matches()`, `extractId()`, and `fetchSchema()` (including fallback behaviour) for each platform service. WordPress functions are mocked using [Brain Monkey](https://github.com/Brain-WP/BrainMonkey).

Post meta
---------

[](#post-meta)

KeyTypeDescription`_cached_video_schemas`arraySchemas keyed by URL: `[ $url => $schema, ... ]`Schemas are re-cached each time a post is saved. Already-cached URLs are reused without a new API call. To force a full refresh, delete the `_cached_video_schemas` post meta and re-save the post.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8834dc84f62a7c139ded639124a4f9a3bfd03e8ccac75db9f83107ed38ebca39?d=identicon)[slicklabs](/maintainers/slicklabs)

---

Top Contributors

[![leoflapper](https://avatars.githubusercontent.com/u/2369607?v=4)](https://github.com/leoflapper "leoflapper (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wefabric-wp-video-indexer/health.svg)

```
[![Health](https://phpackages.com/badges/wefabric-wp-video-indexer/health.svg)](https://phpackages.com/packages/wefabric-wp-video-indexer)
```

###  Alternatives

[ezsystems/ezxmlinstaller-ls

The eZ XML Installer extension is a plattform to define proccesses for eZ Publish and execute them.

223.4k](/packages/ezsystems-ezxmlinstaller-ls)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
