=== PostMeta Viewer – Custom Fields Inspector ===
Contributors: wpwebguru, vivekkumarsahu0
Tags: custom fields, post meta, acf, debugging, developer tools
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A powerful debugging tool for WordPress developers to inspect and analyze post meta (custom fields) across posts, pages, custom post types, taxonomy terms, users, and comments.

== Description ==

**PostMeta Viewer** is an essential utility for WordPress developers who work with custom fields and post meta. Whether you're using Advanced Custom Fields (ACF), Pods, Toolset, or custom-coded meta fields, this plugin provides a clean and developer-friendly interface to explore, search, and analyze meta data across your entire WordPress site.

It is designed strictly as a **read-only inspection tool**, making it safe for production environments.

= Key Features =

* **Complete Meta Overview**  
  Browse all posts, pages, and custom post types with total custom field counts.

* **Detailed Meta Inspection**  
  View all meta keys and values for any individual post, taxonomy term, user, or comment.

* **Powerful Search & Filtering**  
  – Search across post titles, content, meta keys, and meta values  
  – Filter by post type, post status, and date range  
  – Filter by specific meta key existence  
  – Filter by meta value type (string, array, JSON, numeric, empty)

* **Meta Inspector Everywhere**  
  – Post edit screen meta box (configurable per post type)  
  – Taxonomy term edit screens (categories, tags, custom taxonomies)  
  – User profile edit screens  
  – Comment edit screen

* **Developer-Friendly Data Display**  
  – Proper formatting for serialized, array, and JSON meta values  
  – One‑click “beautify” toggle to expand complex data structures  
  – Dark‑style pre‑formatted output for readability

* **Post Statistics**  
  Quick insights into total posts and filtered results.

* **Extensive Settings Page**  
  – Choose which roles can access the inspector  
  – Toggle visibility on post types, taxonomies, users, and comments  
  – Hide internal meta keys (those starting with an underscore)  
  – Adjust items per page

* **Responsive Admin UI**  
  Works smoothly across all screen sizes.

= Ideal For =

* **ACF Developers** – Debug and verify stored ACF field data  
* **Plugin Developers** – Inspect custom meta added by plugins  
* **Theme Developers** – Validate custom field implementations  
* **Site Debugging** – Identify and resolve metadata issues  
* **Migration Projects** – Analyze existing meta structures  
* **Learning WordPress** – Understand how post meta works internally

== Installation ==

= Automatic Installation =

1. Go to **Plugins → Add New** in your WordPress admin
2. Search for **PostMeta Viewer**
3. Click **Install Now**
4. Activate the plugin

= Manual Installation =

1. Download the plugin ZIP file
2. Go to **Plugins → Add New → Upload Plugin**
3. Upload the ZIP file and click **Install Now**
4. Activate the plugin

= FTP Installation =

1. Unzip the downloaded file
2. Upload the `postmeta-viewer` folder to `/wp-content/plugins/`
3. Activate **PostMeta Viewer** from the Plugins screen

== Usage ==

= Getting Started =

1. After activation, go to **PostMeta Viewer** (top-level menu)
2. View a list of all posts along with their custom field counts
3. Use search and filter options to narrow results
4. Click **View Details** to inspect meta for a specific post

= Using Search & Filters =

1. **Search Box** – Search across post titles, content, meta keys, and values  
2. **Post Type Filter** – Filter posts, pages, or custom post types  
3. **Meta Key Filter** – Filter by existing meta keys  
4. **Date Range** – Filter posts by creation date  
5. **Post Status** – Published, draft, pending, etc.  
6. **Value Type Filter** – String, array, JSON, numeric, or empty  
7. Click **Apply Filters** to update results

= Viewing Meta Details =

1. Click **View Details** from the main list
2. View a table of all meta keys and values
3. Serialized and complex data is displayed in a readable, beautified format
4. Use **Back to List** to return

= Inspecting Meta on Other Screens =

1. **Post Edit Screen** – The **Custom Fields Inspector** meta box appears below the content editor (for enabled post types)
2. **Taxonomy Term Edit Screen** – A similar box appears on category, tag, and custom taxonomy edit pages
3. **User Profile Edit Screen** – The inspector is shown on user profile pages
4. **Comment Edit Screen** – The inspector is shown on the single comment edit page

All boxes respect the role and visibility settings.

= Configuring the Plugin =

1. Go to **PostMeta Viewer → Settings**
2. Adjust:
   - **Items Per Page** – number of posts shown in the main list
   - **Access Roles** – checkboxes for every registered user role; only checked roles can view post, term, user, and comment meta data (Administrator is always enabled and cannot be unchecked, to prevent accidental lockout)
   - **Hide Internal Keys** – toggle visibility of meta keys starting with `_`
   - **Enabled Post Types** – checkboxes for every public post type, controlling which post-type edit screens show the Custom Fields Inspector meta box
   - **Inspector Locations** – enable/disable meta boxes on taxonomies, users, and comments
3. Save your changes

== Frequently Asked Questions ==

= Is this plugin safe for production sites? =
Yes. The plugin is read-only and does not modify or delete any data.

= Does it work with Advanced Custom Fields (ACF)? =
Yes. It displays the raw meta data stored by ACF.

= Can I edit meta values using this plugin? =
No. This plugin is intended for inspection and debugging only.

= Does it affect site performance? =
No. It runs only in the WordPress admin area when actively used.

= Can I export post meta data? =
Export functionality is not available yet but is planned for future releases.

= Is there a display limit for posts? =
Pagination is enabled with 20 posts per page by default (adjustable in Settings).

= Can I see meta for taxonomy terms, users, and comments? =
Yes – all these are supported and can be enabled/disabled in the Settings.

== Screenshots ==

1. Main Interface – Post list with custom field counts and filters  
2. Meta Details View – Complete meta data for a single post  
3. Post Edit Meta Box – Custom fields inside the editor  
4. Filtered Results – Search and filter results in action  
5. Taxonomy / User / Comment Meta Boxes – Meta inspection on other edit screens  
6. Settings Page – All configurable options

== Changelog ==

= 1.1 =
* **New**: Taxonomy term meta inspection on edit screens  
* **New**: User profile meta inspection  
* **New**: Comment meta inspection  
* **New**: Settings page with role‑based access control  
* **New**: Toggle visibility for meta boxes on post types, taxonomies, users, and comments  
* **New**: Hide internal meta keys (starting with `_`) via settings  
* **New**: Access control is now per-role via checkboxes (any combination of roles, not just a single capability), with Administrator always protected from accidental lockout
* **New**: Per-post-type control over where the Custom Fields Inspector meta box appears, via checkboxes on the Settings page
* **Improved**: Beautified array/JSON values now expand inline within the table cell instead of requiring a separate modal
* **Improved**: Better display of serialized, JSON, and array data with “beautify” toggle  
* **Improved**: Pagination and items per page now configurable  
* **Fixed**: Translation issues and minor UI improvements  
* **Security**: Added nonce verification and capability checks throughout

= 1.0 =
* Initial release  
* Full post meta overview  
* Advanced search and filtering  
* Detailed meta inspection  
* Post edit screen meta box  
* Support for all post types and statuses

== Upgrade Notice ==

= 1.1 =
Major update adding taxonomy, user, and comment meta inspection, plus a comprehensive settings page. Highly recommended for all users.

== License ==

This plugin is licensed under the GPL v2 or later.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.