Skip to content

Conversation

@arifulhoque7
Copy link
Contributor

@arifulhoque7 arifulhoque7 commented Oct 23, 2025

Close issue

What Changed:

1. New Tailwind CSS Integration

  • Added dedicated Tailwind CSS build system for frontend account pages
  • Created /src/css/frontend/account.css - comprehensive Tailwind component library
  • Updated Vite configuration to include account entry point
  • Implemented conditional CSS loading - only loads on pages with [wpuf_account] or [wpuf_editprofile] shortcodes

2. Modern Sidebar Navigation

  • Redesigned account navigation from horizontal tabs to vertical sidebar layout
  • Added custom SVG icons for each section (Dashboard, Subscription, Edit Profile, Billing Address, Posts)
  • Implemented profile card at top of sidebar with:
    • User avatar (96px rounded)
    • Display name
    • User role
    • Quick "Edit Profile" button with icon
  • Added dedicated logout section at bottom of sidebar with icon
  • Enhanced active state styling with background color and hover effects
  • Improved responsive behavior - sidebar collapses to full-width on mobile/tablet

3. Layout Architecture

  • Changed from single-column to two-column layout:
    • Left sidebar (260px) - navigation and profile
    • Right content area (flex-1) - section content
  • Added proper spacing and visual hierarchy with Tailwind utility classes
  • Implemented responsive breakpoints:
    • Mobile (<768px): Single column, stacked layout
    • Tablet (768-1023px): Single column with adjusted spacing
    • Desktop (1024px+): Two-column sidebar layout

4. Dashboard Section Redesign

  • Updated /templates/dashboard/dashboard.php with modern card-based design
  • Added welcome banner with blue background (bg-blue-50)
  • Created "Quick Links" card with proper typography and spacing
  • Improved readability with better font sizes and line heights

5. Subscription Page Enhancements

  • Redesigned subscription cards with modern rounded borders (24px radius)
  • Implemented 4-column grid layout for subscription features
  • Added expandable "Show Details" button in card header
  • Improved status badges with color-coded indicators
  • Enhanced pricing display with larger, bold typography
  • Added hover effects and transitions on cards
  • Implemented responsive grid:
    • 4 columns on desktop
    • 2 columns on tablet
    • 1 column on mobile

