WordPress / WordPress/Learn

Feedback - Server Side validation is required for the Subscribe form.

Open
#3,099 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting Triage
Dominant language
PHP
Stars
333
Forks
127
Avg merge
1d 7h
Merged PRs (30d)
11

Description

Type of feedback

// dev

Description

Server-side validation occurs on the server after the data has been submitted.

Currently, if a user removes a required parameter using the browser's inspect tool, no validation is triggered when the popup opens for the first time. However, if the user removes the required parameter again, an error is generated in the console, preventing the process from proceeding.

Step-by-step reproduction instructions (optional)

  1. Go to Learn WordPress
  2. Scroll down to the Sign up for updates section, open the browser's inspect tool, and remove the required parameter.
  3. Click on the Subscribe button.
  4. Now, a popup for Learn WordPress will open.
  5. Again, open the inspect tool and remove the required parameter from the popup form.
  6. Again Click on the Subscribe button.
  7. Now, you will see that there is no error displayed for the required email field. However, the console shows the following error: Uncaught SyntaxError: "[object Object]" is not valid JSON

Screenshots or screen recording (optional)

https://github.com/user-attachments/assets/4ec3fe38-8d0f-4415-9ecb-e62b0b977e3e

Suggested Fix

Make sure to check all form fields on the server, especially the ones marked as required. This will help avoid errors and protect the form from security issues like SQL injection and cross-site scripting (XSS).
Validating the input on the server is important because even if someone tries to change the form data using tools like inspect element, the data will still be checked and secured before being processed.

If you have any questions or concerns, just let me know.

Thank you.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file, test, or server entry point is named. Start by tracing the Learn WordPress Subscribe form and its first popup submission into the server-side handler; done means required fields are validated there and the missing-email case displays an error without the reported JSON console error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.