=== Onlinefotka Schema Markup ===
Contributors: onlinefotka
Donate link: https://www.paypal.com/donate?business=info%40onlinefotka.sk&currency_code=EUR
Tags: schema, structured data, rich snippets, json-ld, faq
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Schema markup (JSON-LD) for Google rich snippets: 25 types, field mapping, display rules, breadcrumbs, ratings, FAQ and How-to blocks.

== Description ==

**Onlinefotka Schema Markup** adds structured data in JSON-LD format to your pages, so Google and other search engines understand your content and can show rich results – stars, prices, availability, FAQ, breadcrumbs, events, recipes and more.

Everything is included for free – no "Pro" version, no license key.

= 25 schema types =

Article (BlogPosting, NewsArticle…), WebPage, Product (offers, shipping, return policy, variants), Local Business (60+ business types, opening hours, geo), Review (of a product, book, course, event, business, recipe, software, movie, game, music, organization, vehicle or podcast), FAQ, How-to, Recipe, Event, Course, Job Posting, Service, Software Application, Video, Person, Book, Dataset, Profile Page, Discussion Forum, Q&A Page, Image License, Vehicle Listing, Podcast Episode, Movie Carousel and Custom JSON-LD markup.

= Field mapping – set once, used everywhere =

For every field choose where the value comes from:

* title, content, excerpt, permalink, dates, author, featured image, site name, logo…
* **WooCommerce**: price, sale price, currency, SKU, GTIN / EAN, stock status, average rating, review count, brand, weight, categories
* any **custom field** (post meta) or **ACF** field
* a fixed value
* a new field that you fill in on each post
* **ratings from visitors** – a star widget below the content collects votes (one per visitor, IP addresses stored only as hashes)

Any value can be changed on a single post in the "Schema Markup" box of the editor, which also shows the generated JSON-LD and missing required fields.

= Display rules =

Use a schema on all singular pages, the front page, all posts of a type (posts, pages, products…) or on specific posts, pages and categories – and exclude others.

= Site-wide schemas =

* **Organization** (including Online Store, Local Business and 25 other types) or **Person** with logo, contact point and social profiles (knowledge graph)
* **WebSite** with the search box
* **Breadcrumbs** (BreadcrumbList) with a configurable middle level (category, product category…) and the `[ofsch_breadcrumbs]` shortcode for visible breadcrumbs
* **SiteNavigationElement** from a menu
* **AboutPage** and **ContactPage**

= Gutenberg blocks =

* **FAQ** – questions and answers, optional accordion, one FAQPage schema for all FAQ blocks of the page
* **How-to** – steps with images, materials, tools, time and cost

= More =

* Setup wizard
* **Import from Schema Pro** – settings, schemas, values entered on posts and visitor ratings
* Export / import of schemas and settings between websites
* Works together with Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework and Slim SEO (no duplicate Organization, WebSite and breadcrumbs)
* Removes the duplicate Product markup of WooCommerce and the Article markup of the Astra theme where a schema is used
* Optional skipping of schemas with missing required fields
* Cached output – no extra database work on page views
* "Schema" toolbar menu with the Google Rich Results Test and the Schema.org Validator for the current page
* AMP support
* Translations: Slovak, Czech, Hungarian, Polish, German

= External services =

The plugin does not send any data anywhere. The toolbar menu and the test buttons only open the public testing tools of Google ([Rich Results Test](https://search.google.com/test/rich-results), [terms](https://policies.google.com/terms), [privacy](https://policies.google.com/privacy)) and Schema.org ([Schema Markup Validator](https://validator.schema.org/)) in a new tab with the address of the page you want to test – only when you click them.

== Installation ==

1. Upload the plugin and activate it.
2. Go through the short setup wizard (website type, logo, social profiles).
3. Open **Schema Markup → Add New**, choose a type (e.g. Product or Article) and where it should be used.
4. Check the field mapping, save and test a page with the "Schema" menu in the toolbar.

== Frequently Asked Questions ==

= Where is the markup added? =

Into the `<head>` of the page as `<script type="application/ld+json">` (or into the footer – see Settings → Advanced).

= I use Yoast SEO / Rank Math. Will I get duplicates? =

No. When "Avoid duplicates with SEO plugins" is on (default), the Organization / Person, WebSite and breadcrumb schemas are left to the SEO plugin. Content schemas (Product, FAQ, Recipe…) are added by this plugin.

= How do I switch from Schema Pro? =

Open **Schema Markup → Tools → Import from Schema Pro**, run the import and deactivate Schema Pro.

= How do visitor ratings work? =

Choose "Ratings from visitors" as the source of a Rating field. A star widget appears below the content (or use the `[ofsch_rating]` shortcode) and the average and number of votes are used in the schema.

== Screenshots ==

1. Choose a schema type – every type has a short description, the most useful ones are recommended first.
2. Field mapping – for every field choose where the value comes from (post fields, WooCommerce, custom fields, fixed value…).
3. The Schema Markup box in the post editor – change any value on a single post and see where it comes from.
4. Settings – website, social profiles, site-wide schemas, breadcrumbs, shipping & returns and advanced options.

== Changelog ==

= 1.0.6 =
* Visitor ratings are always protected by a security token (nonce).
* Duplicate markup of other plugins is removed without an own output buffer (on WordPress 6.9+ through the template output filter).
* Translations included: Slovak, Czech, Hungarian, Polish and German.

= 1.0.5 =
* Product variants get a description (of the variant or the product).
* Offers always have priceValidUntil (end of the sale, otherwise the end of next year – like WooCommerce).

= 1.0.4 =
* The JSON-LD of WooCommerce Product Feeds (Google Product Feed) is removed reliably, also when it is printed directly in the footer.
* Variants of a variable WooCommerce product are always taken from WooCommerce.

= 1.0.3 =
* New settings tab "Shipping & returns": shipping countries, price and delivery time and return conditions are added to every product offer (and the return policy to the Organization).
* WooCommerce variable products are output as a ProductGroup with all variants (price, SKU, stock status, link).
* The duplicate Product markup of WooCommerce Google Product Feed and Yoast WooCommerce SEO is removed where the Product schema is used (can be turned off).

= 1.0.2 =
* Product: the offer gets validFrom automatically (start of the sale, otherwise the publish date of the product).

= 1.0.1 =
* Product: when the price, currency or availability is empty, it is taken from the WooCommerce product, so the offer is never missing its price.
* Product: an offer without a price is no longer output (it is an error in Google).
* New Product schemas use WooCommerce price, currency, stock status, SKU, brand and rating by default.
* The cached markup is regenerated after a plugin update.

= 1.0.0 =
* First release.
