Repository navigation
Count PHP-registered field groups in Site Health - #537
faisalahammad wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Please rerun the failed jobs for PR #537. The three E2E shards timed out while installing Playwright browsers, before any tests ran. The rerun command requires repository-admin permission. |
|
Thanks for the contribution and the effort here! 🙏 A heads-up on how this repo works: a large part of SCF's codebase (field types, Flexible Content, Blocks v3, local fields, forms, value formatting, and most of includes/ and assets/src/js/) is regularly synced from an upstream codebase. Any change we make there, whether a bug fix or a new feature, gets overwritten or causes hard merge conflicts on the next sync. That includes features behind a beta flag. Fixes for those areas arrive through the sync itself, so we can't accept PRs that touch that code, even good ones. |
Summary
acf_add_local_field_group()registers field groups withlocal => 'php'(lowercase), but the Site Health debug info counted PHP-registered groups by matching the uppercase value'PHP'. The comparison never matched, so "Registered Field Groups (PHP)" always reported 0.Changes in this PR:
src/Site_Health/Site_Health.phpto match the lowercase'php'value, consistent with the JSON count which already uses'json'.ACF_Site_Healthclass (includes/class-acf-site-health.php). It was never loaded by the plugin bootstrap and also carried the same bug plus unrelated latent bugs.tests/php/src/test-site-health.php, which covers the production class and locks in the corrected PHP field group count.Test plan
composer test:phppasses, including the new regression test that asserts PHP-registered groups are counted (not'0').acf_add_local_field_group()in code, open Tools > Site Health > Info > Secure Custom Fields, and confirm "Registered Field Groups (PHP)" shows the expected non-zero count.Closes #456
Use of AI Tools
This pull request was created with the assistance of AI coding tooling (Claude Code). All changes have been reviewed and I take responsibility for what the tooling produced.