alleyinteractive/wordpress-autoloader
A lightweight autoloader for WordPress themes and plugins that maps PHP namespaces to file paths, letting you organize code into classes without requiring Composer at runtime. It simplifies PSR-4-style loading and integrates cleanly with WordPress projects.
Architecture fit
extra.laravel auto-discovery, no publishable config. It is a standalone spl_autoload_register implementation that maps class names to WordPress-style filenames (class-foo.php, interface-bar.php, trait-baz.php, function-qux.php).Integration feasibility
composer require alleyinteractive/wordpress-autoloader, then instantiate the autoloader and call register() / add_path(). Wrapping that in a register() method on a small service provider is a half-day spike.class-*.php files, so the autoloader would have nothing to load.src/ tree, or (c) a headless WP + Laravel CMS integration.Technical risk
--classmap-authoritative, --optimize-autoloader), which is standard in Laravel production deploys. Static analysis (PHPStan/Psalm) and IDE resolution will not follow dynamic registration without custom stubs.Key questions
Stack fit
Migration path
add_path() to a single dedicated directory.Compatibility
dump-autoload --optimize.Sequencing
--optimize-autoloader, ideally --classmap-authoritative).Maintenance
Support
Scaling
file_exists/is_file calls are the only hot path and are absorbed by OPcache at typical scale.Failure modes
add_path() is ever fed a writable uploads/tmp directory.Ramp-up
register, add_path), so a competent PHP engineer is productive in under a day.How can I help you explore Laravel packages today?