- Debug mode variable is only used in Models
- In controllers we only use WordPress WP_DEBUG and WP_DEBUG_DISPLAY, sometimes we use WP_DEBUG_LOG and no local class debug variables.
- We use
StaticValidator::inWP_Debug()
, which is based onWP_DEBUG_DISPLAY
constant if you want to perform actions (i.e. echo debug printing on screen). - We use
StaticValidator::wpDebugLog()
, which is based onWP_DEBUG_LOG
constant if you want to log your debug to file.
- We use
- In GetDetails functions, always have elseif with null prefill
- No issets in templates, because the variables or information needs to be given proccesed.
Effective coding - we must focus on real errors and issues, and not on over simplyfing, and not over optimizing the code, because then other developers will struggle editing the code.
- Uncheck: Settings -> Inspections -> PHP -> Unnecessary local variable