nvoos / wordpress-adapter
WordPress adapter implementations for the oOS Core engine.
Package info
github.com/nvdigitalsolutions/nvoos-wordpress-adapter
Type:wordpress-plugin
pkg:composer/nvoos/wordpress-adapter
Requires
- php: ^8.1
- nvoos/core: dev-main
This package is auto-updated.
Last update: 2026-06-07 13:54:43 UTC
README
Purpose
Concrete implementations of the 9 domain interfaces from nvoos/core, backed by WordPress APIs. Each adapter wraps one WordPress subsystem behind a framework-agnostic contract — same pattern as nvoos/laravel-adapter and nvoos/craft-adapter, using WordPress's procedural API layer.
All domain contracts are fully domain-owned — none extend PSR or Symfony interfaces.
Tier
| Distribution | nvoos/wordpress-adapter Composer package (type: wordpress-plugin) |
| PHP target | 7.4+ |
| License | GPL-3.0-or-later |
| Dependencies | nvoos/core ^1.0, WordPress core |
Public Surface
| Adapter | Implements | WordPress APIs Wrapped |
|---|---|---|
ErrorFactory |
ErrorFactoryInterface |
WP_Error |
CacheStore |
CacheStoreInterface (domain-owned) |
get_transient / set_transient, wp_cache_* |
SettingsStore |
SettingsStoreInterface |
get_option / update_option |
EventDispatcher |
EventDispatcherInterface (domain-owned) |
do_action / apply_filters |
HttpClient |
HttpClientInterface (domain-owned) |
wp_remote_request |
FileStore |
FileStoreInterface |
wp_insert_attachment, get_attached_file, wp_generate_attachment_metadata |
QueueClient |
QueueClientInterface |
Action Scheduler (primary), WP-Cron (fallback) |
AuthProvider |
AuthProviderInterface |
get_current_user_id, user_can, wp_verify_nonce |
ContentStore |
ContentStoreInterface |
get_post, wp_insert_post, WP_Query, get_post_meta, wp_get_post_terms |
Conventions
- One adapter per file, one WordPress subsystem per adapter.
- Adapter methods are thin wrappers — one WP function call per method.
- All WordPress function calls are prefixed with
\(global namespace). - Adapters do not contain business logic — they translate between domain types and WordPress types.
- PHP 7.4 compatible — no typed properties, no named arguments, no enums.
Installation
composer require nvoos/wordpress-adapter
The package autoloads via PSR-4 from src/ (namespace Nvoos\WordPress\). No service provider needed — WordPress plugins wire adapters manually in their bootstrap.
Configuration
Adapters are instantiated directly by the consuming plugin's bootstrap file. See includes/bootstrap/oos-bridge.php for the canonical wiring example used in this monorepo.
Testing
vendor/bin/phpunit tests/test-wp-options-store.php vendor/bin/phpunit tests/test-wp-http-client.php vendor/bin/phpunit tests/test-wp-content-store.php
Tests require a WordPress test environment (WP-Core test suite + PHPUnit Polyfills).
Also Load
lib/core/src/Domain/Contract/— the interfaces these implementlib/core/src/Domain/Entity/— value objects returned by these adapterslib/core/src/Domain/Error/— typed domain exceptions these throwlib/wordpress-adapter/src/Adapter/README.md— per-adapter details and neighbor mapincludes/bootstrap/oos-bridge.php— DI wiring that instantiates these adapters
Monorepo sync: This directory is synced to
nvdigitalsolutions/nvoos-wordpress-adaptervia.github/workflows/sync-nvoos-wordpress-adapter.ymlon push tomainoralpha-working.