Skip to content

Feature/help scout beacon#3229

Open
alexjpanagis wants to merge 1 commit into
gocodebox:devfrom
scalemath:feature/help-scout-beacon
Open

Feature/help scout beacon#3229
alexjpanagis wants to merge 1 commit into
gocodebox:devfrom
scalemath:feature/help-scout-beacon

Conversation

@alexjpanagis

Copy link
Copy Markdown

Adds an in-dashboard HelpScout help beacon so users can reach documentation and support (or pre-sales) without leaving wp-admin.

The entire feature lives in a new self-instantiating admin class, LLMS_Admin_Help_Beacon (following the LLMS_Admin_Review pattern), plus a one-line require_once in the loader and a changelog entry. Three files:

  • includes/admin/class-llms-admin-help-beacon.php (new)
    • Screen scoping — only renders on the core LifterLMS management screens (toplevel_page_lifterlms, lifterlms_page_llms-{dashboard,settings,reporting,import,status,resources,add-ons}). Intentionally excluded from the post editors and Course Builder so it never clutters the editing UI. Filter: llms_help_beacon_screens.
    • License-based beacon selection — shows the support beacon on licensed sites and the pre-sales beacon otherwise. is_licensed() checks the bundled helper (llms_helper_options()->get_license_keys(), guarded by function_exists). Filters: llms_help_beacon_is_licensed, llms_help_beacon_id. Beacon IDs are class constants.
    • Consent gate — renders a floating launcher (styled to match .llms-button-primary); the HelpScout script is injected only after the user confirms a confirm() prompt, so no third-party script or cookie loads until opt-in.
    • Form prefill — passes the current user's name/email to Beacon('prefill', …).
    • System report as agent-only context (support beacon only)get_session_data() reuses LLMS_Data::get_data('system_report') and maps each top-level section to a HelpScout session-data attribute, bounded to the API's 20-key / 10,000-char limits. This appears in the agent's conversation view, not the customer's message box. Filter: llms_help_beacon_session_data (return [] to disable).
    • Inline JS/CSS output via the existing llms()->assets->enqueue_inline() system; dynamic data encoded with wp_json_encode( …, JSON_HEX_TAG | JSON_HEX_AMP ).
  • includes/class-llms-loader.phprequire_once the new class in includes_admin() and an @since [version] docblock note.
  • .changelogs/help-scout-beacon.yml — changelog entry (minor / added).

All new hooks use the llms_ prefix, all new symbols use @since [version], and every change is additive and filterable — no public signatures changed and no build step (pure PHP inline output).

How has this been tested?

Manually tested in a local environment (Local / WP 7.0 / PHP 8.2.29) with LifterLMS running from this branch, unlicensed and (pre-sales) install + adding a license to compare (video shared in Slack):

  • Verified the launcher appears on the LifterLMS management screens (Dashboard, Settings, Status) and does not appear on the course/lesson editors or Course Builder.
  • Verified the consent confirm() gate: no HelpScout script or cookie loads until the user clicks OK.
  • Verified the pre-sales beacon loads on the unlicensed site and that the current user's name/email are pre-filled in the form.
  • Verified the support beacon loads when LifterLMS is licensed and that the current user's name/email are pre-filled in the form.
  • Note: HelpScout's message send requires a secure context (crypto.randomUUID), so the admin must be served over HTTPS.
  • The support-beacon path (session data) is gated to licensed sites; it can be exercised locally with add_filter( 'llms_help_beacon_is_licensed', '__return_true' ), which switches to the support beacon and fires Beacon('session-data', …) with the system report. Agent-side visibility was not verified locally (requires the support HelpScout account).
  • php -l is clean on all three changed files.

The PHPUnit suite and PHPCS were not run in this environment — please rely on CI for those (see checklist below).

Types of changes

New feature (non-breaking change which adds functionality).

Checklist:

  • This PR requires and contains at least one changelog fil yml file: npm run dev changelog add -- -i and follow theprompt. See also: https://github.com/gocodebox/lifterlms/blob/trunk/packages/dev/README.md#changelog-add -->
  • My code has been tested. <!-- Manual testing only; see ">
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Stay; PHPCS not run locally in this environment. Check code:composer run-script check-cs-errors -->

@alexjpanagis alexjpanagis requested a review from brianhogg as a code owner July 1, 2026 12:58
@brianhogg brianhogg moved this to Awaiting Review in Development Jul 1, 2026
Adds LLMS_Admin_Help_Beacon which renders a consent-gated HelpScout beacon
on the LifterLMS admin screens.

- Shown on the core LifterLMS menu pages (Dashboard, Settings, Reporting,
  Import, Status, Resources, Add-ons) and on the screens under the Courses,
  Memberships, Engagements, and Orders menus, including nested post types
  such as achievements, certificates, emails, coupons, and vouchers. Not
  shown on the Courses/Memberships block editors or the Course Builder.
- Shows the support beacon on licensed sites and the pre-sales beacon
  otherwise; both filterable.
- Pre-fills the current user's name and email into the beacon form.
- Attaches the LifterLMS system report to both beacons as agent-only
  session data, kept out of the customer's message box.
- The beacon script is only loaded after the user confirms a consent
  prompt, so no third-party script or cookie loads until opt-in.
@alexjpanagis alexjpanagis force-pushed the feature/help-scout-beacon branch from 816f429 to aa26ba4 Compare July 1, 2026 14:26
@alexjpanagis alexjpanagis changed the base branch from trunk to dev July 1, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants