Untitled Session
2026-06-01 05:31 UTC · 32 messages · cli
You2026-06-01 05:33 UTC
Change the BP login form on /login/ to show Email + Password instead of Username + Password, and ensure Google signups use email as the username.
Donna2026-06-01 05:33 UTC
Let me start by reading the existing mu-plugin and understanding its current state.
Tool2026-06-01 05:33 UTC
{"content": " 1|<?php\n 2|/**\n 3| * Plugin Name: Nextend Social Login - Pro Unlock & BP Fix\n 4| * Description: Unlocks Pro features in Nextend Social Login; fixes BP register/login layout; auto-creates PMPro free membership + BP member profile for Google signups.\n 5| * Version...
Donna2026-06-01 05:33 UTC
Now let me check if Nextend is installed and look at how it creates users, to understand if the email-as-username change is needed.
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Donna2026-06-01 05:33 UTC
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Donna2026-06-01 05:33 UTC
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Donna2026-06-01 05:33 UTC
Tool2026-06-01 05:33 UTC
{"output": "total 24\ndrwxr-xr-x 6 root root 4096 Jun 1 05:11 .\ndrwxr-xr-x 5 root root 4096 May 29 02:27 ..\ndrwxr-xr-x 3 root root 4096 Jun 1 05:11 nextend-facebook-connect\ndrwxr-xr-x 5 root root 4096 May 28 05:50 profe-chassis\ndrwxr-xr-x 4 root root 4096 May 28 04:06 profe-crm\ndrwxr-xr-x 2 r...
Donna2026-06-01 05:33 UTC
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Tool2026-06-01 05:33 UTC
{"total_count": 0}
Donna2026-06-01 05:33 UTC
Tool2026-06-01 05:33 UTC
{"output": "/var/www/html/wp-content/plugins/nextend-facebook-connect/template-parts/embedded-login/above.php", "exit_code": 0, "error": null}
Donna2026-06-01 05:33 UTC
Tool2026-06-01 05:33 UTC
{"output": "/var/www/html/wp-content/plugins/nextend-facebook-connect/template-parts/embedded-login/above.php", "exit_code": 0, "error": null}
Donna2026-06-01 05:33 UTC
The Nextend plugin is just a skeleton. Let me now make all the changes to the mu-plugin. I'll proceed with all three tasks.
First, let me add the **Task 1** code — changing "Username" to "Email" on the BP login form:
Tool2026-06-01 05:33 UTC
{"success": true, "diff": "--- a//var/www/html/wp-content/mu-plugins/nextend-pro-unlock.php\n+++ b//var/www/html/wp-content/mu-plugins/nextend-pro-unlock.php\n@@ -280,7 +280,88 @@\n }\n \n // ============================================================\n-// 6. Membership redirect gate — logged-out /...
Donna2026-06-01 05:33 UTC
Good, now I need to add the `nsl_ensure_email_as_username()` call into both existing Nextend hooks (sections 5). Let me update both:
Tool2026-06-01 05:33 UTC
{"success": true, "diff": "--- a//var/www/html/wp-content/mu-plugins/nextend-pro-unlock.php\n+++ b//var/www/html/wp-content/mu-plugins/nextend-pro-unlock.php\n@@ -151,6 +151,11 @@\n return;\n }\n \n+ // --- Ensure email is used as username for Google signups ---\n+ if ($provider ==...
Donna2026-06-01 05:33 UTC
Now let me verify the complete file and run PHP syntax check:
Tool2026-06-01 05:33 UTC
{"content": " 145|// 5. Auto-assign PMPro Free membership on Nextend registration\n 146|// + ensure BuddyPress member profile is initialized\n 147|// ============================================================\n 148|add_action('nsl_register_new_user', function ($user_id, $provider) {\n ...
Tool2026-06-01 05:33 UTC
{"content": " 280| }\n 281| .nsl-bp-login-above .nsl-container-buttons,\n 282| .nsl-bp-login-below .nsl-container-buttons {\n 283| text-align: ' . esc_attr($align) . ';\n 284| }\n 285| </style>';\n 286|\n 287| return $html;\n 288|}\n 2...
Tool2026-06-01 05:33 UTC
{"output": "No syntax errors detected in /var/www/html/wp-content/mu-plugins/nextend-pro-unlock.php", "exit_code": 0, "error": null}
Donna2026-06-01 05:33 UTC
PHP lint passes clean. Let me do a final full read to confirm the end of the file is intact:
Tool2026-06-01 05:33 UTC
{"content": " 380| if (\n 381| strpos($request_uri, '/login/') === 0\n 382| || strpos($request_uri, '/wp-login.php') === 0\n 383| || strpos($request_uri, '/wp-admin') === 0\n 384| || strpos($request_uri, '/wp-json/') === 0\n 385| ) {\n 386| retu...
Donna2026-06-01 05:33 UTC
All changes are complete. Here's a summary of what was done:
---
## Summary
**File modified:** `/var/www/html/wp-content/mu-plugins/nextend-pro-unlock.php` (337 → 426 lines, PHP lint: clean)
### Task 1: BP login form — Username → Email (lines 290–336)
Three-layer approach to ensure the label changes reliably:
1. **`bp_login_form_args` filter** (line 298): Directly sets `label_username` to `'Email'` in BP's login form args — the cleanest PHP-side approach for the `<!-- wp:bp/login-form /-->` block
2. **`gettext` fallback** (line 306): Catches any remaining "Username" string rendered on the BP login page across WordPress's default, buddypress, and core text domains — scoped with `bp_is_login_page()` so it doesn't touch anything elsewhere
3. **Inline JS via `wp_footer`** (line 322): Adds `placeholder="Enter your email"` to the `#user_login` input field — only fires on the BP login page
### Task 2: Google signups — email as username (lines 338–369)
Added `nsl_ensure_email_as_username()` helper function:
- Compares `user_login` vs `user_email` after Nextend creates the user
- If different, sanitizes the email with `sanitize_user($email, false)` (preserving `@` and dots) and updates via `wp_update_user()`
- Called from **both** Nextend hooks:
- `nsl_register_new_user` — only when `$provider === 'google'`
- `nsl_google_register_new_user` — always runs (provider-specific)
This ensures the login credential (email) and username are the same, so the "Email" label change works seamlessly — users type their email in the field and it matches their stored username.
### Task 3: Existing PMPro + BP hooks intact
The original `pmpro_changeMembershipLevel(2, ...)` and `bp_core_new_user_activity(...)` calls are **completely untouched** in both hooks (lines 159–171, 183–192). The email-as-username logic runs *before* them as an independent step, so the membership assignment and BP profile initialization continue to fire normally.