=== Infinit8 ACF Audit ===
Contributors: gabiirese
Tags: acf, fields, audit, developer tools, maintenance
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Audit ACF field groups, stored values and direct code references before refactoring or removing fields.

== Description ==

Infinit8 ACF Audit provides a read-only inventory of Advanced Custom Fields configuration and supporting evidence for manual field reviews.

The plugin runs locally inside WordPress. An administrator explicitly starts each audit. It inventories field groups and nested fields, counts local storage records linked through ACF metadata references, and looks for literal field names or keys in approved active theme and plugin files.

Its visual flexible-content report shows each layout, how often it appears, its matching PHP template, its review status, and the posts where it is stored. Administrators can filter and paginate layouts, and open a post-detail dialog without leaving WordPress.

Infinit8 ACF Audit does not modify ACF configuration, content, metadata, or code.

Infinit8 ACF Audit is an independent plugin and is not affiliated with or endorsed by the developers of Advanced Custom Fields.

Infinit8 ACF Audit is developed and maintained by [Infinit8.es](https://infinit8.es/).

== Features ==

* Inventory ACF field groups, fields, keys, names, types, nesting, and location rules.
* Detect local storage records linked to known field keys.
* Scan active theme and plugin code for literal field names and keys.
* Summarise flexible-content layouts, usage totals, matching PHP files, status, and related posts.
* Open related-post details in an accessible dialog from the layout report.
* Filter, search, and paginate both the layout report and technical field inventory.
* Process code files in bounded AJAX batches with progress feedback.
* Display relative paths and escaped code snippets to authorized administrators.
* Export the current layout or technical-field view as a nonce-protected CSV file.
* Work with the free and Pro editions of ACF.

== ACF dependency ==

Advanced Custom Fields or ACF Pro 5.9.6 or later must be active. The plugin does not install or activate ACF automatically. When ACF is missing or incompatible, no scan runs and an administrator sees a contextual notice.

== Important limitations ==

The scanner detects direct, quoted references in the analysed locations. It may not detect dynamically constructed field names, database queries that do not contain a field name or key, references in excluded or inactive code, remote applications, or external integrations.

No result proves that a field is unused. “No references were found” means only that no direct reference was detected in the locations and file types included in that audit. Manual review is always recommended before changing or removing a field.

The complete documentation is packaged with the plugin and can be opened from its administration screen.

== Installation ==

1. Upload the `infinit8-acf-audit` folder to `/wp-content/plugins/`, or install the ZIP from Plugins > Add New > Upload Plugin.
2. Activate Infinit8 ACF Audit.
3. Confirm that Advanced Custom Fields or ACF Pro 5.9.6 or later is active.
4. Open Infinit8 ACF Audit from its dedicated top-level administration menu.
5. Select “Start audit” and keep the page open while the batches finish.
6. Review the evidence before making any change outside this plugin.

If replacing the earlier `acf-audit` package, install and activate this package first, then deactivate the earlier plugin and use WordPress's native Delete action. WordPress only offers Delete for inactive plugins.

== Frequently Asked Questions ==

= Does the plugin change or delete ACF fields? =

No. The plugin is read-only. It does not edit field groups, values, metadata, or files.

= Does it work with free ACF? =

Yes. Fields available in free ACF are inventoried. ACF Pro field types are also inventoried when ACF Pro is active.

= Does “Manual review” mean the field is unused? =

No. It means that the available evidence is not sufficient to classify the field as used. Dynamic, indirect, external, or unscanned usage may still exist.

= How is flexible-layout usage counted? =

Usage is counted from flexible-content data stored on posts. The PHP file indicator is a separate convention-based check that matches layout names to PHP filenames in the active theme. Neither result should be treated as permission to delete a layout without manual review.

= Which locations are scanned? =

The active child and parent theme, active plugins, and active must-use plugin entry files. Infinit8 ACF Audit excludes itself, symbolic links, oversized files, and common dependency, cache, upload, language, version-control, and backup directories.

= Does the plugin send data anywhere? =

No audit data is sent outside the WordPress installation. The packaged documentation is local. The Infinit8.es author link contacts that website only when an administrator deliberately follows it.

== Screenshots ==

1. Audit summary with layout, field, evidence, and analysed-file totals.
2. Filterable flexible-layout report with usage, PHP file, status, and related-post columns.
3. Related-post dialog showing title, ID, type, status, usage count, and edit link.
4. Paginated technical field inventory with stored-value and direct-reference evidence.

== Changelog ==

= 1.1.2 =

* Added explicit edit and view actions to the related-page dialog.
* Corrected scan paths so the root and theme name are separated (for example, `theme/infinit8/...`).

= 1.1.1 =

* Added view-aware CSV exports for layouts and technical fields.
* Corrected active-theme PHP file matching and improved cache invalidation.
* Updated the WordPress.org listing, packaged documentation, and translation catalogue.

= 1.1.0 =

* Added a visual flexible-layout report as the default audit view.
* Added layout usage totals, PHP template matching and clickable post details.
* Added status/file/search filters and pagination for layouts and technical fields.
* Kept the complete field inventory in a separate technical-detail view.

= 1.0.0 =

* Initial public release.
* Added read-only ACF group and nested-field inventory.
* Added local stored-value evidence.
* Added bounded, batched direct-reference scanning.
* Added accessible filters, progress feedback, and protected CSV export.

== Upgrade Notice ==

= 1.1.2 =

Shows the exact pages that use each layout and makes theme paths easier to read.

= 1.1.1 =

Finalises the visual layout report, file detection and layout CSV export.

= 1.1.0 =

Adds an actionable layout-focused report with post details while retaining the technical field audit.

== Privacy ==

Infinit8 ACF Audit processes field definitions, metadata references, and approved local code files on the WordPress server. It stores temporary audit sessions locally as WordPress transients for up to one hour so sequential batches and CSV export can work.

The plugin does not send audit data, site information, personal data, or usage analytics to the author or any third party. It does not load remote scripts, fonts, images, or configuration. The Infinit8.es author link contacts that website only after an administrator deliberately follows it.
