Skip to content

Conversation

@superdav42
Copy link
Collaborator

@superdav42 superdav42 commented Nov 15, 2025

Test build:
ultimate-multisite.zip

Summary by CodeRabbit

  • Documentation

    • Added comprehensive Enhance Control Panel integration guide covering installation, configuration, API setup, workflows, verification, and troubleshooting.
  • New Features

    • Enhance Control Panel integration now available with automatic domain syncing, SSL provisioning, subdomain management, and connection testing.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 15, 2025

Walkthrough

Introduces a new Enhance Control Panel integration for WP Ultimo, including a host provider class that manages domain and subdomain lifecycle events with the Enhance API, comprehensive wiki documentation for setup and configuration, updates to the domain manager to load the integration, and sidebar references to the new documentation.

Changes

Cohort / File(s) Summary
Wiki Documentation
​.wiki/Enhance-Integration.md, ​.wiki/_Sidebar.md
Added comprehensive integration guide documenting features, configuration, API requirements, operational workflows, verification steps, troubleshooting, and best practices. Sidebar updated with links to Enhance and Hestia Control Panel integration pages.
Enhance Host Provider Integration
inc/integrations/host-providers/class-enhance-host-provider.php
New Enhance_Host_Provider class extending Base_Host_Provider with domain/subdomain lifecycle management, API communication, connection testing, and detailed error logging. Handles automatic syncing and SSL provisioning with Enhance servers.
Domain Manager Integration
inc/managers/class-domain-manager.php
Modified load_integrations method to instantiate and load Enhance_Host_Provider alongside existing host provider integrations.

Sequence Diagram

sequenceDiagram
    participant WP as WordPress<br/>(Ultimate Multisite)
    participant PM as Domain Manager
    participant EP as Enhance<br/>Host Provider
    participant API as Enhance API

    Note over WP,API: Domain Lifecycle Event
    WP->>PM: Domain event triggered<br/>(add/remove domain/subdomain)
    PM->>EP: Calls lifecycle hook<br/>(on_add_domain, on_remove_domain, etc.)
    
    rect rgb(220, 240, 255)
        Note over EP,API: API Communication Phase
        EP->>EP: Prepare API request<br/>with authentication token
        EP->>API: send_enhance_api_request<br/>(endpoint, method, data)
        API-->>EP: Response (JSON)
    end
    
    rect rgb(240, 220, 255)
        Note over EP: Error Handling & Logging
        EP->>EP: Parse response,<br/>normalize errors
        EP->>EP: Log request/response
    end
    
    EP-->>PM: Return result
    PM-->>WP: Sync complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Focus areas for review:
    • send_enhance_api_request method: Bearer token authentication, request/response handling, and error normalization logic
    • Lifecycle hook implementations (on_add_domain, on_remove_domain, on_add_subdomain, on_remove_subdomain): Verify correct API endpoint mapping and data payload construction
    • test_connection method: Ensure connection validation properly detects failures and provides actionable feedback
    • Class initialization and singleton pattern compliance with base provider interface

Possibly related PRs

  • #243: Adds the Hestia Control Panel integration using an identical pattern; both modify class-domain-manager.php to load a new *_Host_Provider via get_instance().

Poem

🐰 A rabbit hops through servers bright,
Domains sync with Enhance in flight!
SSL certs and subdomains flow,
Multisite gardens beautifully grow! 🌱

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add integration for enhance panel' is directly related to the main changes, which introduce a new Enhance host provider integration. It clearly summarizes the primary change in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-enhance-panel

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
.wiki/Enhance-Integration.md (1)

74-81: Tighten markdown formatting for better linting and readability

