fairpm / did-manager-wordpress
WordPress integration layer for FAIR DID management and metadata generation
0.0.1
2026-03-13 18:52 UTC
Requires
- php: >=8.3
- ext-json: *
- afragen/wordpress-plugin-readme-parser: ^1.2025.12
- fairpm/did-manager: ^0.0.3
Requires (Dev)
- carthage-software/mago: ^1.0.0-rc.12
- phpunit/phpunit: ^10.0
- roave/security-advisories: dev-latest
README
fairpm/did-manager-wordpress contains the WordPress-specific layer that was extracted from the core fairpm/did-manager package. It provides WordPress header parsing, readme.txt parsing, FAIR metadata generation, and a small adapter around the core DID manager for package-aware workflows.
Features
- Parse WordPress plugin headers and discover the main plugin file
- Parse WordPress.org-style
readme.txtfiles outside of a WordPress runtime - Generate FAIR metadata arrays and
metadata.jsonfiles for plugins and themes - Detect whether a package path is a plugin or theme
- Inject
Plugin IDorTheme IDvalues after a DID is created - Compose the core
FAIR\\DID\\DIDManagerinstead of duplicating DID logic
Installation
composer require fairpm/did-manager-wordpress
For repository development:
git clone https://github.com/fairpm/did-manager-wordpress.git
cd did-manager-wordpress
composer install
Usage
<?php require_once 'vendor/autoload.php'; use FAIR\DID\DIDManager; use FAIR\DID\PLC\PlcClient; use FAIR\DID\Storage\KeyStore; use FAIR\WordPress\DID\Parsers\MetadataGenerator; use FAIR\WordPress\DID\WordPressDIDManager; $core = new DIDManager( new KeyStore(__DIR__ . '/keys.json'), new PlcClient(), ); $wordpress = new WordPressDIDManager($core); $result = $wordpress->create_package_did(__DIR__ . '/my-plugin', 'my-plugin.example.com', null, true); $metadata = $wordpress->generate_metadata(__DIR__ . '/my-plugin', did: $result['did']);
Namespaces
FAIR\\WordPress\\DID\\Parsersfor header, readme, and metadata helpersFAIR\\WordPress\\DIDfor package-aware orchestration around the core DID manager
Examples
See examples:
01-parse-plugin-headers.php02-generate-metadata.php
Testing
composer tests composer lint composer analyze