6. Edit Profile Form Styling

  • Modernized all form inputs with consistent styling:
    • Clean borders (border-gray-300)
    • Focus states with blue ring (focus:ring-primary)
    • Proper padding and height (42px)
    • Smooth transitions
  • Updated labels with better typography (14px, semibold)
  • Enhanced password fields with eye icon toggle positioning
  • Improved password strength indicators with color coding
  • Added file upload button styling
  • Updated submit button with primary color scheme (#99A7B2)

7. Form Builder Integration

  • Styled WPUF form builder generated forms to match Tailwind design
  • Removed legacy form styling (lists, old padding/margins)
  • Applied modern input styling to all field types
  • Enhanced form validation and error states
  • Improved help text and required field indicators

8. Posts Table Improvements

  • Added clean table styling with proper borders
  • Implemented status badges for post states (Published, Draft, Pending)
  • Enhanced link styling with hover states
  • Improved overall table typography

9. Color Scheme

  • Primary Brand Color: #99A7B2 (slate gray-blue)
  • Hover State: #7F8C96 (darker slate)
  • Active State Background: #E1E6EA (light gray)
  • Text Colors:
    • Primary: #2C3A41 (dark slate)
    • Secondary: #6C7A85 (medium gray)
  • Borders: #CBD2D9 (light gray)

10. Technical Implementation

  • Prefix: All Tailwind classes use wpuf- prefix to avoid conflicts
  • Build Process:
    • Entry: /assets/js/account.js → imports CSS
    • Output: /assets/css/frontend/account.css
    • Build command: npm run build:account
  • Loading: Conditional enqueue in Frontend.php (lines 183-185)
  • Compatibility: Maintains backward compatibility with existing CSS

Summary by CodeRabbit

  • New Features

    • Redesigned account dashboard with sidebar profile, navigation and main content layout
    • New account-specific styling and assets plus a frontend account script
    • Card-based subscription UI with expandable feature details
  • Bug Fixes

    • Safe fallbacks for image upload settings to prevent uploader errors
    • Improved billing address form structure and accessibility
  • Style

    • Updated post status color and comprehensive account-related visual refinements

@arifulhoque7 arifulhoque7 self-assigned this Oct 23, 2025
@arifulhoque7 arifulhoque7 requested a review from sapayth October 23, 2025 09:35
@arifulhoque7 arifulhoque7 added needs: dev review This PR needs review by a developer needs: testing labels Oct 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Walkthrough

Adds a new account UI with templates, styles, and JS entry; updates build tooling to include an account bundle and Tailwind changes; and adjusts enqueued assets and a couple backend helpers for the account pages.

Changes

Cohort / File(s) Summary
Build & Tooling
Gruntfile.js, package.json, vite.config.mjs, tailwind.config.js
Added account build entry and Vite entry (ENTRY=account), updated Tailwind mappings and watch to include templates/**/*.php, switched watch trigger to use the built-in tailwind task with --minify, and chained build:account into npm run build.
Account Frontend Assets
assets/js/account.js, src/css/frontend/account.css
New JS entry importing a new Tailwind-based frontend/account.css that defines account layouts, forms, subscriptions, posts, and responsive styles.
Account Template & Layout
templates/account.php
New two-column account layout with profile sidebar, dynamic navigation (icon mapping, active state), and logout link; main content area adjusted for account pages.
Dashboard Templates
templates/dashboard/*.php
templates/dashboard/billing-address.php, templates/dashboard/dashboard.php, templates/dashboard/edit-profile.php, templates/dashboard/posts.php, templates/dashboard/subscription.php
Multiple template refactors: grid-based billing-address form, redesigned edit-profile with password strength and social fields, card-based subscription UI with expandable features and JS, posts listing rebuilt with WP_Query, responsive table, custom pagination and dropdown actions, and dashboard quick-links styling.
Backend Enqueue & Field Safety
includes/Frontend.php, includes/Fields/Form_Field_Image.php
Enqueue wpuf-account CSS when account/editprofile shortcodes present; added isset guards and defaults for image field uploader settings (count, max_size).
Small Utility Update
wpuf-functions.php
Adjusted inline color for publish status from #33CC33 to rgb(5, 150, 105).

Estimated code review effort

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

  • Heterogeneous changes across templates, styling, and build config require verifying rendering, asset pipeline, and JS behaviors.
  • Pay extra attention to:
    • templates/dashboard/posts.php — query, pagination, and action links (security/nonces).
    • templates/dashboard/subscription.php — subscription timing logic and cancel flow.
    • Build/tooling: Gruntfile.js, package.json, vite.config.mjs, tailwind.config.js — ensure build produces the expected minified CSS and account bundle.

Possibly related PRs

Suggested reviewers

  • sapayth
  • Rubaiyat-E-Mohammad

Poem

🐇 I hopped a path of CSS and PHP bright,

Built a sidebar, buttons, and a login light,
Cards unfurled, a minified tail spun tight,
JS imports danced beneath the moonlight,
Happy hops — the account page is just right!

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat/account page redesign' accurately summarizes the main change: a comprehensive redesign of the account pages with new layout, styling, and navigation components.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7125a50 and 625ba5f.

📒 Files selected for processing (1)
  • Gruntfile.js (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Gruntfile.js

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

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
templates/dashboard/billing-address.php (1)

15-209: Restore billing field names to prevent JS breakage

All of the new name/id attributes use wpuf_biiling_* (double “ii”). Core scripts and existing CSS target the long‑standing wpuf_billing_* selectors to drive country→state population and validation. With the typo, those listeners never fire, so changing country no longer refreshes the state list and downstream integrations reading $_POST['wpuf_billing_*'] will miss the updates. Please revert to the original spelling throughout (POST handling + markup) to keep the data flow intact.

-    $add_line_1 = isset( $_POST['wpuf_biiling_add_line_1'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_biiling_add_line_1'] ) ) : '';
+    $add_line_1 = isset( $_POST['wpuf_billing_add_line_1'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_billing_add_line_1'] ) ) : '';
...
-                    'name'             => 'wpuf_biiling_country',
-                    'id'               => 'wpuf_biiling_country',
-                    'class'            => 'wpuf_biiling_country wpuf-w-full wpuf-rounded-md wpuf-border-gray-300 focus:wpuf-border-primary focus:wpuf-ring-primary',
+                    'name'             => 'wpuf_billing_country',
+                    'id'               => 'wpuf_billing_country',
+                    'class'            => 'wpuf_billing_country wpuf-w-full wpuf-rounded-md wpuf-border-gray-300 focus:wpuf-border-primary focus:wpuf-ring-primary',
...
-            name="wpuf_biiling_add_line_1"
-            id="wpuf_biiling_add_line_1"
+            name="wpuf_billing_add_line_1"
+            id="wpuf_billing_add_line_1"

(Apply the same rename for every wpuf_biiling_* occurrence.)

🧹 Nitpick comments (11)
includes/Fields/Form_Field_Image.php (1)

81-81: Escape for JS context and cast numeric args.

Use esc_js for the name and cast count/max_size to int to avoid JS-context escaping issues and ensure numbers, not strings.

Apply:

- var uploader = new WPUF_Uploader('wpuf-<?php echo esc_attr( $unique_id ); ?>-pickfiles', 'wpuf-<?php echo esc_attr( $unique_id ); ?>-upload-container', <?php echo esc_attr( isset( $field_settings['count'] ) ? $field_settings['count'] : 1 ); ?>, '<?php echo esc_attr( $field_settings['name'] ); ?>', 'jpg,jpeg,gif,png,bmp,webp', <?php echo esc_attr( isset( $field_settings['max_size'] ) ? $field_settings['max_size'] : 1024 ); ?>);
+ <?php
+   $count    = isset( $field_settings['count'] ) ? (int) $field_settings['count'] : 1;
+   $max_size = isset( $field_settings['max_size'] ) ? (int) $field_settings['max_size'] : 1024;
+ ?>
+ var uploader = new WPUF_Uploader(
+   'wpuf-<?php echo esc_attr( $unique_id ); ?>-pickfiles',
+   'wpuf-<?php echo esc_attr( $unique_id ); ?>-upload-container',
+   <?php echo $count; ?>,
+   '<?php echo esc_js( $field_settings['name'] ); ?>',
+   'jpg,jpeg,gif,png,bmp,webp',
+   <?php echo $max_size; ?>
+ );
templates/dashboard/edit-profile.php (2)

91-94: Add password visibility toggle behavior (icons have no handler).

Icons exist but no JS binds to .wpuf-password-toggle on this page. Either enqueue account.js with a small listener or add a few lines here:

 $(function(){
   // ...existing code...
+  $('.wpuf-password-field').on('click', '.wpuf-password-toggle', function(){
+    const input = $(this).siblings('input[type="password"], input[type="text"]').first();
+    if (!input.length) return;
+    input.attr('type', input.attr('type') === 'password' ? 'text' : 'password');
+  });
 });

Also applies to: 112-114, 132-134


83-91: Use semantic autocomplete hints.

Use autocomplete="current-password" for current and "new-password" for new/confirm to help browsers/managers.

- autocomplete="off"
+ autocomplete="current-password"
- autocomplete="off"
+ autocomplete="new-password"

Also applies to: 103-111, 123-131

vite.config.mjs (1)

8-8: Ensure the new 'account' entry is actually used.

Currently account.js only imports CSS and isn’t enqueued. Either:

  • enqueue it on account/editprofile pages, or
  • drop this entry to avoid dead assets (CSS is already enqueued via PHP).
assets/js/account.js (1)

1-2: Consider hosting small account UI behaviors here.

Add password-visibility toggle and enqueue this file on account/editprofile pages; otherwise this entry is redundant. Example:

document.addEventListener('click', (e) => {
  const btn = e.target.closest('.wpuf-password-toggle');
  if (!btn) return;
  const input = btn.parentElement.querySelector('input');
  if (input) input.type = input.type === 'password' ? 'text' : 'password';
});
includes/Frontend.php (1)

183-186: Enqueue JS for account interactions (optional) and verify CSS path.

  • If you add behaviors to assets/js/account.js, enqueue it here:
 if ( wpuf_has_shortcode( 'wpuf_account' ) || wpuf_has_shortcode( 'wpuf_editprofile' ) ) {
     wp_enqueue_style( 'wpuf-account', WPUF_ASSET_URI . '/css/frontend/account.css', [], WPUF_VERSION );
+    wp_enqueue_script( 'wpuf-account', WPUF_ASSET_URI . '/js/account.min.js', [ 'jquery' ], WPUF_VERSION, true );
 }
  • Please confirm the built CSS lives at css/frontend/account.css in releases to avoid 404s.
tailwind.config.js (1)

13-17: Remove duplicate content path.

'./templates/**/*.php' appears twice. Keep one to reduce noise.

templates/dashboard/dashboard.php (2)

28-50: Use strict comparison and pre-increment.

Small correctness/style fixes:

- if ( 'off' == wpuf_get_option( 'show_subscriptions', 'wpuf_my_account', 'on' ) ) {
+ if ( 'off' === wpuf_get_option( 'show_subscriptions', 'wpuf_my_account', 'on' ) ) {

- if ( $total_tabs == $count ) {
+ if ( $total_tabs === $count ) {

- $count++;
+ ++$count;

8-16: Tidy multi‑line printf indentation to satisfy PHPCS.

Move closing parenthesis to its own line and normalize indentation:

-            printf(
-                wp_kses_post(
-                    __( 'Hello %1$s, (not %1$s? <a href="%2$s" class="wpuf-text-blue-600 hover:wpuf-underline">Sign out</a>)', 'wp-user-frontend' ) ),
+            printf(
+                wp_kses_post(
+                    __( 'Hello %1$s, (not %1$s? <a href="%2$s" class="wpuf-text-blue-600 hover:wpuf-underline">Sign out</a>)', 'wp-user-frontend' )
+                ),
                 '<strong>' . esc_html( $current_user->display_name ) . '</strong>',
                 esc_url( wp_logout_url( get_permalink() ) )
-             );
+            );
-            printf(
-                wp_kses_post(
-                    __( 'From your account dashboard you can view your dashboard, manage your %s', 'wp-user-frontend' ) ),
-                wp_kses( $links, [ 'a' => [ 'href' => [], 'class' => [] ] ] )
-             );
+            printf(
+                wp_kses_post(
+                    __( 'From your account dashboard you can view your dashboard, manage your %s', 'wp-user-frontend' )
+                ),
+                wp_kses( $links, [ 'a' => [ 'href' => [], 'class' => [] ] ] )
+            );

Also applies to: 52-60

templates/dashboard/posts.php (2)

205-214: Assemble and escape the “Pay Now” URL correctly.

Line 210 builds the href by echoing the base URL with esc_attr() and then appending a raw query string, leaving & characters unencoded. Please compose the link with add_query_arg() and escape it with esc_url() so the final HTML attribute is valid:

-                                            <a href="<?php echo esc_attr( trailingslashit( get_permalink( wpuf_get_option( 'payment_page',
-                                                                                                                         'wpuf_payment' ) ) ) ); ?>?action=wpuf_pay&type=post&post_id=<?php echo esc_attr( $post->ID ); ?>"><?php esc_html_e( 'Pay Now', 'wp-user-frontend' ); ?></a>
+                                            <?php
+                                            $payment_url = add_query_arg(
+                                                [
+                                                    'action'  => 'wpuf_pay',
+                                                    'type'    => 'post',
+                                                    'post_id' => $post->ID,
+                                                ],
+                                                trailingslashit( get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) ) )
+                                            );
+                                            ?>
+                                            <a href="<?php echo esc_url( $payment_url ); ?>"><?php esc_html_e( 'Pay Now', 'wp-user-frontend' ); ?></a>