A few small doc tweaks would clean up markdownlint/style warnings and improve rendering:

  • Add explicit languages to generic fenced code blocks (e.g., line 74 URL snippet, and the API examples around lines 255–282). For example:
    • Use ```text for the bare API URL.
    • Use ```http (or text) for the Authorization: Bearer ... header and GET/POST/DELETE /servers... endpoint examples.
  • The bold “Error: ...” labels in Troubleshooting (lines ~180, ~186, ~191) are effectively subheadings; consider turning them into proper headings (e.g., #### Error: "Failed to connect to Enhance API"), which also addresses MD036.
  • Optional: around the DNS/SSL explanation (lines ~149–154), the word “automatically” appears twice in close proximity; you could trim one occurrence to make the sentence a bit tighter.

These are non-functional but will keep markdownlint quiet and make the page a bit clearer.

Also applies to: 149-154, 176-195, 255-282

inc/integrations/host-providers/class-enhance-host-provider.php (2)

46-47: Align tutorial link and API URL placeholder with this repo and expected format

Two small consistency tweaks to consider:

  • protected $tutorial_link still points to https://github.com/superdav42/wp-multisite-waas/wiki/Enhance-Integration, while this project ships its own .wiki/Enhance-Integration.md under the Multisite-Ultimate/ultimate-multisite repo. Updating the URL will keep the in-app “tutorial” link aligned with the docs shipped here.
  • The WU_ENHANCE_API_URL placeholder currently shows e.g. https://your-enhance-server.com, but the docs and runtime expectation require /api/ (you later rely on rtrim(WU_ENHANCE_API_URL, '/') . $endpoint). Changing the placeholder to something like e.g. https://your-enhance-panel.com/api/ will reduce configuration mistakes.

Also applies to: 100-115


196-203: Remove or use $delete_response to avoid an unused variable

$delete_response is assigned in on_remove_domain() but never read, which static analysis correctly flags and which also hides a potential place to react to API failures.

If you just want to fire-and-forget, you can drop the variable:

-        $delete_response = $this->send_enhance_api_request(
-            '/servers/' . $server_id . '/domains/' . $domain_id,
-            'DELETE'
-        );
-
-        wu_log_add('integration-enhance', sprintf('Domain %s removal request sent', $domain));
+        $this->send_enhance_api_request(
+            '/servers/' . $server_id . '/domains/' . $domain_id,
+            'DELETE'
+        );
+
+        wu_log_add('integration-enhance', sprintf('Domain %s removal request sent', $domain));

Alternatively, you could inspect $delete_response and log a different message on error, but either way avoiding the unused variable will keep PHPMD happy.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4d6ab1 and df32491.

⛔ Files ignored due to path filters (1)
  • assets/img/hosts/enhance.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • .wiki/Enhance-Integration.md (1 hunks)
  • .wiki/_Sidebar.md (1 hunks)
  • inc/integrations/host-providers/class-enhance-host-provider.php (1 hunks)
  • inc/managers/class-domain-manager.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
inc/managers/class-domain-manager.php (1)
inc/integrations/host-providers/class-enhance-host-provider.php (1)
  • Enhance_Host_Provider (20-424)
inc/integrations/host-providers/class-enhance-host-provider.php (2)
inc/integrations/host-providers/class-base-host-provider.php (2)
  • Base_Host_Provider (20-656)
  • supports (337-340)
inc/functions/helper.php (2)
  • wu_log_add (208-211)
  • wu_get_isset (66-73)
🪛 Gitleaks (8.29.0)
.wiki/Enhance-Integration.md

[high] 63-65: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.

(curl-auth-header)

🪛 LanguageTool
.wiki/Enhance-Integration.md

[style] ~153-~153: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...ally - Enhance handles SSL provisioning automatically, so manual SSL configuration is not req...

(ADVERB_REPETITION_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
.wiki/Enhance-Integration.md

74-74: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


180-180: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


186-186: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


191-191: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


257-257: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


264-264: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


269-269: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


274-274: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


280-280: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 PHPMD (2.15.0)
inc/integrations/host-providers/class-enhance-host-provider.php

197-197: Avoid unused local variables such as '$delete_response'. (undefined)

(UnusedLocalVariable)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: cypress (8.1, chrome)
  • GitHub Check: cypress (8.2, chrome)
🔇 Additional comments (3)
.wiki/_Sidebar.md (1)

39-47: Host provider links for Enhance and Hestia look consistent

The new sidebar entries follow the existing naming and link pattern for host provider integrations; no issues from a docs/navigation standpoint.

inc/managers/class-domain-manager.php (1)

952-1007: Enhance host provider is correctly wired into the integration loader

Loading \WP_Ultimo\Integrations\Host_Providers\Enhance_Host_Provider::get_instance() alongside the other host providers keeps the pattern consistent and ensures the new integration is initialized before wp_ultimo_host_providers_load runs.

inc/integrations/host-providers/class-enhance-host-provider.php (1)

20-423: Overall Enhance host provider implementation looks solid

The integration cleanly follows the Base_Host_Provider pattern: detection via constants, well-defined fields, centralized send_enhance_api_request() with logging and error normalization, and domain/subdomain hooks wired to the Enhance API plus a focused test_connection() path. The explainer lines and docs align with the behavior in on_add_domain/on_remove_domain.

@superdav42 superdav42 merged commit a7eb3db into main Nov 21, 2025
10 checks passed
@superdav42 superdav42 deleted the add-enhance-panel branch November 21, 2025 19:41
@coderabbitai coderabbitai bot mentioned this pull request Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants