Skip to content

Internal: Add Upgrade to Pro button in Hello Theme top bar [TMZ-1067] - #680

Open
Ntnelbaba wants to merge 8 commits into
mainfrom
internal/TMZ-1067-upgrade-to-pro-top-bar
Open

Internal: Add Upgrade to Pro button in Hello Theme top bar [TMZ-1067]#680
Ntnelbaba wants to merge 8 commits into
mainfrom
internal/TMZ-1067-upgrade-to-pro-top-bar

Conversation

@Ntnelbaba

@Ntnelbaba Ntnelbaba commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Removing the Hello Theme Home screen also removed the Upgrade to Pro banner, leaving no upgrade CTA in the admin. This adds one to the Hello settings top bar, reusing the same go.elementor.com/hello-upgrade-epro link the old banner used.

  • Admin_Top_Bar localizes the upgrade URL only when Elementor Pro is inactive, so the Pro check lives in PHP and the React side just renders whatever config it is given.
  • New UpgradeButton renders Upgrade Now with CrownIcon and color="promotion", matching how Core styles its own admin top bar upgrade CTA.
  • The top bar root is now wrapped in the Elementor UI ThemeProvider, matching the settings and conversion banner entries. Without it the tree falls back to the default MUI theme, which has no promotion palette entry, so the button did not paint.

Jira

TMZ-1067

Test plan

  • With Elementor Pro deactivated, open admin.php?page=hello-elementor-settings and confirm the crown + Upgrade Now button appears at the right of the top bar
  • Confirm it links to https://go.elementor.com/hello-upgrade-epro/ and opens in a new tab
  • With Elementor Pro activated, confirm the button is absent and window.ehpTopBarConfig is not defined
  • Confirm the existing Hello branding and top bar layout are unchanged in both light and dark admin color schemes

Made with Cursor

✨ PR Description

1. Problem & Context

Adding "Upgrade to Pro" button to Hello Theme admin top bar for users without Elementor Pro, reducing friction to upgrade path. Ticket: TMZ-1067.

2. What Changed (Where)

  • admin-top-bar.php: Added config constants and conditional script localization with upgrade URL (only for non-Pro users)
  • settings-controller.php: Stored parent slug, added hook to hide Settings submenu item on admin_head
  • top-bar-content.js & upgrade-button.js: New UpgradeButton component consuming config from window object
  • hello-elementor-topbar.js: Wrapped App in ThemeProvider for styling
  • theme-settings.test.ts: Updated test to verify zero submenu items instead of checking Home text

3. How It Works

TopBar mounts on DOMContentLoaded → renders UpgradeButton if window.ehpTopBarConfig.upgradeUrl exists → PHP conditionally localizes script data only for non-Pro users via Utils::has_pro() check. Settings submenu hidden via separate admin_head action hook (avoids page hook resolution issues from admin_menu).

4. Risks

Config object accessed directly from window without type safety; gracefully handles missing data but depends on script localization executing. ThemeProvider wrapping adds dependency on Elementor UI theme consistency.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

The Hello Theme Home screen and its Upgrade to Pro banner were removed,
leaving no upgrade CTA in the admin. Add one to the settings top bar,
reusing the go.elementor.com/hello-upgrade-epro link the banner used.

The upgrade URL is only localized when Elementor Pro is inactive, so the
Pro check stays in PHP and the button renders from the config alone.

Wrap the top bar root in the Elementor UI ThemeProvider, matching the
settings and conversion banner entries. Without it the tree falls back
to the default MUI theme, which has no promotion palette entry.

Ref: TMZ-1067
Co-authored-by: Cursor <cursoragent@cursor.com>
davseve
davseve previously approved these changes Aug 16, 2026
The Hello menu item already redirects to the settings page, so the
Settings submenu entry was the only item in the flyout and duplicated
that destination.

Hide it with remove_submenu_page, which only unsets the display entry
and leaves the page registered. The settings URL keeps working for
existing links, the Finder entry, and the screen ID that gates the
settings script enqueue.

Ref: TMZ-1067
Co-authored-by: Cursor <cursoragent@cursor.com>
Ntnelbaba and others added 2 commits August 16, 2026 16:04
…-1067]

Removing the submenu entry during admin_menu made the settings page
return "Sorry, you are not allowed to access this page". WordPress
resolves a plugin page's hook through get_admin_page_parent, which
finds the parent by scanning the submenu globals. admin.php builds the
menu before it resolves the hook, so the entry was already gone and the
lookup failed.

Move the removal to admin_head, which runs after the hook is resolved
and before menu-header.php renders the sidebar.

Ref: TMZ-1067
Co-authored-by: Cursor <cursoragent@cursor.com>
@Ntnelbaba
Ntnelbaba requested a review from davseve August 16, 2026 13:12
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

Hello Elementor Build

Last updated at: 20260816.1434
Version: 3.4.9

✅ Hello Elementor build is ready for download.

You can download the latest build from the link below:

🔗 hello-elementor.3.4.9.zip

The build is available for 7 days.

Comment thread modules/admin-home/components/settings-controller.php Outdated
davseve
davseve previously approved these changes Aug 16, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants