Memory Wiki

Untitled Session

2026-06-01 03:36 UTC · 30 messages · cli

You2026-06-01 03:36 UTC
Modify pmpro-signup-shortcode plugin so the "Name" field value maps to display_name, and username/user_login is populated from the email field instead.
Donna2026-06-01 03:36 UTC
Tool2026-06-01 03:36 UTC
{"content": "", "total_lines": 0, "file_size": 0, "truncated": false, "is_binary": false, "is_image": false, "error": "File not found: /var/www/html/wp-content/plugins/pmpro-signup-shortcode/pmpro-signup-shortcode.php"}
Donna2026-06-01 03:36 UTC
Tool2026-06-01 03:36 UTC
{"output": "LICENSE.md\nblocks\nlanguages\npackage-lock.json\npmpro-signup-shortcode.php\nreadme.txt", "exit_code": 0, "error": null}
Donna2026-06-01 03:36 UTC
Tool2026-06-01 03:36 UTC
{"output": "1\t<?php\n 2\t/**\n 3\t * Plugin Name: Paid Memberships Pro - Signup Shortcode & Block\n 4\t * Plugin URI: https://www.paidmembershipspro.com/add-ons/pmpro-signup-shortcode/\n 5\t * Description: Embed signup forms anywhere on your WordPress site. Designed to simplify memb...
Donna2026-06-01 03:36 UTC
Now let me read the full file to see the rest:
Tool2026-06-01 03:36 UTC
{"content": "", "total_lines": 0, "file_size": 0, "truncated": false, "is_binary": false, "is_image": false, "error": "File not found: /var/www/html/wp-content/plugins/pmpro-signup-shortcode/pmpro-signup-shortcode.php"}
Donna2026-06-01 03:36 UTC
Tool2026-06-01 03:36 UTC
{"output": "500\t\t\t\t\t\t\t\t\t\t\t<input id=\"fullname\" name=\"fullname\" type=\"text\" class=\"input\" size=\"30\" value=\"\" /> <strong><?php esc_html_e('LEAVE THIS BLANK', 'pmpro-signup-shortcode');?></strong>\n 501\t\t\t\t\t\t\t\t\t\t</div>\n 502\t\n 503\t\t\t\t\t\t\t\t\t<?php } ?>\n ...
Donna2026-06-01 03:36 UTC
Now I have the full picture. Let me copy the file locally so I can use the patch tool, apply the three changes, then copy it back.
Tool2026-06-01 03:36 UTC
{"output": "", "exit_code": 0, "error": null}
Donna2026-06-01 03:36 UTC
Now apply the three changes: **Change 1:** Modify `pmprosus_skip_username_password()` to save name and override username with email.
Tool2026-06-01 03:36 UTC
{"success": true, "diff": "--- a//root/pmpro-signup-shortcode.php\n+++ b//root/pmpro-signup-shortcode.php\n@@ -23,19 +23,24 @@\n \tUse Email Address as Username and Generate a Password\n */\n function pmprosus_skip_username_password() {\n-\n-\t// Copy email to username if no username field is presen...
Donna2026-06-01 03:36 UTC
**Change 2:** Modify `pmprosus_set_display_name_to_email()` to use the saved name value.
Tool2026-06-01 03:36 UTC
{"success": true, "diff": "--- a//root/pmpro-signup-shortcode.php\n+++ b//root/pmpro-signup-shortcode.php\n@@ -106,12 +106,18 @@\n \tSet display_name to the email address when signing up via the shortcode.\n */\n function pmprosus_set_display_name_to_email( $new_user_array ) {\n-\t// Only apply to s...
Donna2026-06-01 03:36 UTC
**Change 3:** Fix the autocomplete attribute on the Name field.
Tool2026-06-01 03:36 UTC
{"success": true, "diff": "--- a//root/pmpro-signup-shortcode.php\n+++ b//root/pmpro-signup-shortcode.php\n@@ -450,7 +450,7 @@\n \t\t\t\t\t\t\t\t\t<?php if ( $short !== 'emailonly') { ?>\n \t\t\t\t\t\t\t\t\t\t<div class=\"<?php echo esc_attr( pmpro_get_element_class( 'pmpro_form_field pmpro_form_fie...
Donna2026-06-01 03:36 UTC
All three patches applied. Let me verify the changes and copy the file back.
Tool2026-06-01 03:36 UTC
{"content": " 22|/*\n 23|\tUse Email Address as Username and Generate a Password\n 24|*/\n 25|function pmprosus_skip_username_password() {\n 26|\t\n 27|\t\t// If a username field is present (the \"Name\" field), save its value for display_name\n 28|\t\t// then override username/...
Tool2026-06-01 03:36 UTC
{"content": " 100|\tremove_shortcode('pmpro_signup');\n 101|\tadd_shortcode('pmpro_signup', 'pmprosus_signup_shortcode');\n 102|}\n 103|add_action('init', 'pmprosus_load_shortcode');\n 104|\n 105|/*\n 106|\tSet display_name to the email address when signing up via the shortcode.\n 10...
Tool2026-06-01 03:36 UTC
{"content": " 448|\t\t\t\t\t\t\t\t\t</div>\n 449|\t\t\t\t\t\t\t\t<?php } else { ?>\n 450|\t\t\t\t\t\t\t\t\t<?php if ( $short !== 'emailonly') { ?>\n 451|\t\t\t\t\t\t\t\t\t\t<div class=\"<?php echo esc_attr( pmpro_get_element_class( 'pmpro_form_field pmpro_form_field-text pmpro_form_field-use...
Donna2026-06-01 03:36 UTC
Tool2026-06-01 03:36 UTC
{"output": "453:\t\t\t\t\t\t\t\t\t\t\t<input id=\"username\" name=\"username\" type=\"text\" class=\"<?php echo esc_attr( pmpro_get_element_class( 'pmpro_form_input pmpro_form_input-text', 'username' ) ); ?>\" autocomplete=\"name\" value=\"<?php echo esc_attr( $username ); ?>\" <?php if( ! empty( $h...
Donna2026-06-01 03:36 UTC
All changes verified. Now copy the modified file back to the container.
Tool2026-06-01 03:36 UTC
{"output": "", "exit_code": 0, "error": null}
Donna2026-06-01 03:36 UTC
Let me do a final verification from within the container.
Tool2026-06-01 03:36 UTC
{"output": "25:function pmprosus_skip_username_password() {\n31:\t\t\t\tglobal $pmprosus_name_value;\n32:\t\t\t\t$pmprosus_name_value = sanitize_text_field( $_REQUEST['username'] );\n68:add_action( 'init', 'pmprosus_skip_username_password' );\n108:function pmprosus_set_display_name_to_email( $new_us...
Donna2026-06-01 03:36 UTC
All changes are in place and verified. Here's a summary: --- ## Summary **File modified:** `/var/www/html/wp-content/plugins/pmpro-signup-shortcode/pmpro-signup-shortcode.php` (in container `testing-app-1`) ### Three changes made: **1. `pmprosus_skip_username_password()` (line 25-67)** — Name-to-display_name pipeline Previously: only copied email to `$_REQUEST['username']` if no username field was present (`! isset`). Since the form now has a "Name" field with `name="username"`, that condition was **false** — so the name text was passed through as `user_login`, which is wrong. Now: - Always overrides `$_REQUEST['username']` with the email value (so `user_login = email`) - Before overriding, saves the name value into a global `$pmprosus_name_value` via `sanitize_text_field()` - Same logic applied to `$_POST` and `$_GET` for consistency **2. `pmprosus_set_display_name_to_email()` (line 108-120)** — Display name from saved name Previously: always set `display_name = user_email`. Now: - Reads `$pmprosus_name_value` (saved in step 1) - If available: sets both `display_name` and `nickname` to the name value - Fallback: if no name was captured, sets `display_name = user_email` (backward-compatible) **3. Autocomplete attribute** (line 453) Changed `autocomplete="username"` to `autocomplete="name"` on the Name field, since it now expects a person's name, not a login username. ### Data flow after changes: | Form Field | Input Value | Saved As | |---|---|---| | **Name** (name="username") | "John Smith" | `display_name`, `nickname` | | **Email** (name="bemail") | "john@example.com" | `user_login`, `user_email` |