Skip to the guide
All guides

Turn a finding into a fix

Confirm the problem, authorize a small change, and check that the fix works.

app WordPress DevKit 2.0.3checked reading 3 minutes

On this page

1. Confirm the problem

Read the cited source, the project instructions and the engineering contract of the skill. Work out the actor, the input, the real control flow and the behavior you expect. If the path or the contract is missing, leave the finding unverified. Do not fix a guess.

2. Authorize a bounded fix

A review never edits files. Ask for the change in a new request and set its limits:

Text
Implement only the confirmed missing capability check in fixture_update (plugin.php:4-8).
Read this project's governing instructions first.
State the affected files, intended behavior and validation plan before editing.
Write the failing regression first: subscriber with a valid nonce must get 403 and the option must not change.
Preserve successful administrator writes and unrelated code.
Do not deploy or broaden the task.

3. Fix it where it fails

  1. Look at neighboring handlers and at how the project already validates input and reports errors.
  2. Restore the missing rule at the place where it fails. Do not add a downstream filter, an invented fallback or a new architecture.
  3. Add a regression test that reproduces the original failure and keeps valid operations working.
  4. Run the project's own lint, static analysis, integration or browser checks. Record the tools that are missing and the checks that fail.

4. What a good change looks like

Text
function fixture_update() {
    check_ajax_referer( 'fixture-settings', 'nonce' );
    if ( ! current_user_can( 'manage_options' ) ) {
        wp_send_json_error( array( 'message' => 'Forbidden' ), 403 );
    }
    $banner = isset( $_POST['banner'] ) && is_string( $_POST['banner'] )
        ? sanitize_text_field( wp_unslash( $_POST['banner'] ) )
        : '';
    update_option( 'fixture_banner', $banner );
    wp_send_json_success();
}

The nonce shows the request was intended. The capability check decides who may make it. The fix touches one handler and leaves the administrator path as it was.

5. Make the result easy to review

Ask for these items:

  • The changed files.
  • The behavior before and after.
  • The exact commands, with their exit codes.
  • Screenshots, if the change is visual.
  • The risks that remain.

A source diff supports a fix. Only running the code shows that the behavior is verified.

Acceptance checks

  • A user without the capability gets the usual denied response, and nothing is written.
  • An authorized administrator can still save a valid value.
  • Invalid input follows the validation rules the project already has.
  • No baseline, ignore rule or authorization control was weakened to pass the checks.

Note

This guide covers fixing the target WordPress project. Deployment and publishing are separate tasks, and each needs its own authorization.