-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Description
Description
The plugin's PHP files have multiple WordPress Coding Standards (WPCS) violations that should be fixed for consistency, security hardening, and maintainability.
Issues Found
High Priority
- Loose comparisons (80+ instances): Using
==/!=instead of strict===/!==across all files. This can cause type juggling bugs. - Missing ABSPATH guards: 5 files (
functions.php,init.php,settings.php,meta-boxes.php,admin/index.php) lack direct access protection. - Unsanitized nonce values:
$_POSTnonce values passed directly towp_verify_nonce()withoutsanitize_text_field( wp_unslash() )inadmin/index.php. - Non-Yoda conditions: Variable on left side of comparisons instead of constant-first pattern.
- Missing strict flag in
in_array(): Multiple calls withouttrueas third parameter.
Medium Priority
print+exitinstead ofwp_die(): Used for nonce failure in admin settings handlers.- Raw
header()redirect: Should usewp_safe_redirect(). - Unescaped
site_url()output: Missingesc_url()wrapper. - Closing
?>PHP tags: Present in PHP-only files, risking whitespace injection.
Low Priority
- Equals sign alignment: Minor formatting issues in multi-line assignments.
- Double blank lines: Extra whitespace in several files.
- Inline comment formatting: Trailing
//on comments.
Files Affected
functions.phpinit.phpindex.phpadmin/index.phpsettings.phpmeta-boxes.php
Expected Behavior
All PHP files should pass PHPCS with the phpcs.xml.dist ruleset with zero errors and zero warnings.
Reactions are currently unavailable