WordPress / WordPress/WordPress-Coding-Standards
Add sniff to check that WP is killed in ajax response functions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
Check that any function containing a check_ajax_referer( ... ); call, also contains a call to die(), wp_die() or exit at the end of the same function.
This should be a warning, not an error and will need a whitelist comment as the kill call may be delegated to a function which is called from within the function checking the referrer.
[Edit]: calls to wp_send_json(), wp_send_json_success() and wp_send_json_error() should also be accepted as a way to kill WP as they die.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing sniff implementations and tests for WordPress AJAX functions or referrer checks; no specific files are named in the issue. Verify that functions containing check_ajax_referer() warn unless they end with an accepted kill call, including the listed JSON helpers, while allowing a whitelist comment for delegated termination.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100