Skip to content

feat(integrations): add Hostinger (hPanel) host provider with domain mapping — Resolves #877#1194

Merged
superdav42 merged 2 commits into
mainfrom
feat/issue-877-hostinger-hpanel-integration
May 13, 2026
Merged

feat(integrations): add Hostinger (hPanel) host provider with domain mapping — Resolves #877#1194
superdav42 merged 2 commits into
mainfrom
feat/issue-877-hostinger-hpanel-integration

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

First of three PRs for #877 (hPanel/Hostinger integration). This one lands the core provider and domain-mapping capability inside inc/integrations/providers/hostinger/, matching the modular integrations architecture introduced in 2.5.0.

The two follow-up PRs (filed against ultimate-multisite-domain-seller and ultimate-multisite-multi-tenancy) layer additional capability modules on top of the same Hostinger_Integration registered here — so they share a single API token credential.

What this PR adds

  • WP_Ultimo\Integrations\Providers\Hostinger\Hostinger_Integration — provider class with a Bearer-token API client (hostinger_api_call()), credential constant WU_HOSTINGER_API_TOKEN, and a test_connection() that hits /api/domains/v1/portfolio.
  • Hostinger_Domain_Mapping capability module wired to wu_add_domain, wu_remove_domain, wu_add_subdomain, wu_remove_subdomain, and the wu_domain_dns_get_record filter. Uses Hostinger's PUT /api/dns/v1/zones/{domain} non-destructive append (overwrite: false) for adds, and DELETE for removes.
  • Zone-ownership safeguard: find_root_domain() queries /api/domains/v1/portfolio and only acts when the target hostname falls under a zone present in the configured account. Zones not in the portfolio are logged and skipped — the integration never modifies DNS it does not own.
  • Wizard instructions partial at views/wizards/host-integrations/hostinger-instructions.php explaining token generation, scope and the explicit out-of-scope items (WP update controls, CDN toggles, email accounts — none of which are exposed by the public Hostinger API today).
  • Official Hostinger SVG wordmark at assets/img/hosts/hostinger.svg.
  • 29 unit tests covering construction, detection, connection testing, zone lookup edge cases (deepest-zone preference, missing zone, malformed responses), record-name relativisation, and all four domain lifecycle handlers.
  • Registry test extended to assert Hostinger registration.

What this PR deliberately does not do

Feature requested in #877 Status
Wildcard / per-subsite CNAME in Hostinger DNS Done here
Custom-domain mapping via Hostinger DNS Done here
WordPress update controls (core / themes / plugins; security-only vs. all vs. none) Not exposed by the Hostinger public API as of v0.11.6 — documented in the wizard instructions
CDN toggle Hostinger CDN is automatic on supported plans — no API surface required
Email account provisioning No public Hostinger Email API — explicitly skipped per discussion on the issue
Domain registration / WHOIS / availability Filed as a separate PR against ultimate-multisite-domain-seller
Hostinger Websites provisioning Filed as a separate PR against ultimate-multisite-multi-tenancy

Verification

vendor/bin/phpunit --filter 'Hostinger' --no-coverage
# 29 tests, 50 assertions — OK

vendor/bin/phpcs inc/integrations/providers/hostinger/ tests/WP_Ultimo/Integrations/Providers/Hostinger/ views/wizards/host-integrations/hostinger-instructions.php
# 0 errors, 0 warnings

vendor/bin/phpstan analyse inc/integrations/providers/hostinger/
# 0 new errors (baseline-ignore warnings unchanged)

vendor/bin/phpunit --filter 'Integration_Registry_Test::test_core_integrations_are_registered' --no-coverage
# 13 assertions — OK (Hostinger registration confirmed)

The pre-existing Integration_Registry_Test::test_each_integration_has_domain_mapping_capability failure is unrelated to this PR — it asserts every integration owns a domain-mapping capability, which is incorrect for amazon-ses (transactional-email only). That failure is reproducible on main at the same commit.

References

Resolves #877


aidevops.sh v3.15.38 plugin for OpenCode v1.14.48 with gpt-5.5 spent 3h 45m and 15,815 tokens on this as a headless worker.

…mapping

Adds a new Hostinger integration that uses Hostinger's public API (https://developers.hostinger.com)
to manage DNS records for subdomain network sites and mapped custom domains. The integration
registers a domain-mapping capability that:

- Adds a CNAME record to the matching Hostinger zone when a new subsite is created.
- Adds an A/CNAME record when a customer maps a domain that is hosted on Hostinger.
- Deletes those records when subsites or mappings are removed.
- Surfaces the live Hostinger zone records on the domain-mapping comparison table.
- Skips any zone that is not in the configured Hostinger account so the integration never
  modifies DNS it does not own.

Authentication is a single Bearer API token (WU_HOSTINGER_API_TOKEN) created in hPanel under
Account -> API. AutoSSL is declared as supported because Hostinger issues SSL certificates
automatically for hostnames that resolve to its infrastructure.

Includes the official Hostinger SVG wordmark, a wizard instructions partial that walks the user
through token generation and explains the scope (and the deliberate out-of-scope areas: WP
update controls, CDN toggles, email accounts), and 29 unit tests covering construction,
detection, connection testing, zone lookup, record naming, and the four domain/subdomain
lifecycle handlers.

Resolves #877
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 35 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d0c7f1d-5f4f-42f9-82dd-ee0f25d5fdcb

📥 Commits

Reviewing files that changed from the base of the PR and between 5c77428 and 176b8a9.

⛔ Files ignored due to path filters (1)
  • assets/img/hosts/hostinger.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • inc/integrations/class-integration-registry.php
  • inc/integrations/providers/hostinger/class-hostinger-domain-mapping.php
  • inc/integrations/providers/hostinger/class-hostinger-integration.php
  • tests/WP_Ultimo/Integrations/Integration_Registry_Test.php
  • tests/WP_Ultimo/Integrations/Providers/Hostinger/Hostinger_Domain_Mapping_Test.php
  • tests/WP_Ultimo/Integrations/Providers/Hostinger/Hostinger_Integration_Test.php
  • views/wizards/host-integrations/hostinger-instructions.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-877-hostinger-hpanel-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

Performance Test Results

Performance test results for 843b5b8 are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 41 37.83 MB 910.00 ms (+83.50 ms / +9% ) 153.50 ms 1097.00 ms (+100.50 ms / +9% ) 2078.00 ms (+190.00 ms / +9% ) 2002.50 ms (+204.35 ms / +10% ) 88.05 ms
1 56 49.14 MB 958.50 ms (+21.00 ms / +2% ) 142.00 ms 1101.50 ms (+22.50 ms / +2% ) 2098.00 ms 2020.85 ms 79.70 ms (-1.65 ms / -2% )

@superdav42
Copy link
Copy Markdown
Collaborator Author

Companion PRs for Hostinger integration (issue #877):

Each PR attaches to the same core Hostinger_Integration via Integration_Registry::add_capability(), so a single hPanel API token configured in the core integration serves domain mapping, domain selling, and multi-tenancy operations.


aidevops.sh v3.15.38 plugin for OpenCode v1.14.48 with gpt-5.5 spent 4h 10m and 15,815 tokens on this as a headless worker.

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42 superdav42 merged commit e55589e into main May 13, 2026
11 checks passed
@superdav42 superdav42 deleted the feat/issue-877-hostinger-hpanel-integration branch May 13, 2026 09:16
@superdav42 superdav42 added the review-feedback-scanned Merged PR already scanned for quality feedback label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-feedback-scanned Merged PR already scanned for quality feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hpanel Integration?

1 participant