Skip to content

feat: redesign Upgrade to Pro (Premium) admin page#1896

Open
arifulhoque7 wants to merge 3 commits into
weDevsOfficial:developfrom
arifulhoque7:feature/upgrade-to-pro-redesign
Open

feat: redesign Upgrade to Pro (Premium) admin page#1896
arifulhoque7 wants to merge 3 commits into
weDevsOfficial:developfrom
arifulhoque7:feature/upgrade-to-pro-redesign

Conversation

@arifulhoque7

@arifulhoque7 arifulhoque7 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Ref: weDevsOfficial/wpuf-pro#1489

Summary

Rebuilds the free-only Premium page (admin.php?page=wpuf_premium) to match the WPUF "Upgrade to Pro" Figma redesign. The page is gated to the free version (! class_exists( 'WP_User_Frontend_Pro' )) — unchanged.

What's included

  • Hero — crown + soft glow, "Up to 30% Off" badge, Upgrade button
  • Feature comparison — Lite vs Pro table (check / lock / Limited marks, Pro crown)
  • What Changes — 9-card grid with exact Figma icons
  • Modules & integrations — 8 brand tiles (Zapier, Mailchimp, PMPro, SEO, HTML Email, SMS, BuddyPress, QR)
  • Pricing — Annual/Lifetime toggle (vanilla JS) that swaps price, period suffix, and the lifetime discount chip + strikethrough original price; handwritten "Up to 30% Off" note + arrow doodle
  • Refund policy — money-back badge + payment logos (transparent, with dividers)
  • CTA banner
  • Full-width white admin header band matching the post-forms header

Implementation notes

  • New standalone assets/css/admin/premium.css + assets/js/admin/premium.js, enqueued only on the premium page hook (enqueue_premium_script() in Menu.php)
  • Self-hosted Inter + Caveat fonts via @font-face (no Google Fonts CDN dependency)
  • Figma-exact assets under assets/images/premium/
  • Scoped CSS resets so WP admin core styles don't leak in; banded sections run edge-to-edge
  • UTM-tagged pricing/module links

Build fix (2nd commit)

npm run build previously ran only Vite + Tailwind, skipping grunt less/concat/uglify. After v4.3.8 untracked the generated assets, a fresh local pull left registration-forms.css, the form-builder JS, etc. missing — so the free Registration page rendered unstyled. Added a build:legacy step so a single npm run build produces a fully working plugin locally, matching what grunt release ships in CI.

Test plan

  • Free version (Pro inactive): User Frontend → Premium renders the redesigned page
  • Annual ⇄ Lifetime toggle swaps prices, period, and discount chips
  • Buttons keep white text on focus (no WP blue ring/colour)
  • composer phpcs clean on changed PHP
  • npm run build now regenerates the legacy LESS/concat/uglify assets

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Redesigned the “Premium/Upgrade to Pro” admin page with a refreshed layout, including a feature comparison table, modules grid, and pricing plans section.
    • Added interactive pricing period toggle to switch plan amounts, periods, and discounts.
  • Style
    • Added a dedicated premium stylesheet with consistent typography and normalized form/button appearance for the page.
    • Improved responsiveness with mobile/tablet-friendly spacing and layout adjustments.

arifulhoque7 and others added 2 commits June 23, 2026 12:37
Rebuild the free-only Premium page (admin.php?page=wpuf_premium) to match the
WPUF "Upgrade to Pro" Figma redesign.

- Hero (crown + soft glow, "Up to 30% Off" badge), Lite-vs-Pro feature
  comparison table, "What Changes" 9-card grid, modules/integrations grid,
  pricing with Annual/Lifetime toggle, refund policy, and CTA banner
- Full-width white admin header band matching the post-forms header
- Self-hosted Inter + Caveat fonts via @font-face (no Google CDN dependency)
- Annual/Lifetime toggle (vanilla JS) swaps price, period suffix, and the
  lifetime discount chip + strikethrough original price
- Figma-exact assets: feature icons, module tiles, payment logos with
  dividers, money-back badge (transparent)
- Scoped resets so WP admin core CSS cannot leak into the page; bands run
  edge-to-edge

