Skip to content

Handle validation when the unified keys is entered on Uplink managed license fields - #2972

Open
pramodjodhani wants to merge 5 commits into
update/license-field-improvementsfrom
SMTNC-2004
Open

Handle validation when the unified keys is entered on Uplink managed license fields#2972
pramodjodhani wants to merge 5 commits into
update/license-field-improvementsfrom
SMTNC-2004

Conversation

@pramodjodhani

@pramodjodhani pramodjodhani commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🎫 Ticket

SMNTC-2004

🗒️ Description

  • When a user pastes a unified Harbor key (LWSW-…) into a legacy per-product field, show a clear Unified License Manager message instead of a generic invalid-key error.
  • Harbor-managed fields (including Seating and Event Tickets Plus Uplink inputs) are locked and show “Licensed via Unified License Manager”.
  • If Harbor is not loaded (no premium plugin), guide the user to install The Events Calendar Pro or Event Tickets Pro.

Two validation pipelines:

  • PUE (Tribe__PUE__Checker::validate_key) via tec_common_pue_pre_validate_key: Promoter, ECP, Filter Bar
  • Uplink (Client::validate_license) via stellarwp/uplink/tec/client_validate_license: Seating, Event Tickets Plus

Uplink rewrite runs only for Licenses UI AJAX (pue-validate-key-uplink-*). Plugin update checks pass through so Dashboard → Updates still gets version / download_url.

🎥 Artifacts

Loom: https://www.loom.com/share/e8b343d9a2bd4cbb9c58607543080047

Test plan

  • Legacy per-product key still validates correctly
  • When Harbor is loaded, and try to enter a LWSW- license key, in ETP and Seating. You should get “Click here to enter it in the Unified License Manager” message.
  • No pro plugin / Harbor not loaded: paste LWSW-. You should get “This is a unified license key. To activate it, install The Events Calendar Pro or Event Ticket Plus....".
  • When Seating and ETP is covered by the unified licence key then Seating and ETP field should be disabled and read-only
  • Seating / ET Plus not covered: field stays editable; paste LWSW- → click-here error; key is not stored as a per-product key.

✔️ Checklist

  • Ran npm run changelog to add changelog file(s). More info here
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

Tribe__PUE__Checker is not initialised for Uplink managed license fields
(i.e. Seating and Event Tickets Plus) so the imporved validation
applied for "LWSW-" pastes was not being applied.

Needed to utilise stellarwp/uplink/tec/client_validate_license filter to
apply the improved validation to Uplink managed license fields.
@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

SMTNC-2004

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 012d4b62-956a-4920-a742-3afaa9bcc38d

📥 Commits

Reviewing files that changed from the base of the PR and between c53de37 and 8db2640.

📒 Files selected for processing (4)
  • src/Common/Integrations/Harbor/PUE.php
  • src/Common/Libraries/Harbor.php
  • tests/integration/Tribe/Common/Integrations/Harbor/PUE_Test.php
  • tests/integration/Tribe/Common/Libraries/Harbor_Test.php

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Harbor-managed products now validate licenses through the Unified License Manager.
    • Managed license fields are clearly marked as read-only and cannot be edited directly.
    • Added guidance and success messaging for licenses managed through the Unified License Manager.
  • Bug Fixes

    • Improved handling of unsupported unified license keys and unmanaged products.
    • Preserved license update-check responses during validation.
    • Updated premium product guidance to reference Event Tickets Plus.

Walkthrough

Changes

Harbor now intercepts Uplink license validation, rejects unified keys for unmanaged products, and returns synthetic responses for Harbor-managed products. PUE disables managed license inputs and reuses Harbor’s license message. Integration tests cover validation, rendering, update checks, and message content.

Sequence Diagram(s)

sequenceDiagram
  participant Uplink
  participant PUE
  participant Harbor
  participant UnifiedLicenseManager
  Uplink->>PUE: Render license field
  PUE->>Harbor: Check Harbor-managed product
  Harbor-->>PUE: Return managed-license status
  PUE-->>Uplink: Render readonly and disabled input
  Uplink->>Harbor: Submit license validation
  Harbor->>UnifiedLicenseManager: Resolve managed license resource
  UnifiedLicenseManager-->>Harbor: Return resource key
  Harbor-->>Uplink: Return valid response and license-manager message
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: handling unified-key validation in Uplink-managed license fields.
Description check ✅ Passed The description includes the ticket, change summary, artifacts, test plan, and repository checklist, with relevant new and existing test coverage marked.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SMTNC-2004

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.

@pramodjodhani

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@pramodjodhani
pramodjodhani requested review from dpanta94, jonwaldstein and redscar and removed request for dpanta94 August 13, 2026 14:44
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.

1 participant