=== Field Finder for ACF === Contributors: jaydipmakwana1996 Tags: acf, developer tools, debug, field finder, unused fields Requires at least: 6.3 Tested up to: 7.1 Stable tag: 2.0.0 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Find where ACF fields are used in your theme and plugin code, and list fields that are never used. == Description == **Field Finder for ACF** is a developer tool. It scans your code and shows exactly where an Advanced Custom Field is read or written. **Find a field** * Search by field name, field key (`field_…`) or pattern such as `hero_*` * Field name suggestions with label, type and field group * File, line number and code snippet for every match * Detects `get_field`, `the_field`, `get_sub_field`, `the_sub_field`, `have_rows`, `get_field_object`, `update_field`, `delete_field`, `add_row` and more * Detects `[acf field="…"]` shortcodes in code and, optionally, in post content * Ignores commented-out code * Lists dynamic calls such as `get_field( $name )` separately, because they cannot be checked **Unused fields report** Lists every ACF field with how often it appears in your code. Fields with no matches are shown first. **Scan scope** Active theme, parent theme, plugins, must-use plugins or a custom folder. Optionally scan Twig templates and ACF `block.json` example data. **Built for large sites** * Scans in batches with a progress bar, so it does not time out * Caches results per file (by modified time), so repeat searches are fast * Skips `node_modules`, `vendor`, `.git` and very large files **Export and CLI** * Download results as CSV or JSON * WP-CLI: `wp field-finder search `, `wp field-finder unused`, `wp field-finder clear-cache` == Installation == 1. Upload the plugin folder to `/wp-content/plugins/` 2. Activate the plugin through the 'Plugins' menu 3. Go to Tools > Field Finder for ACF == Frequently Asked Questions == = Does it need ACF? = Searching code works without ACF. Field name suggestions and the unused fields report need ACF (free or Pro) to be active. = Why is a field marked "Possibly used"? = It is a sub field of a Group or Clone field, and the parent field is used in code. Those values are normally read through the parent. = Why might an unused field actually be used? = Fields read through dynamic names (for example `get_field( $prefix . '_title' )`), by other plugins outside the scanned folders, or by page builders. The report shows how many dynamic calls it could not check. = Is anything sent to an external service? = No. Everything runs on your server. = Multisite? = Each site scans its own active theme. Only super admins can scan plugins, must-use plugins or custom folders. == Developer hooks == * `fielffoa_functions` – ACF function names to look for * `fielffoa_excluded_dirs` – folder names to skip * `fielffoa_max_file_size` – largest file (bytes) to parse * `fielffoa_scan_roots` – folders to scan * `fielffoa_batch_seconds` – seconds spent per AJAX batch == Changelog == = 2.0.0 = * New: unused fields report * New: field name suggestions * New: file, line number and code snippet for every match * New: scan the parent theme, plugins, must-use plugins or a custom folder * New: Twig templates, ACF block.json and [acf] shortcodes (code and post content) * New: batched AJAX scanning with progress bar and per-file cache * New: CSV and JSON export * New: WP-CLI commands * New: token based PHP parsing, so commented-out code is ignored * New: dynamic calls are listed separately * Fix: field names containing regex characters no longer break the search * Fix: Windows paths * Fix: stylesheet version now follows the plugin version * Security: nonce and capability checks on every request; custom folders must be inside the WordPress install * New: redesigned interface with a search bar, scope chips, editor-style code panels and a status filter for the unused fields report * Improved: translatable strings, follows the admin colour scheme, linkable search URLs * Uninstall now removes cached data = 1.0.1 = * Improved UI with modern design elements and smoother interactions = 1.0 = * Initial release == Upgrade Notice == = 2.0.0 = Major update: unused fields report, suggestions, line numbers, more scan scopes, export and WP-CLI.