Repository navigation
v13.36.0
Added
- Discovery lives in its own package,
pollora/discovery, which the framework requires: the engine, its contracts,DiscoveryManager, the cache and the#[SkipDiscovery]attribute, with their tests and benchmarks. Class names do not change. The framework keeps what needs Laravel: the service provider,discovery:run/discovery:clear,DiscoveryRegistrar,ServiceProviderDiscovery, the Laravel adapters, andHasConfiguringSupport, which builds post types and taxonomies - Discovery can run without Laravel's application, the first step towards
pollora/discovery:new DiscoveryEngine()works with no argument. Two contracts let an environment plug in —InstanceResolverInterfacebuilds the classes discovery needs (Laravel's container in a Pollora application,ReflectionInstanceResolverotherwise) andDiscoveryRegistrarInterfaceadds the environment's discoveries before each run (DiscoveryRegistrarkeeps scanning the container's*Discoverybindings).Psr16DiscoverCacheDrivercaches scans in any PSR-16 cache - Post type and taxonomy attributes say what they register: each implements
ConfiguresArguments, a pure function that returns the registration arguments with its own contribution (#[HasArchive('library')]setshas_archive,#[Labels]merges into the generated labels), and the method attributes (#[AdminCol],#[RegisterMetaBoxCb],#[MetaBoxCb],#[MetaBoxSanitizeCb],#[UpdateCountCallback]) implementConfiguresArgumentsWithMethod, the discovery handing them the method as a callback. ThePollora\Attributesnamespace no longer reaches Laravel or a framework service, which an architecture test keeps: the first step towardspollora/attributes, a package to declare attributes without the framework - The attributes live in their own package,
pollora/attributes, which the framework requires: every attribute and its contracts, with the value types they take (Every,Interval,Access,Control,BindingFieldType). Class names do not change. The framework keeps the two deprecated bases,PostTypeAttributeandTaxonomyAttribute, and the code that reads the attributes - REST routes live in their own package,
pollora/wp-rest, which the framework requires:WpRestDiscovery, the route registrar, the permissions (IsLoggedIn,IsAdmin,Can) andPollora\Support\WpGlobals. Class names do not change. The framework keepsWpRestAttributeServiceProvider - WP-CLI commands live in their own package,
pollora/wp-cli, which the framework requires:WpCliDiscovery,WpCliService, the WP-CLI adapters andWordpressCommand. Class names do not change. The framework keepsWpCliServiceProviderandpollora:make:wp-cli - Scheduling lives in its own package,
pollora/schedule, which the framework requires: one engine behind#[Schedule]and a fluent API (Schedule::event(),Schedule::once(),cancel(),next(),events()), WP-Cron as the default driver, andSchedule::fake()for tests.ScheduleDiscoverykeeps its class name and moves there, with the same hook names and schedule keys. The framework gives the engine its container, so the classes passed tocall()get their dependencies, and keeps the bridge to Laravel's scheduler (use_laravel_scheduler) config/schedule.php(publishable with thepollora-scheduletag) chooses the scheduling driver,wp-cron(the default) oraction-scheduler, byPOLLORA_SCHEDULE_DRIVER, and lists the hooks that stay on WP-Cron whatever the driver. Thecronoption now indexes every driver's events, sowp_next_scheduled(), Site Health and WP Crontrol see the ones Action Scheduler keeps, and WP-Cron never runs them. Changing the driver moves nothing by itselfpollora:schedule:listshows the scheduled events with their type, frequency and driver (--type,--driver,--site,--network,--json), read from thecronoption with no query to a driver; an event on WP-Cron on purpose reads(protected)or(fallback), one a former driver keeps reads(to migrate).pollora:schedule:migratemoves the pending events from one driver to another (--from,--to,--dry-run), in both directions and safe to run againpollora:doctor, Site Health and an administration notice report a driver that does not exist or is not available (events stay on WP-Cron), and the events a former driver still keeps, with the command that moves them- The
laravelscheduling driver (POLLORA_SCHEDULE_DRIVER=laravel): every event is a job delayed until it is due, in the application's queue (database, Redis or Horizon, SQS), and a worker runs it. There is no table of Pollora's own and noschedule:run: thecronoption is the record of what is scheduled, and cancelling an event takes its entry out of it. A job runs only if the entry still exists with its identifier and time, so a cancelled, moved or duplicated job stops; a recurring event queues its next occurrence once it ran or failed for good, never in the past.config/schedule.phpgainslaravel.connection,queue,max_delay(a job due later than the connection allows, 900 seconds on SQS, wakes and waits again) andlate_after. On a multisite network the queue is shared, with one worker, and each job runs in the site that scheduled it - Lost jobs (a flushed Redis, a purged queue) are found again: at most every five minutes, as a request ends and under a lock, and with
php artisan pollora:schedule:recover(--network,--dry-run), an event more thanlate_afterseconds (600) past its time is queued again with the same identifier, so it never runs twice.pollora:doctorand Site Health report late events (no worker), a queue connection that issyncornull, and a scheduled event that failed for good in the last week
Changed
-
Requires Laravel 13.36:
illuminate/*^13.35→^13.36. The framework version tracks Laravel's, so this release is v13.36.0 -
DiscoveryEngine,DiscoveryCacheManager,InstancePoolandReflectionCachetake their dependencies instead of reaching forapp()andconfig(); readingstructure-discoverer.cachemoved toLaravelDiscoveryCacheManagerFactory.DiscoveryRegistrar::registerFromContainer()is nowregisterInto(). These are infrastructure classes, outside the public contracts (Pollora\Discovery\Domain\*), which do not change -
One
DiscoveryCacheManageris shared by the engine and thepollora:doctordiscovery cache check, which built its own -
The discovery benchmarks measure memory as PHP allocates it, from a reset peak: they read 2 MB whatever the load
-
#[WpRestRoute\Method]no longer registers its route:WpRestRouteRegistrar, in the WpRest module, does, with the same arguments, permissions and request injection. Default slugs, meta keys and command names come fromPollora\Attributes\Support\Naming, which gives the same results asStr::kebab()andStr::snake();Pollora\Support\Sluguses it -
The WpRest module no longer reaches for Laravel's application, the first step towards
pollora/wp-rest: customHandlesAttributesattributes receive the PSR-11 container given toWpRestDiscovery, andWpRestAttributableWrappertakes the controller instance instead of building it. An architecture test keeps the module to the attributes, discovery, PSR contracts and WordPress -
The WpCli module no longer reaches for Laravel's application, the first step towards
pollora/wp-cli:WpCliDiscoverybuilds commands through the discovery's instance pool instead ofresolve(). Its service provider andpollora:make:wp-clistay in the framework; an architecture test keeps the rest to the attributes, discovery, PSR logging and WP-CLI -
#[Schedule], which runs on WP-Cron alone, no longer reaches for Laravel, the first step towardspollora/schedule:ScheduleDiscoveryderives default hook names itself, with the same results asStr::snake()(a parity test keeps them), so hooks already scheduled keep their name. The bridge to Laravel's scheduler (use_laravel_scheduler) stays in the framework -
Asynchronous actions queue through the WP-Cron and Action Scheduler drivers of
pollora/schedule, withpollora/hook2.0:->async(),#[Async],Async::fake(),via()and their options do not change, and work already queued runs once the upgrade is in.Async\Drivers\WpCronDriverandActionSchedulerDriverare gone with no alias; the framework never used them, and thequeuedriver is unchanged
Deprecated
DiscoveryCacheInterfaceandLaravelDiscoveryCache, removed in 15.0: nothing reads this cache, scans are cached by the Spatie driver given toDiscoveryCacheManagerPollora\Attributes\PostType\PostTypeAttributeandPollora\Attributes\Taxonomy\TaxonomyAttribute, removed in 15.0: no built-in attribute extends them any more; implementConfiguresArguments
Removed
- The Laravel scheduling bridge, with no replacement under the same name:
wordpress.use_laravel_scheduler,Pollora\Schedule\Scheduler,SchedulerInterface,Events\*(AbstractEvent,SingleEvent,RecurringEvent),Jobs\JobDispatcher,RegisterSchedulerFiltersUseCase, thepre_schedule_event,pre_option_cronand related filters it installed, and thewp_eventstable. Setting the option no longer does anything. To keep WP-Cron events on Laravel's queue, setPOLLORA_SCHEDULE_DRIVER=laraveland run a worker (php artisan queue:work) in place ofschedule:run; events that sat inwp_eventsare not moved (let#[Schedule]and your own code schedule them again, then drop the table:DROP TABLE <prefix>wp_events, with the prefix of your database connection).pollora:doctorno longer reads the option handle()on#[Action],#[Filter],#[WpRestRoute]and#[WpRestRoute\Method], andHookno longer implementsHandlesAttributes:HookDiscoveryandWpRestDiscoveryregister hooks and routes themselves. Only the bug below reachedAction::handle(), andWpRestRoute::handle()wrote to a read-only wrapper
Fixed
- A queued asynchronous action runs even when the request that runs it registers no hook: the framework listens to
pollora/async/runat boot instead of waiting for anActionto be built. Before, a handler registered only in the request that queued it was never run, and Action Scheduler marked it failed ("no callbacks are registered") wp_get_environment_type()followsAPP_ENVinstead of readingproductionon every site (#443):localgiveslocal,dev,developmentandtestinggivedevelopment,staginggivesstaging, anything elseproduction. AWP_ENVIRONMENT_TYPEenvironment variable, awordpress.constants.WP_ENVIRONMENT_TYPEvalue or a constant defined earlier still wins. WordPress 7.1 turns pings (incoming and outgoing pingbacks and trackbacks) off outsideproduction, so they are off on a site withAPP_ENV=localorstaging:add_filter('wp_should_disable_pings_for_environment', '__return_false')brings them backpollora:doctorno longer counts as overdue WP-Cron events the ones Action Scheduler keeps: thecronoption indexes them too, with adriverkey- A public
#[Action]or#[Filter]method in a#[PostType]or#[Taxonomy]class is registered once: the post type and taxonomy discoveries also handed it toAction::handle(), which registered it a second time on the discovery's configuration object, so the page firing that hook failed withcall_user_func(): Argument #1 ($callback) must be a valid callback, class Pollora\PostType\Infrastructure\Services\PostTypeConfiguration does not have a method … - A REST controller declared with
#[WpRestRoute]gets its constructor dependencies: it is resolved through the discovery's instance pool (Laravel's container in a Pollora application) instead ofnewwith no argument, so a controller with a required dependency answered every request withTrying to invoke non static method … without an object