=== BIPi Schema Viewer ===
Contributors: berryinteresting
Tags: schema, structured-data, json-ld, seo, rich-results
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

See the JSON-LD structured data on any page, right from your admin bar. Inspect, validate, copy, and export your schema in a click.

== Description ==

Schema Viewer is a lightweight tool for inspecting the JSON-LD structured data on your WordPress site.

It adds a "View Schema" link to your admin bar on the front end. Click it while on any page and Schema Viewer essentially "reads" the page as a search engine would, then shows every JSON-LD block it finds, formatted and grouped by type. The admin-bar count comes from JSON-LD tags in the rendered page. When you click "View Schema," Schema Viewer fetches the current URL from your site, finds the JSON-LD blocks in that response, formats each block, identifies its types, and lets you filter by type.

It is a read-only inspector. It does not generate or change your markup, so it works alongside whatever already produces your schema.

= What you can do =

* See a live count of schema blocks in the admin bar before you even open the tool.
* Inspect each JSON-LD block returned by the on-click page fetch, pretty-printed and color-coded, or view its raw JSON-LD source.
* When recognized, see a source badge for Yoast SEO, Rank Math, AIOSEO, SEOPress, Schema Pro, or WooCommerce. Custom and unrecognized JSON-LD remains visible without a source label.
* Catch common problems automatically: invalid JSON, a missing @context, missing required properties, duplicate @id references, and types that should appear only once per page.
* Check first-pass rich-result eligibility. Each block shows whether its type can qualify for a Google rich result, and which property it still needs if it does not yet appear to qualify.*
* Copy or download any single block, or all of them at once.
* Open the current page in the Google Rich Results Test or the Schema.org Validator in one click.

(* This plugin and its output does not guarantee eligibility or appearance in Google Search.)

= How to use it =

1. Log in and visit any page on the front end of your site.
2. Click "View Schema" in the admin bar. A panel lists every JSON-LD block on the page.
3. Use the controls at the top to expand or collapse all blocks, or to filter by type. Filtering highlights the matching type and opens the blocks that contain it, which helps on pages with a large @graph.
4. Use the buttons on each block to copy it, download it, or switch between the formatted and raw view. Use the buttons at the bottom to copy or download everything, or to send the page to Google or Schema.org for validation.

= Who it is for =

Marketers and SEOs who want to confirm the schema they are paying for is really on the page.

Developers doing QA on templates, ACF output, and SEO-plugin markup.

Anyone who wants a fast, plain answer to the question "What JSON-LD is in this page response?" and "Does it pass a useful first check?"

= Light on your site =

Nothing loads for logged-out visitors or for roles that cannot edit content. On page load, Schema Viewer only counts JSON-LD tags in the rendered page for the admin-bar number. It fetches, parses, and checks the current URL only when you click. It makes no automatic third-party requests and sends no telemetry. Google and Schema.org receive the current page URL only when you deliberately open those validator tools.

= About Berry Interesting =

Schema Viewer is made and maintained by [Berry Interesting Productions](https://berry-interesting.com/), a web technology partner that has supported digital marketers since 2006. We originally built it to help our own team inspect the structured data on the websites in our care. To mark our 20th anniversary, we're sharing it freely, with gratitude for the open-source community that has supported so much of our work. Come say hello at [berry-interesting.com](https://berry-interesting.com/).

= A note on trademarks =

Yoast SEO, Rank Math, AIOSEO, SEOPress, Schema Pro, WooCommerce, Google, and Schema.org are trademarks of their respective owners. Schema Viewer names them only to help you inspect and validate your own structured data, and is not affiliated with or endorsed by any of them.

== Installation ==

1. Install through Plugins, Add New (search "Schema Viewer"), or upload the ZIP under Plugins, Add New, Upload Plugin.
2. Activate it.
3. Visit any page on the front end while logged in, and click "View Schema" in the admin bar. There is nothing to configure.

== Frequently Asked Questions ==

= Does this generate or change my schema? =

No. Schema Viewer is a read-only inspector. It shows what is already on the page and never adds, edits, or removes markup.

= Will my visitors see it? =

No. The "View Schema" link appears in the admin bar only for logged-in users who can edit content, and nothing is ever added to your public pages.

= Which SEO plugins does it work with? =

Schema Viewer is source-agnostic for JSON-LD. Yoast SEO, Rank Math, AIOSEO, SEOPress, Schema Pro, WooCommerce, and hand-written template output. If it is JSON-LD on the page, Schema Viewer finds it, and it labels the source when it recognizes one.

= Does it work with WooCommerce? =

Yes. WooCommerce outputs Product structured data, and related types, as JSON-LD on product pages, and Schema Viewer reads it and labels it "WooCommerce." If an SEO plugin is handling your product schema instead, Schema Viewer shows that output and labels it accordingly.

= Does it send my data anywhere? =

No. There are no external requests, no tracking, and no telemetry. The "Test in Google" and "Test in Schema.org" buttons open those tools in a new tab for the current page, only when you deliberately click them.

= Who can see the "View Schema" link? =

By default, anyone who can edit posts (Editors, Authors, Contributors, and Administrators). Subscribers and WooCommerce customers do not see it. Developers can change the requirement with one filter:

    add_filter( 'schema_viewer_capability', function () {
        return 'edit_others_posts'; // Editors and Administrators only
    } );

= What does the type filter do? =

On pages with several blocks or a large @graph, the filter lets you focus on one type. Choosing a type highlights that type wherever it appears and opens the blocks that contain it, so you can find it quickly.

= It is flagging a warning on my schema. Is that bad? =

The warnings are based on Google's structured-data guidelines: missing required properties, duplicate IDs, and so on. They point you to what to check. They are not errors coming from your server.

= It says "Invalid JSON." What now? =

Use the Google Rich Results Test or Schema.org Validator buttons at the bottom of the panel. These tools may provide additional detail about the malformed markup.

= Is it translation ready? =

Yes. All interface text is internationalized, so it can be translated into any language through translate.wordpress.org.

== Screenshots ==

1. Created to celebrate 20 years of Berry Interesting, Schema Viewer is a small, practical tool shaped by two decades of making complex website technology easier to see, understand, and act on.
2. The "View Schema" link in the admin bar, showing a live count of the JSON-LD blocks on the page.
3. The Schema Viewer panel: type and source badges, rich-result eligibility, and one-click copy, download, and validator links.
4. Automatic warnings, including missing required properties and invalid JSON, flagged inline.

== Changelog ==

= 2.0.0 =
* Initial public release on WordPress.org.
* Inspect JSON-LD blocks returned by the on-click fetch on any page from the admin bar.
* Source detection: Yoast SEO, Rank Math, AIOSEO, SEOPress, Schema Pro, WooCommerce.
* First-pass rich-result badges based on Google's documented required properties for supported types.
* Automatic warnings: invalid JSON, missing @context, missing required properties, duplicate @id, and singleton-type duplicates.
* Copy or download each block individually, or all at once.
* Expand or collapse all, filter by type, and toggle pretty vs. raw source.
* Role control via the schema_viewer_capability filter (defaults to edit_posts).
* Keyboard-accessible controls and an internationalized interface.

== Upgrade Notice ==

= 2.0.0 =
First public release of Schema Viewer: inspect, check, and export JSON-LD schema on any page, right from your admin bar.
