Migrate WP Serveur hosting compatibility into ThirdParty (part of #8768) - #8778
Migrate WP Serveur hosting compatibility into ThirdParty (part of #8768)#8778remyperona wants to merge 1 commit into
Conversation
Port inc/3rd-party/hosting/wp-serveur.php into a container-registered WP_Rocket\ThirdParty\Hostings\WpServeur subscriber, detected via HostResolver (DB_HOST contains .wpserveur.net, read through the mockable rocket_get_constant()) and built by HostSubscriberFactory — same hooks, priorities and callbacks. Removes the wp-serveur require from inc/3rd-party/3rd-party.php and the legacy file. Adds detection, factory, and subscriber unit coverage. Part of #8768. One of six per-host PRs splitting the hosting-compat migration for easier review and testing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 100.00% diff coverage
Metric Results Coverage variation Report missing for 9bdce291 Diff coverage ✅ 100.00% diff coverage (50.00%) Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (9bdce29) Report Missing Report Missing Report Missing Head commit (5231daf) 47689 22479 47.14% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#8778) 17 17 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Part of #8768
Description
Migrate the WP Serveur hosting-compatibility file (
inc/3rd-party/hosting/wp-serveur.php) into theWP_Rocket\ThirdParty\Hostingsservice-provider architecture, as one of six per-host PRs splitting #8768 for easier review and testing. WP Serveur is detected throughHostResolver→HostSubscriberFactory(single-match), so its code is instantiated only when the host matches. Runtime behavior is preserved exactly.Type of change
Detailed scenario
What / Why
WpServeurbecomes aSubscriber_Interfaceclass detected byHostResolver::get_host_service()viaDB_HOSTcontaining.wpserveur.net(read through the mockablerocket_get_constant()), and built byHostSubscriberFactory. The proceduralrequireis replaced by container registration.What was tested
Hostings unit group passes in the wp-env container (
composer test-unit -- --group Hostings). Detection, factory case, and subscriber methods are covered by unit tests.How to test
DB_HOSTends in.wpserveur.net), confirm theWpServeursubscriber is instantiated and its Varnish/mandatory-cookie hooks fire as before.requireremains ininc/3rd-party/3rd-party.php.Affected Features & Quality Assurance Scope
inc/ThirdParty/Hostings/),HostResolver,HostSubscriberFactory,inc/3rd-party/3rd-party.php.Technical description
Documentation
New
inc/ThirdParty/Hostings/WpServeur.php; awpserveurbranch inHostResolver::get_host_service()(viarocket_get_constant('DB_HOST')); awpserveurcase inHostSubscriberFactory; the wp-serveurrequireremoved and the legacy file deleted. Detection/factory unit tests extended.New dependencies
None.
Risks
Low — mechanical port mirroring the existing hosts; behavior unchanged and covered by unit tests.
Mandatory Checklist
Code validation
Code style
Unticked items justification
Covered by the Hostings unit suite (run in the wp-env container) plus PHPStan and PHPCS; behavior parity verified against the deleted procedural file.
Additional Checks