236-241: Escape the delete URL for HTML output.

Line 240 wraps wp_nonce_url() in esc_url_raw(), but that helper is meant for storage and doesn’t encode entities. For safe HTML output (especially to encode the ampersands), please swap to esc_url():

-                                                <a href="<?php echo esc_url_raw( wp_nonce_url( $del_url, 'wpuf_del' ) ); ?>" class="wpuf-block wpuf-px-4 wpuf-py-2 wpuf-text-sm wpuf-text-red-600 hover:wpuf-bg-red-50 wpuf-no-underline" onclick="return confirm('<?php echo esc_attr( $message ); ?>');" role="menuitem">
+                                                <a href="<?php echo esc_url( wp_nonce_url( $del_url, 'wpuf_del' ) ); ?>" class="wpuf-block wpuf-px-4 wpuf-py-2 wpuf-text-sm wpuf-text-red-600 hover:wpuf-bg-red-50 wpuf-no-underline" onclick="return confirm('<?php echo esc_attr( $message ); ?>');" role="menuitem">
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61f733e and 7125a50.

⛔ Files ignored due to path filters (1)
  • assets/js/account.min.js is excluded by !**/*.min.js
📒 Files selected for processing (15)
  • Gruntfile.js (3 hunks)
  • assets/js/account.js (1 hunks)
  • includes/Fields/Form_Field_Image.php (1 hunks)
  • includes/Frontend.php (1 hunks)
  • package.json (1 hunks)
  • src/css/frontend/account.css (1 hunks)
  • tailwind.config.js (1 hunks)
  • templates/account.php (1 hunks)
  • templates/dashboard/billing-address.php (2 hunks)
  • templates/dashboard/dashboard.php (1 hunks)
  • templates/dashboard/edit-profile.php (1 hunks)
  • templates/dashboard/posts.php (1 hunks)
  • templates/dashboard/subscription.php (1 hunks)
  • vite.config.mjs (1 hunks)
  • wpuf-functions.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
includes/Frontend.php (1)
wpuf-functions.php (1)
  • wpuf_has_shortcode (1554-1576)
templates/dashboard/subscription.php (1)
wpuf-functions.php (3)
  • wpuf_get_date (1759-1781)
  • wpuf_date2mysql (1793-1800)
  • wpuf_is_checkbox_or_toggle_on (5599-5601)
templates/account.php (1)
wpuf-functions.php (1)
  • wpuf_get_option (1535-1543)
templates/dashboard/posts.php (1)
wpuf-functions.php (3)
  • wpuf_get_option (1535-1543)
  • wpuf_show_post_status (30-50)
  • wpuf_is_post_editable (4569-4602)
templates/dashboard/billing-address.php (2)
wpuf-functions.php (2)
  • wpuf_map_address_fields (4478-4487)
  • wpuf_select (3671-3769)
includes/Data/Country_State.php (2)
  • getStates (294-316)
  • countries (265-275)
templates/dashboard/dashboard.php (1)
wpuf-functions.php (2)
  • wpuf_get_account_sections (2207-2235)
  • wpuf_get_option (1535-1543)
🪛 GitHub Check: Run PHPCS inspection
templates/account.php

[warning] 41-41:
Loose comparisons are not allowed. Expected: "==="; Found: "=="


[warning] 40-40:
Loose comparisons are not allowed. Expected: "==="; Found: "=="

templates/dashboard/billing-address.php

[warning] 112-112:
When a multi-item array uses associative keys, each value should start on a new line.


[warning] 75-75:
When a multi-item array uses associative keys, each value should start on a new line.

templates/dashboard/dashboard.php

[failure] 57-57:
Multi-line function call not indented correctly; expected 12 spaces but found 13


[warning] 57-57:
Found precision alignment of 1 spaces.


[warning] 56-56:
When a multi-item array uses associative keys, each value should start on a new line.


[failure] 55-55:
Closing parenthesis of a multi-line function call must be on a line by itself


[failure] 55-55:
Multi-line function call not indented correctly; expected 16 spaces but found 20


[warning] 49-49:
Stand-alone post-increment statement found. Use pre-increment instead: ++$count.


[warning] 43-43:
Loose comparisons are not allowed. Expected: "==="; Found: "=="


[warning] 28-28:
Loose comparisons are not allowed. Expected: "==="; Found: "=="


[failure] 26-26:
Overriding WordPress globals is prohibited. Found assignment to $tabs


[failure] 14-14:
Multi-line function call not indented correctly; expected 12 spaces but found 13


[warning] 14-14:
Found precision alignment of 1 spaces.


[failure] 11-11:
Closing parenthesis of a multi-line function call must be on a line by itself


[failure] 11-11:
Multi-line function call not indented correctly; expected 16 spaces but found 20

🔇 Additional comments (1)
wpuf-functions.php (1)

33-33: Status color tweak looks good.

Consistent with the new palette; no behavioral change.

Comment on lines +218 to +260
function check_pass_strength() {
var pass1 = $("#pass1").val(),
pass2 = $("#pass2").val(),
strength;

if ( typeof pass2 === undefined ) {
pass2 = pass1;
}

var pwsL10n = {
empty: "Strength indicator",
short: "Very weak",
bad: "Weak",
good: "Medium",
strong: "Strong",
mismatch: "Mismatch"
};

$("#pass-strength-result").removeClass('short bad good strong');
if (!pass1) {
$("#pass-strength-result").html(pwsL10n.empty);
return;
}

strength = wp.passwordStrength.meter(pass1, wp.passwordStrength.userInputBlacklist(), pass2);

switch (strength) {
case 2:
$("#pass-strength-result").addClass('bad').html(pwsL10n.bad);
break;
case 3:
$("#pass-strength-result").addClass('good').html(pwsL10n.good);
break;
case 4:
$("#pass-strength-result").addClass('strong').html(pwsL10n.strong);
break;
case 5:
$("#pass-strength-result").addClass('short').html(pwsL10n.mismatch);
break;
default:
$("#pass-strength-result").addClass('short').html(pwsL10n['short']);
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix typeof bug and localize strength strings.

  • typeof needs quotes; current check never triggers.
  • Strength labels should be translatable.

Apply:

- if ( typeof pass2 === undefined ) {
+ if ( typeof pass2 === "undefined" ) {
    pass2 = pass1;
 }
- var pwsL10n = {
-   empty: "Strength indicator",
-   short: "Very weak",
-   bad: "Weak",
-   good: "Medium",
-   strong: "Strong",
-   mismatch: "Mismatch"
- };
+ var pwsL10n = {
+   empty: "<?php echo esc_js( __( 'Strength indicator', 'wp-user-frontend' ) ); ?>",
+   short: "<?php echo esc_js( __( 'Very weak', 'wp-user-frontend' ) ); ?>",
+   bad: "<?php echo esc_js( __( 'Weak', 'wp-user-frontend' ) ); ?>",
+   good: "<?php echo esc_js( __( 'Medium', 'wp-user-frontend' ) ); ?>",
+   strong: "<?php echo esc_js( __( 'Strong', 'wp-user-frontend' ) ); ?>",
+   mismatch: "<?php echo esc_js( __( 'Mismatch', 'wp-user-frontend' ) ); ?>"
+ };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function check_pass_strength() {
var pass1 = $("#pass1").val(),
pass2 = $("#pass2").val(),
strength;
if ( typeof pass2 === undefined ) {
pass2 = pass1;
}
var pwsL10n = {
empty: "Strength indicator",
short: "Very weak",
bad: "Weak",
good: "Medium",
strong: "Strong",
mismatch: "Mismatch"
};
$("#pass-strength-result").removeClass('short bad good strong');
if (!pass1) {
$("#pass-strength-result").html(pwsL10n.empty);
return;
}
strength = wp.passwordStrength.meter(pass1, wp.passwordStrength.userInputBlacklist(), pass2);
switch (strength) {
case 2:
$("#pass-strength-result").addClass('bad').html(pwsL10n.bad);
break;
case 3:
$("#pass-strength-result").addClass('good').html(pwsL10n.good);
break;
case 4:
$("#pass-strength-result").addClass('strong').html(pwsL10n.strong);
break;
case 5:
$("#pass-strength-result").addClass('short').html(pwsL10n.mismatch);
break;
default:
$("#pass-strength-result").addClass('short').html(pwsL10n['short']);
}
}
function check_pass_strength() {
var pass1 = $("#pass1").val(),
pass2 = $("#pass2").val(),
strength;
if ( typeof pass2 === "undefined" ) {
pass2 = pass1;
}
var pwsL10n = {
empty: "<?php echo esc_js( __( 'Strength indicator', 'wp-user-frontend' ) ); ?>",
short: "<?php echo esc_js( __( 'Very weak', 'wp-user-frontend' ) ); ?>",
bad: "<?php echo esc_js( __( 'Weak', 'wp-user-frontend' ) ); ?>",
good: "<?php echo esc_js( __( 'Medium', 'wp-user-frontend' ) ); ?>",
strong: "<?php echo esc_js( __( 'Strong', 'wp-user-frontend' ) ); ?>",
mismatch: "<?php echo esc_js( __( 'Mismatch', 'wp-user-frontend' ) ); ?>"
};
$("#pass-strength-result").removeClass('short bad good strong');
if (!pass1) {
$("#pass-strength-result").html(pwsL10n.empty);
return;
}
strength = wp.passwordStrength.meter(pass1, wp.passwordStrength.userInputBlacklist(), pass2);
switch (strength) {
case 2:
$("#pass-strength-result").addClass('bad').html(pwsL10n.bad);
break;
case 3:
$("#pass-strength-result").addClass('good').html(pwsL10n.good);
break;
case 4:
$("#pass-strength-result").addClass('strong').html(pwsL10n.strong);
break;
case 5:
$("#pass-strength-result").addClass('short').html(pwsL10n.mismatch);
break;
default:
$("#pass-strength-result").addClass('short').html(pwsL10n['short']);
}
}

Comment on lines +146 to +152
while ( $dashboard_query->have_posts() ) {
$dashboard_query->the_post();
$show_link = !in_array( $post->post_status, ['draft', 'future', 'pending'] );
$payment_status = get_post_meta( $post->ID, '_wpuf_payment_status', true );
$is_featured = in_array( intval( $post->ID ), $stickies, true ) ? ' - ' . esc_html__( 'Featured', 'wp-user-frontend' ) . ucfirst( $post_type ) : '';
$title = wp_trim_words( get_the_title(), 5 ) . $is_featured;
?>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix sticky “Featured” label construction.

Line 151 currently appends esc_html__( 'Featured', ... ) directly to ucfirst( $post_type ), producing user-facing strings like “FeaturedPost” and exposing the raw slug instead of the translatable post-type label. Please switch to the singular label, and build the string with whitespace so locales can translate it cleanly. Example fix:

-        $is_featured      = in_array( intval( $post->ID ), $stickies, true ) ? ' - ' . esc_html__( 'Featured', 'wp-user-frontend' ) . ucfirst( $post_type ) : '';
+        $is_featured      = in_array( (int) $post->ID, $stickies, true )
+            ? sprintf(
+                ' - %s %s',
+                esc_html__( 'Featured', 'wp-user-frontend' ),
+                esc_html( $post_type_obj->labels->singular_name )
+            )
+            : '';

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In templates/dashboard/posts.php around lines 146 to 152, the construction of
the sticky “Featured” label concatenates esc_html__( 'Featured', ... ) directly
to ucfirst($post_type) producing “FeaturedPost” and exposing the slug; replace
this by retrieving the post type’s singular, translatable label (e.g. via
get_post_type_object($post_type)->labels->singular_name), assemble the final
string with a separating space (or use sprintf/esc_html__ with a placeholder) so
locales can translate properly, and ensure the label is escaped with esc_html
before output.

@Rubaiyat-E-Mohammad
Copy link
Contributor

@Rubaiyat-E-Mohammad
Copy link
Contributor

Billing Address>> State selection dropdown style is being changed while country changed from default @arifulhoque7 vai
https://www.dropbox.com/scl/fi/o5v8taf4t64vc9n9pqkgb/Screen-Recording-2025-11-06-at-11.50.17-AM.mov?rlkey=tle1x2qq5gbzqqvx0nsq8aflb&dl=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug needs: dev review This PR needs review by a developer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants