Rule 1: one answer to "what does this product say?"
For each kind — chart, questions, video — the plugin asks one question.
Free edition: the answer is what you typed on the product. Nothing else is read.
Full edition:
- If the product has its own content for that kind, it is used.
- Otherwise the first active record of that kind that applies to the product is used, in your order on the WooCommerce → Product Info screen.
- Otherwise there is nothing to show.
A record applies when it is set to every product; when the product (or, for a variation, its parent) is in its product list; or when the product is in one of its categories or a sub-category of one — a chart written for "Clothing" reaches the shirts filed under "Clothing → Shirts".
The tabs, the popup, the video and the structured data all ask the same question, so a chart shown in a tab and the chart described anywhere else are the same chart.
Rule 2: everything renders through WooCommerce's own tabs
The chart and the questions are added through WooCommerce's woocommerce_product_tabs filter — the same filter WooCommerce and your theme use for Description and Reviews. So the order, the styling and which tab is open first stay WooCommerce's, and a size chart looks like any other tab your theme draws. There are no template overrides.
| Tab | Key | Priority |
|---|---|---|
| Size guide | gmpif_chart (free) / gmpi_chart (full) |
25 |
| Questions | gmpif_faq (free) / gmpi_faq (full) |
30 |
A tab is only added when there is something in it.
The questions are drawn as <details> items — a native, accessible accordion that needs no script — with the first one open.
Full edition, popup mode: with The size chart appears set to the popup, the chart is not a tab. A link (titled as Call the size chart) is printed by the add-to-cart button at priority 25 of woocommerce_single_product_summary, and opens the chart in a popup printed once in the page footer.
Content is filtered with wp_kses_post() both when it is saved and when it is shown, so a chart imported while another plugin was in charge cannot put a script on a product page.
Rule 3: a video is a URL, not markup
The video field takes an address, never embed code. The plugin reads the provider and the video ID out of the address and builds the player address itself:
| You paste | Embedded as |
|---|---|
youtube.com/watch?v=ID, youtu.be/ID (a ?si= share link too), youtube.com/shorts/ID, youtube.com/embed/ID, youtube.com/live/ID, or the same on m.youtube.com, music.youtube.com or youtube-nocookie.com |
https://www.youtube-nocookie.com/embed/ID |
youtube.com/playlist?list=LIST |
https://www.youtube-nocookie.com/embed/videoseries?list=LIST |
vimeo.com/ID, vimeo.com/channels/NAME/ID or player.vimeo.com/video/ID |
https://player.vimeo.com/video/ID |
an unlisted Vimeo video, vimeo.com/ID/HASH (or ?h=HASH) |
https://player.vimeo.com/video/ID?h=HASH |
Any other address embeds nothing. YouTube is embedded through its no-cookie domain, which sets no tracking cookie until the video is played. The iframe is lazy-loaded.
The video is printed on WooCommerce's woocommerce_product_thumbnails hook, which runs inside WooCommerce's own product image gallery. A gallery that replaces WooCommerce's — a theme's own, or another gallery plugin — may not run that hook, and then the video is not shown. Gatemi Product Gallery fires it inside its own gallery, so the video still shows with it.
Rule 4: structured data describes only what the page shows
In the page footer the plugin prints one <script type="application/ld+json"> block of type FAQPage, built from the same questions the Questions tab shows. Answers are sent as plain text. When there are no questions, nothing is printed. Structured data that does not match what a visitor sees is what gets a rich result taken away.
Full edition: Describe the questions to search engines switches this off.
One FAQPage block, shared with Gatemi Product Questions
Two FAQPage blocks on one page is a rich-result problem. Gatemi Product Info and Gatemi Product Questions therefore share one block through two filters:
- Who owns the block. Product Info answers the
gatemi_faq_schema_ownerfilter withgatemi-product-infowhenever it will print the block — always in the free edition, and while Describe the questions to search engines is on in the full edition. Product Questions sees that and does not print a block of its own. - What goes in it. Before printing, Product Info passes its own questions through
gatemi_faq_schema_items. Product Questions adds the questions customers asked and the shop answered (at priority 20, skipping any question already in the list). Product Info's own questions come first.
So with both plugins active there is one block, Product Info's, carrying both plugins' questions — even on a product with no questions of its own. When Product Info is not active (or its full edition's switch is off), Product Questions prints the block itself through the same filter. Anything an extension adds to the list that is not a plain question-and-answer pair is dropped.
The JSON is encoded so that a </script> typed into a question cannot end the script element.
Assets
The small stylesheet is loaded only on a product page that has something to show. Full edition: a small script is loaded with it for the popup.
