etechflow / module-rich-snippets
etechflow/module-rich-snippets
Hyva-native rich snippets (schema.org JSON-LD) for Keystation/Lockstation.
Etechflow_RichSnippets
Hyvä-native structured-data module for Magento 2 / Adobe Commerce. Emits a single
cross-linked schema.org JSON-LD @graph per page plus OpenGraph + Twitter
Card meta. A leaner, self-owned alternative to Mirasvit_SeoMarkup.
Schema coverage
| Page | Output (one @graph per page) |
|---|---|
| Product | Product / ProductGroup (+ variesBy/hasVariant for configurables) with tax-aware Offer/AggregateOffer, sale UnitPriceSpecification, priceValidUntil, itemCondition, payment/delivery methods, AggregateRating + Review, BreadcrumbList, Organization, WebSite |
| Category / landing | current-page ItemList + BreadcrumbList + Organization + WebSite |
| CMS + home | WebPage + Organization + WebSite |
| All pages | og:* + twitter:* meta, and the og: head prefix |
Entities are linked by @id (e.g. Offer.seller and WebSite.publisher resolve
to the single Organization node).
Architecture
- Block classes render via
_toHtml()(Block/Product,Category,Cms,Meta)
returning the<script>/<meta>string directly — no.phtmltemplates. This is
deliberate: in production mode with HTML minification, new module templates require a
preprocessed copy; rendering from PHP sidesteps that entirely. - Schema-building logic lives in
ViewModel/*(Product,Category,CmsPage,Site,
Breadcrumbs,OpenGraph,Config) so it is unit-testable and reusable. - Prices are tax-aware (honour
tax/display/type) and use the active store currency.
Configuration
Stores → Configuration → Etechflow → Rich Snippets
| Path | Default | Notes |
|---|---|---|
etechflow_richsnippets/general/enabled |
0 |
Master switch. OFF = emits nothing (safe alongside another provider). |
etechflow_richsnippets/product/enabled |
1 |
|
etechflow_richsnippets/product/variants_enabled |
1 |
ProductGroup for configurables |
etechflow_richsnippets/product/{brand,mpn,gtin13,condition}_attribute |
brand/sku/–/– | Attribute-code overrides |
etechflow_richsnippets/category/enabled |
1 |
|
etechflow_richsnippets/opengraph/enabled |
1 |
OpenGraph + Twitter |
etechflow_richsnippets/cms/enabled |
1 |
CMS + home WebPage |
Install
bin/magento module:enable Etechflow_RichSnippets
bin/magento setup:upgrade
rm -rf generated/code/* generated/metadata/* # required: di:compile won't clean this itself
bin/magento setup:di:compile
bin/magento cache:flush
# then flip the master switch on:
bin/magento config:set etechflow_richsnippets/general/enabled 1
If replacing another provider (e.g. Mirasvit), disable its output first to avoid
duplicate schema. To avoid a duplicate breadcrumb, suppress the theme's native
breadcrumb JSON-LD (this module's breadcrumb is the full category path).
Tests
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Etechflow/RichSnippets/Test/Unit
Changelog
All notable changes to this module are documented here.
v1.0.0 — 2026-06-05
Initial public release.
Hyva-native rich snippets (schema.org JSON-LD @graph) + OpenGraph + Twitter Card meta. Lean alternative to Mirasvit_SeoMarkup. Tax-aware pricing.
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 1.2.1 | stable | Fail | Magento 2.4.7-2.4.8 Details | 2026-06-22 15:12:51 |
| 1.1.1 | stable | Not tested | Not yet tested Details | 2026-06-16 13:38:37 |
| 1.1.0 | stable | Not tested | Not yet tested Details | 2026-06-16 12:45:44 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2026-06-05 10:28:01 |
Requires 6
| Package | Constraint |
|---|---|
| magento/framework | >=103.0 |
| magento/module-backend | >=102.0 |
| magento/module-catalog | >=104.0 |
| magento/module-cms | >=104.0 |
| magento/module-store | >=101.0 |
| php | ~8.1.0||~8.2.0||~8.3.0||~8.4.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 112 | 3 errors, 109 warnings (ruleset: Magento2) — 39 auto-fixable with phpcbf |
| PHPMD | Warning | 39 | 39 rule violations (IfStatementAssignment:17, EmptyCatchBlock:6, UnusedFormalParameter:5, CyclomaticComplexity:4, NPathComplexity:3) |
| Cpd | Warning | 1 | 1 duplicated chunk spanning 42 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 6 | valid; 6 advisory notes (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from etechflow
View vendorDynamic 'View Other Options/Finishes/Sizes' PDP buttons driven by per-product link attributes; replaces hardcoded in-description buttons and strips the old ones at render time.
Theme-agnostic mega menu for Magento 2. Renders on Hyvä, Luma, Adobe Commerce default and custom themes via automatic runtime detection. Provides a JSON endpoint for lazy-loaded subcategory + featured-product data.
EtechFlow Store Locator — admin-managed store/branch finder for Magento 2 with a Leaflet + OpenStreetMap map and postcode proximity search (postcodes.io). Hyva and Luma compatible. No paid map API key required.
Universal Product Fitment Finder for Magento 2 — Make/Model/Year/Part filtering on any fitment domain (automotive, motorcycle, marine, RV, phone cases, watches, appliance parts, anywhere a customer asks "will this fit my X?"). Admin-configurable labels + URL prefix so the same module rebrands to any merchant domain. Includes PDP fitment badge, SEO URLs, customer garage with cross-device sync, OEM/part-number search, and admin tooltips throughout. Theme-agnostic — Hyvä, Luma, custom themes. Renamed from "module-vehicle-compat" in v2.0.0.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.