What code review looks for
The problems code review reports, and where in your code it starts.
Code review looks for problems worth fixing: code that can cause PHP errors or warnings, does not do what it intends, slows pages down, may stop working on newer PHP or WordPress, or breaks when something else changes. It reports a security problem only when it can trace a way for visitors or users who are not administrators to reach it. It also reports code that stops working when a plugin it uses is turned off, outdated WooCommerce template copies and functions your PHP version no longer has. Libraries bundled inside your code are not reviewed. The review does not replace a security scanner.
Custom code is reviewed in full. The review starts where problems matter most:
- Every way into the code from outside that it can find: AJAX and admin-post actions, REST routes, shortcodes, request hooks and files that run when requested directly.
- Every risky operation it can find: database queries, database writes, changes to options, users and roles, file writes, files included from variable paths, remote requests, unserializing data, code built and run at runtime, shell commands, printing request data, redirects to variable addresses.
- Every file that prints values without escaping.
Then it reviews every line. Local changes to published files are reviewed as changes.