dbout/wp-orm
A lightweight ORM for WordPress that brings an Eloquent-style experience to custom tables and posts. Define models, query with a fluent builder, and handle relationships without raw SQL, while staying fully compatible with the WordPress ecosystem.
Verdict: A narrow-fit, single-maintainer bridging library. Worth a 2–3 day spike only if the roadmap includes WordPress as a first-class data source; otherwise it is noise in the dependency graph.
Architecture fit
wp_posts/wp_postmeta/wp_users/wp_options/wp_terms schema through Eloquent models (Post, User, Term, Comment, Option, Attachment) with relationships and eager loading. It is a data-access layer, not a WordPress abstraction — it does not touch hooks, rewrite rules, admin UI, or the template hierarchy.$wpdb/WP_Query string-building.WP_Query filters — which is most non-trivial WordPress sites.Integration feasibility
composer require dbout/wp-orm, bootstrap Eloquent's Capsule against WordPress's $wpdb constants, define models. In a Laravel host you would instead register a second named connection and let the package's models resolve against it, avoiding a duplicate Capsule.wp-config.php resolves will fail. This ordering constraint complicates plugin bootstrap and any code shared between WP-CLI, cron, and web requests.get_post_meta loops.Technical risk (ranked)
WP_Query bypasses the ecosystem. Multilingual plugins (WPML/Polylang), page builders, WooCommerce, and search indexers attach behavior at the query and hook layer. Eloquent reads can return content the rest of the site considers filtered, translated, or private. This is the failure mode that generates support tickets, not crashes.save_post, wp_insert_post, revision creation, and object-cache invalidation. Any Eloquent write to wp_posts must be treated as an advanced, reviewed operation with explicit hook firing.illuminate/database major. WordPress installs frequently pin older PHP than a current Laravel supports. The compatibility matrix (package × Eloquent major × PHP × WP version) is undocumented enough that we must own it.Key questions for the maintainer / spike
illuminate/database majors and PHP floors are supported, and what is the stated support window?$wpdb->base_prefix and switch_to_blog()?Stack fit
WP_Query pagination is the bottleneck.Migration path
WP_Query + object-cache path on production-shaped data. If the win is under ~30% on the hot path, stop; the complexity isn't paying rent.save_post/clean_post_cache explicitly after each write, plus an integration test that asserts a cache invalidation occurred.Compatibility
composer.lock, and add the package to the dependency-review list (single maintainer + low adoption = periodic re-evaluation).Sequencing Spike (2–3 days: bootstrap, three representative read queries, one relationship-heavy query, one measured benchmark) → design review with a WordPress-fluent engineer → read-only integration (1–2 sprints) → write path only if a concrete requirement forces it → document the fork procedure as a contingency.
Maintenance
Support
Scaling
postmeta join is WordPress's classic scaling cliff. Eager loading fixes N+1 but not missing composite indexes or wp_postmeta bloat. Benchmark at production row counts, not on a 200-post dev site.Failure modes to monitor
Ramp-up
How can I help you explore Laravel packages today?