=== Schema Monster ===
Contributors: schemamonster
Tags: schema, schema markup, json-ld, structured data, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatic JSON-LD schema for WordPress. 10+ types, WooCommerce Product support, safe alongside Yoast and Rank Math. No AI, no license.

== Description ==

Schema Monster adds JSON-LD structured data (schema markup) to your WordPress pages so search engines understand what your content is about. Every qualifying page gets a connected @graph containing WebSite, Organization, WebPage, and content-appropriate nodes.

**What you get, out of the box:**

* WebSite (with Sitelinks Search Box) and Organization on every qualifying page
* WebPage connected to the site graph via entity references
* BreadcrumbList that reflects your actual page hierarchy
* BlogPosting on blog posts (a schema.org subclass of Article, so Google treats these as articles automatically)
* FAQPage consolidated from Yoast/Rank Math FAQ blocks AND third-party FAQ schema (Elementor's FAQ toggle, AIOSEO, etc.) — merged into one clean node
* HowTo from Yoast or Rank Math HowTo blocks
* VideoObject when your content includes a YouTube or Vimeo URL
* SiteNavigationElement from your primary menu on the homepage
* Product with Offer for WooCommerce products (SKU, price, availability, images, brand)

**Duplicate detection:**

If you have Yoast SEO, Rank Math, AIOSEO, SEOPress, Schema Pro, WooCommerce, or another plugin emitting schema on the same URLs, Schema Monster's default "Merge" coexistence mode checks their JSON-LD before emitting and leaves out any schema type another plugin already covers, so no type appears twice on the page. Other plugins' output is never changed. You can also choose "Suppress third-party" (Schema Monster replaces Yoast SEO and Rank Math schema output) or "Emit alongside" (no deduplication, for comparing outputs).

**FAQ auto-detection:**

Pages with two or more questions in an Elementor Accordion, Toggle, or Nested Accordion widget, a Details block, or under an "FAQ" heading get FAQPage schema automatically. Can be turned off in Settings.

**Per-page overrides:**

A Schema Monster box on the post and page editor lets you turn schema off for that page, remove specific schema types, or paste your own JSON-LD nodes to add or replace.

**What Schema Monster does not do:**

* No AI. All schema is derived deterministically from your site's existing content.
* No external network requests. The plugin never phones home. It doesn't need a license, an API key, or a login.
* No settings for 800+ schema types. If you need Recipe, Course, LocalBusiness with hours and geo, Event, JobPosting, or one of the many other types, or if you want AI-generated schema tailored to each page's content, look at Schema Monster (Mega): https://schemamonster.com/

== Installation ==

1. Upload the `schema-monster` folder to `/wp-content/plugins/`, or install via the WordPress Plugins screen.
2. Activate the plugin through the 'Plugins' screen.
3. Visit **Schema Monster > Settings** to review the coexistence mode. The default (`Merge`) is right for most sites.
4. Visit **Schema Monster > Coverage** to see which schema types will emit on each of your recent posts.

No further configuration is required. Schema will emit on all qualifying singular views (posts, pages, WooCommerce products) as soon as the plugin is active.

== Frequently Asked Questions ==

= Does this plugin send any data to your servers, or to OpenAI, or anywhere else? =

No. The free plugin has zero outbound HTTP calls. It reads your site's content locally and emits JSON-LD in the page head. Nothing leaves your server.

= I already have Yoast SEO / Rank Math. Do I need this? =

If they're producing the schema you need, no. Schema Monster adds several schema types that Yoast and Rank Math don't emit in their free tiers (WooCommerce Product with Offer being the most common example), and the default Merge coexistence mode leaves out any schema type they already emit, so you never get duplicates.

= Will installing this break my existing schema? =

No. In Merge mode (the default), Schema Monster never changes other plugins' schema. It only leaves out its own copy of any type another plugin already emits. Only "Suppress third-party" mode changes other plugins' output, and only Yoast SEO's and Rank Math's.

= My page output looks broken after activating. What should I check? =

Schema Monster buffers the page output so it can see every other plugin's JSON-LD before adding its own. If output appears broken, check your caching plugin's HTML minification settings — the buffering approach can conflict with aggressive HTML combination.

= Can I turn schema off or customize it for a single page? =

Yes. Edit the post or page and use the Schema Monster box: disable output on that page, untick schema types you don't want, or paste custom JSON-LD nodes. A custom node with the same @type as a generated one replaces it; otherwise it's added. Developers can show the box on more post types with the `smfree_meta_box_post_types` filter.

= Does this work with WooCommerce? =

Yes. On single-product pages, the plugin emits Product schema with SKU, price, currency, availability (in stock / out of stock), and gallery images.

= Does this work with page builders like Elementor, Divi, Beaver Builder? =

Yes. Schema Monster reads from WordPress core data (post title, content, featured image, author) and Gutenberg blocks for FAQ/HowTo detection. It doesn't depend on any specific page builder.

On Elementor-built pages, FAQ detection reads the page's saved Elementor data (Accordion, Toggle, and Nested Accordion widgets, plus FAQ heading sections) directly from the database. It never runs Elementor's renderer, so Elementor's layout CSS and JavaScript load exactly as they do without Schema Monster. Global widgets and Template widgets are followed into their saved templates. Shortcodes inside accordion answers are left out of the schema text.

= What if I need Recipe / Course / LocalBusiness / Event / other schema types? =

The free plugin covers 10+ core types. For the full 800+ schema.org library, WooCommerce variant/rating support, and AI-generated schema, see Schema Monster (Mega) at https://schemamonster.com/

= Where does the coverage viewer's data come from? =

The Coverage screen lists your last 50 modified published posts and calls the schema engine on each one to show which types would emit. This runs at page load, so numbers are always current — not from a cache.

== Screenshots ==

1. The Settings screen shows the Schema Monster branded interface, with the upgrade card for Mega Monster, a schema output toggle, and coexistence mode selection. The full list of schema.org types the plugin emits is displayed below.
2. The Coverage viewer lists your last 50 modified indexable posts alongside the schema types the plugin will emit for each. Internal template stores (Elementor library, CartFlows steps, ElementsKit content) are automatically excluded, along with password-protected and noindex posts.
3. Schema.org's official validator confirms the plugin's output parses cleanly — zero errors, zero warnings across every schema type emitted. Validated on schemamonster.com's own homepage.
4. Google's Rich Results Test also passes cleanly on the same URL — 1 valid item detected, eligible for Google Search's rich results.

== Changelog ==

= 1.1.0 =
* Coexistence modes reworked. New default "Merge" scans other plugins' JSON-LD before output and drops Schema Monster's own node for any @type already emitted, so no type appears twice. References to dropped WebSite/Organization/WebPage nodes are repointed at the other plugin's node when its @id uses a standard fragment (filterable via `smfree_known_fragments`).
* "Suppress third-party" mode (replaces Broad) empties Yoast SEO and Rank Math schema via their own filters. Other plugins can be added via the `smfree_suppress_third_party_schema` action.
* "Emit alongside" mode (replaces Preserve) emits everything with no deduplication.
* Existing settings migrate automatically: Safe → Merge, Preserve → Emit alongside, Broad → Suppress third-party.
* New: FAQ auto-detection for Elementor Accordion, Toggle, and Nested Accordion widgets, Details blocks, and FAQ heading sections. Toggle in Settings, with optional debug logging to uploads/schema-monster-logs/.
* New: per-page Schema Monster meta box on posts and pages — disable output, remove specific schema types, or add custom JSON-LD nodes. Post types filterable via `smfree_meta_box_post_types`.
* New filter `smfree_graph` for the final node list after FAQ detection and per-page overrides.
* Fix: FAQ detection no longer breaks Elementor-built pages (missing layout CSS/JS, misplaced nav, missing hero images). Elementor pages are now scanned from their saved widget data instead of being pre-rendered.

= 1.0.15 =
* Normalized function, option, and hook prefix to `smfree_` per WordPress.org reviewer feedback.
* Removed "Tested up to" from the main plugin file (readme.txt is the single source of truth).
* Fixed contributor username.
* Added a one-time migration that moves existing `smf_*` settings to `smfree_*`.
* Filter hooks renamed to `smfree_coverage_post_types`, `smfree_coverage_internal_post_types`, `smfree_coverage_exclude_post`, `smfree_engine_graph_nodes`, `smfree_show_upgrade_card`, and `smfree_upgrade_cta_url`. The old `smf_*` names still work but are deprecated as of 1.0.15 via apply_filters_deprecated() and will be removed in a future version.

= 1.0.14 =
* Renamed from "Schema Monster Free" to "Schema Monster" to align with the plugin name convention used across the WordPress.org directory (base product name, with the "Free" badge applied automatically by WordPress.org). The plugin slug changed from `schema-monster-free` to `schema-monster`. Text domain updated to match. Internal architecture unchanged — the plugin still uses its own option prefix (`smf_`, renamed to `smfree_` in 1.0.15) to remain safely isolated from the separate paid Schema Monster Mega add-on.

= 1.0.13 =
* readme.txt: added detailed captions for the four WordPress.org listing screenshots.
* readme.txt: corrected the feature list under Description — removed outdated references to Article (dropped in v1.0.3) and standalone ImageObject (dropped in v1.0.2). Feature list now accurately reflects what the current version emits.
* Requirements: bumped minimum PHP from 7.4 to 8.0. PHP 7.4 reached end-of-life in November 2022; supporting it is no longer standard practice.

= 1.0.12 =
* Coverage viewer: added more internal template stores to the exclusion list — ElementsKit content and template types, Ultimate Addons for Elementor, Happy Addons, JetEngine internal types. Users of these plugins will see a cleaner Coverage view without dozens of internal widget/template rows.

= 1.0.11 =
* WordPress.org submission prep: addressed all findings from WordPress.org's Plugin Check tool.
* readme.txt: updated "Tested up to" to WordPress 7.1, trimmed tags to 5, tightened short description to under 150 characters.
* schema-monster-free.php: removed `load_plugin_textdomain()` call. WordPress.org auto-loads translations for hosted plugins since WP 4.6.
* uninstall.php: wrapped cleanup logic in a local scope so no variables or constants leak globally. All internal variables use the plugin's own prefix (`smf_` at the time; `smfree_` as of 1.0.15).
* Filter hooks: added phpcs:ignore comments for the short `smf_` prefix. (Superseded in 1.0.15: hooks now use `smfree_`; the `smf_` names are deprecated.) No functional changes.

= 1.0.10 =
* Admin UI: definitively fixed sidebar menu icon sizing. Root cause was a missing width/height constraint — WordPress core CSS applies 9px top padding to menu icons but no dimensional constraint, so URL-based PNG icons render at their natural source size (55x55 in our case) instead of the expected 20x20. v1.0.10 forces the icon to 20x20 with !important overrides, matching how Dashicons render. Also matches WordPress core's 9px top padding for vertical centering, so the icon sits at the same visual weight as every other plugin's sidebar icon.

= 1.0.9 =
* Admin UI: swapped in a proper high-resolution (256x256) white icon for the sidebar menu, and added a small CSS file (admin-menu.css) that constrains the icon to WordPress's expected 20x20 sidebar size and applies proper opacity states (60% inactive, 100% active/hover). Previous versions had the icon rendering at native file dimensions and skipping the opacity treatment WordPress applies to Dashicon-based menu icons.

= 1.0.8 =
* Admin UI: sidebar menu icon now uses the white variant of the Schema Monster logo. Previous colored icon rendered poorly against WordPress's dark navy sidebar background. This matches how every major WordPress plugin (Yoast, Elementor, WooCommerce) handles their menu icons.
* Admin UI: added breathing room between the "Get Mega Monster" CTA button and the value line beneath it on the upgrade card. Previously the value line read as if stuck to the button; now it's a distinct block.

= 1.0.7 =
* Admin UI: fixed oversized sidebar menu icon. The 256x256 brand icon was being loaded at its native size instead of being scaled to fit the WordPress admin sidebar (which expects 20x20). Now uses a pre-sized 40x40 menu icon.
* Admin UI: fixed unreadable "Get Mega Monster" button. Bumped CSS specificity to beat WordPress admin's default link styling, deepened the background color for higher contrast against white text, forced explicit color inheritance.

= 1.0.6 =
* Admin UI: reskinned Settings and Coverage pages with a hand-crafted design system matching the Schema Monster brand — card layout, status pills, header wordmark with version badge, monster icon in the sidebar menu, "Powered by Schema Monster" footer link. Styling is scoped to this plugin's admin pages only and never leaks into other admin screens.
* Admin UI: added an upgrade card on both Settings and Coverage pointing to the Mega Monster tier at schemamonster.com/pricing/. Filter hooks `smfree_show_upgrade_card` and `smfree_upgrade_cta_url` (originally `smf_*`, deprecated as of 1.0.15) let sites hide or redirect it.
* Plugins list: added "Settings" and "Upgrade to Mega" action links on the plugin row.
* Zero new outbound HTTP. No tracking pixels, no click handlers, no telemetry. The upgrade CTA is a plain anchor tag.

= 1.0.5 =
* FAQ consolidation: harvests FAQ questions from any third-party FAQPage node on the page (Elementor's FAQ Schema toggle, AIOSEO's FAQ generator, custom plugins) and merges them with any block-based FAQs into a single well-formed FAQPage node inside our @graph. Pages that previously had multiple malformed FAQPage script tags now have one canonical FAQPage. Questions are deduplicated by normalized text — case, punctuation, and whitespace differences don't cause duplicates.
* FAQPage and HowTo added to the single-instance-per-page coexistence types. When we emit a canonical FAQPage or HowTo, any leftover third-party version on the same URL is now recognized as a duplicate and removed.

= 1.0.4 =
* Coverage viewer: fixed post-type filter that failed to exclude Elementor library and CartFlows steps in v1.0.3. Those plugins register their internal post types with both `public => true` and `publicly_queryable => true`, so the previous filter passed them through. v1.0.4 uses an explicit blocklist of known internal template stores.
* Coverage viewer: added per-post noindex filtering. Posts marked noindex by Yoast SEO, Rank Math, or All in One SEO are now excluded from the display. Password-protected posts also excluded.
* Coverage viewer: added two filter hooks — `smfree_coverage_internal_post_types` (modify the blocklist) and `smfree_coverage_exclude_post` (per-post exclusion override). Originally named `smf_*`; those names are deprecated as of 1.0.15.

= 1.0.3 =
* Coverage viewer: only lists posts of publicly-queryable post types. Internal template stores (Elementor library, CartFlows steps, etc.) no longer appear in the list — they never render as standalone URLs on the front end.
* Coverage viewer: added a "Data current as of [timestamp]" indicator so users can see when the display was computed. Reload the page to recompute.
* Coverage viewer: added a footnote explaining the post-type filter behavior.
* Engine: BlogPosting only on posts (dropped the parallel Article node). BlogPosting is a schema.org subclass of Article, so search crawlers already treat a BlogPosting as an Article automatically. Emitting both was redundant weight in the graph with no signal gain.

= 1.0.2 =
* SearchAction: now nested inline inside WebSite.potentialAction with EntryPoint wrapper for target, per Google's Sitelinks Search Box spec. Previous versions emitted a standalone SearchAction node referenced by @id, which does not qualify a site for Sitelinks Search Box.
* BreadcrumbList: no longer emitted on the homepage. A homepage breadcrumb is degenerate (both items point to the same URL) and adds no navigational signal.
* Article and BlogPosting: now emit only on posts, not on pages. Article implies editorial content — typing a marketing page or homepage as Article misrepresents the page type to search engines.
* SiteNavigationElement: URLs now normalized to absolute form. Fragment-only anchors (e.g. "#services") get the site URL prepended. Also added an @id for graph coherence.
* Removed the standalone ImageObject node — it had no @id and no incoming references, so it added weight without signal. Image URLs still flow through Article's `image` field on posts.

= 1.0.1 =
* Coexistence: switched from wp_head buffer to full-page output buffer. The previous approach missed Yoast/Rank Math JSON-LD because those plugins write to wp_head before our earliest hook can fire.
* Coexistence: detect duplicate BreadcrumbList, WebPage, WebSite, Organization by @type + page URL rather than requiring a url field on both nodes. Fragment differences (e.g. Yoast's `#breadcrumb` vs ours `#breadcrumblist`) no longer prevent detection.
* Coexistence: ImageObject nodes now compare on contentUrl when url is absent.
* Injection point: schema now lands high in <head> (right after opening tag) instead of at the end.

= 1.0.0 =
* Initial release. 10+ core schema types, coexistence detection, WooCommerce Product support, coverage viewer (read-only).

== Upgrade Notice ==

= 1.1.0 =
New Merge coexistence mode guarantees no duplicate schema types, plus FAQ auto-detection and per-page overrides. Your coexistence setting is migrated automatically.

= 1.0.15 =
Internal prefix renamed to `smfree_`. Your settings are migrated automatically. If you use the `smf_*` filter hooks, switch to the `smfree_*` names — the old ones are deprecated.

= 1.0.14 =
Plugin renamed from "Schema Monster Free" to "Schema Monster". No functional changes. If you activated a previous version, you'll see the new name in your WordPress admin sidebar.

= 1.0.13 =
No functional changes — readme.txt updates only for the WordPress.org listing.

= 1.0.12 =
Cleaner Coverage view — hides ElementsKit, UAE, Happy Addons, and other Elementor addon internal post types.

= 1.0.11 =
Compliance fixes for WordPress.org submission. No functional changes.

= 1.0.10 =
Sidebar menu icon now renders at the correct 20x20 size, matching other plugin icons in the WordPress admin sidebar.

= 1.0.9 =
Fixes sidebar menu icon sizing and opacity — now renders at proper WordPress admin dimensions with the correct active/inactive states.

= 1.0.8 =
Sidebar icon now correctly renders as white on the dark admin sidebar. Also gives the upgrade card CTA button more breathing room.

= 1.0.7 =
Fixes oversized sidebar icon and unreadable upgrade button from v1.0.6.

= 1.0.6 =
Full admin UI refresh — new branded look for Settings and Coverage matching the Schema Monster design system. Same schema output, cleaner interface.

= 1.0.5 =
Consolidates FAQ schema from page builders (Elementor, AIOSEO, etc.) into a single well-formed FAQPage node — replaces malformed multi-tag output with one canonical entry linked to your page graph.

= 1.0.4 =
Fixes the Coverage filter — Elementor library, CartFlows steps, and other internal template stores are now properly hidden. Also adds noindex-meta filtering (Yoast, Rank Math, AIOSEO).

= 1.0.3 =
Cleaner Coverage view (hides internal template stores), simpler graph on posts (single BlogPosting node instead of duplicated Article + BlogPosting), and a data-freshness indicator on the Coverage screen.

= 1.0.2 =
Corrects the Sitelinks Search Box structure (now qualifies for Google's search box feature), removes degenerate homepage breadcrumbs, and stops mis-typing pages as Article. Cleaner, more spec-compliant graph.

= 1.0.1 =
Fixes coexistence with Yoast, Rank Math, and AIOSEO — duplicate JSON-LD from those plugins is now properly detected and removed in Safe mode.

= 1.0.0 =
Initial release of Schema Monster Free.

== Privacy ==

Schema Monster does not collect, transmit, or store any user data. The plugin does not make any external HTTP requests. It reads your site's content locally and emits JSON-LD schema markup in the page head. No analytics, no telemetry, no phone-home.
