Repository navigation
Harden auditor-reported output and term counting - #1235
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 675b757ad3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $total_categories = get_transient($cache_key); | ||
| if ($total_categories === false) { | ||
| $total_categories = wp_count_terms('category', $args); | ||
| $total_categories = wp_count_terms(array_merge(['taxonomy' => 'category'], $args)); |
There was a problem hiding this comment.
Keep term counting compatible with WordPress 5.5
On WordPress 5.5, which the plugin still declares as its minimum supported version, wp_count_terms() expects the taxonomy as its first argument and the query arguments as its second; the array-only signature was introduced in WordPress 5.6. Consequently, this call passes an array where 5.5 expects a taxonomy and breaks the AJAX response whenever the category selector calculates pagination. The same incompatible change appears in the prohibited/required tag and required-category implementations, so retain the legacy call on 5.5 or add a version-compatible wrapper.
Useful? React with 👍 / 👎.
wp_count_terms($args) returns WP_Error invalid_taxonomy before WP 5.6, and the legacy two-argument form is deprecated afterwards. Also avoid caching a WP_Error as the total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up: WP 5.5 term counting fixed, verdict Safe to mergeWhat I changed
How I testedI used fresh SandyWP sandboxes, not cloned from any customer site, with 16 categories and 15 tags. I drove the real settings page in Chromium (playwright): the four AJAX endpoints with the page's nonce, then each select2 picker scrolled to the end. SandyWP can't create a WP 5.5 site, so I created a PHP 7.4 sandbox and downgraded core in place with
(The links need a Repile login.) Verdict: ✅ Safe to merge. Pagination works from the declared minimum (5.5) through 7.1.3, and the rest of the PR checked out in the earlier review. |


Summary
hiddenattribute text$post_typeglobal in the checklist templatebase64_encode()calls with SHA-256 fingerprintswp_count_terms()argument formwp_safe_redirect()for activation redirectAuditor coverage
Addresses confirmed High Output Escaping, High Discouraged PHP Functions, Medium Deprecated Function Parameters, and one Medium Global Variable Override finding from
publishpress-checklists-free-2.29.0-plugin-auditor-report.pdf.The
$submenuassignment is required by thecustom_menu_orderfilter and remains unchanged.