Files:
- includes/Admin/views/premium.php — rewritten marketing view
- includes/Admin/Menu.php — enqueue_premium_script() on the premium hook
- assets/css/admin/premium.css, assets/js/admin/premium.js
- assets/fonts/{inter,caveat}, assets/images/premium/*

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Since v4.3.8 untracked the generated assets (built in CI), `npm run build`
only ran Vite + Tailwind and skipped `grunt less`, `grunt concat`, and
`grunt uglify`. After a fresh pull those outputs were missing locally —
registration-forms.css, admin.css, frontend-forms.css, the form-builder JS,
and frontend-form/upload .min.js — so pages that enqueue them (e.g. the free
Registration page) rendered unstyled.

Add a `build:legacy` step (less + concat + uglify) to the build chain so a
single `npm run build` produces a fully working plugin locally, matching what
`grunt release` ships in CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 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

Run ID: 2fbcaa0c-0641-42b6-9c23-695f3b6fdb71

📥 Commits

Reviewing files that changed from the base of the PR and between 516674b and 55ece81.

📒 Files selected for processing (2)
  • assets/css/admin/premium.css
  • includes/Admin/views/premium.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • assets/css/admin/premium.css
  • includes/Admin/views/premium.php

Walkthrough

Replaces the legacy WPUF Premium admin page with a redesigned marketing page. A new premium.php view uses data-driven arrays to render a hero, feature comparison table, "What Changes" cards, modules grid, and pricing plan cards with annual/lifetime toggle. New premium.css (1063 lines) provides all styling; premium.js handles the pricing period toggle. Menu.php wires asset enqueuing, and package.json adds a Grunt legacy build step.

Changes

Premium Page Redesign

Layer / File(s) Summary
Asset enqueuing and build pipeline
includes/Admin/Menu.php, package.json
Menu::enqueue_premium_script() is added and hooked via load-{premium_hook}; enqueues premium.css and premium.js using WPUF_ASSET_URI and WPUF_VERSION. package.json build chain updated to run build:legacy before build:css.
View data structures
includes/Admin/views/premium.php (lines 1–212)
Defines $wpuf_changes, $wpuf_compare, $wpuf_module_cards, and $wpuf_plans data arrays; sets up pricing/modules target URLs and asset base path used throughout all page sections.
Page HTML sections
includes/Admin/views/premium.php (lines 213–421)
Renders the full redesigned page: top bar, hero, comparison table iterating $wpuf_compare with conditional Lite states, "What Changes" cards, modules grid, pricing section with annual/lifetime toggle UI and plan cards, refund policy block, and final CTA banner.
CSS fonts, resets, typography, and shared primitives
assets/css/admin/premium.css (lines 1–229)
Self-hosts Inter and Caveat variable fonts via @font-face, applies admin-wrapper layout resets for edge-to-edge bands, scopes typography with defensive resets, normalizes form controls, and defines shared section wrappers, column sizing, and button variants.
CSS component styling: top bar through modules
assets/css/admin/premium.css (lines 230–676)
Implements component CSS for the top bar (flex, logo, version pill, action buttons), hero (dark background, glow, crown/badge), feature comparison table (marks, chips, dividers), "What Changes" 3-column card grid, and modules 4-column grid.
CSS pricing, refund policy, CTA, and responsive
assets/css/admin/premium.css (lines 677–1063)
Styles the pricing toggle pill with Caveat "Up to 30% Off" annotation, plan cards with featured borders, discount chips, feature list rows, refund policy gradient callout, CTA banner decoration, and 1100px/782px breakpoints for stacked/mobile layouts.
JS pricing period toggle
assets/js/admin/premium.js
IIFE on DOMContentLoaded caches plan amount/period/discount NodeLists, implements applyPeriod() to swap prices via data-{period} attributes and show/hide discount rows, and attaches click handlers to toggle .is-active and call applyPeriod.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

needs: dev review

Suggested reviewers

  • sapayth

Poem

🐰 A brand-new page has come to light,
With fonts and grids and toggle delight,
The crown sits proud above the hero bright,
Plans displayed with annual/lifetime price,
And little rabbit hopped through every line —
"Pro features await, just click Upgrade to shine!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: redesign Upgrade to Pro (Premium) admin page' clearly and concisely describes the main change: a complete redesign of the premium/upgrade page, which is the primary focus of all modifications across CSS, JavaScript, and template files.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@arifulhoque7 arifulhoque7 self-assigned this Jun 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/css/admin/premium.css`:
- Around line 110-113: The `.wpuf-premium-page a:focus` rule and its
corresponding button focus rule (around line 137) are removing outline and
box-shadow properties without providing replacement keyboard-visible focus
styles. Instead of removing these focus indicators with `outline: none` and
`box-shadow: none`, replace them with alternative visible focus styles such as a
colored outline, box-shadow with a distinct color, or a border that makes the
focused element clearly visible for keyboard navigation. Apply consistent focus
styling to both the anchor and button focus states to ensure all interactive
controls are discernible during keyboard navigation.

In `@includes/Admin/views/premium.php`:
- Line 361: The dynamic output in HTML attributes on lines 361 and 376 is not
properly escaped for security. Wrap the conditional ternary expressions that
output `$plan['featured']` logic with the `esc_attr()` function. Specifically,
for the class attribute containing the wpuf-pp-plan conditional logic and the
style attribute on line 376, apply `esc_attr()` around the entire ternary
expression (e.g., `esc_attr($plan['featured'] ? 'value' : '')`) to ensure proper
attribute escaping according to WordPress coding standards.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0dfd77cb-6f5e-48a9-ade3-179beace4d96

📥 Commits

Reviewing files that changed from the base of the PR and between 594b862 and 516674b.

⛔ Files ignored due to path filters (23)
  • assets/fonts/caveat/Caveat-latin.woff2 is excluded by !**/*.woff2
  • assets/fonts/inter/Inter-latin.woff2 is excluded by !**/*.woff2
  • assets/images/premium/hero-crown.png is excluded by !**/*.png
  • assets/images/premium/hero-glow.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-1.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-2.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-3.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-4.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-5.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-6.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-7.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-8.png is excluded by !**/*.png
  • assets/images/premium/icons/feat-9.png is excluded by !**/*.png
  • assets/images/premium/mod-buddypress.png is excluded by !**/*.png
  • assets/images/premium/mod-html-email.png is excluded by !**/*.png
  • assets/images/premium/mod-mailchimp.png is excluded by !**/*.png
  • assets/images/premium/mod-pmpro.png is excluded by !**/*.png
  • assets/images/premium/mod-qr.png is excluded by !**/*.png
  • assets/images/premium/mod-seo.png is excluded by !**/*.png
  • assets/images/premium/mod-sms.png is excluded by !**/*.png
  • assets/images/premium/mod-zapier.png is excluded by !**/*.png
  • assets/images/premium/payment-logos.png is excluded by !**/*.png
  • assets/images/premium/refund-badge.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • assets/css/admin/premium.css
  • assets/js/admin/premium.js
  • includes/Admin/Menu.php
  • includes/Admin/views/premium.php
  • package.json

Comment thread assets/css/admin/premium.css
Comment thread includes/Admin/views/premium.php Outdated
Address CodeRabbit review on PR weDevsOfficial#1896:
- premium.php: wrap plan class/style ternaries in esc_attr()
- premium.css: add :focus-visible rule for links and buttons

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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