[WordPress] 外掛分享: Digital Product Passport

首頁外掛目錄 › Digital Product Passport
全新外掛
安裝啟用
尚無評分
172 天前
最後更新
問題解決
WordPress 5.8+ PHP 7.2+ v0.1.0 上架:2025-09-25

內容簡介

總結:這個外掛的存在是為了解決在WordPress網站上展示數位產品護照(DPP)的簡單但普遍需求,包括在WooCommerce產品頁上,而不受特定供應商或API的限制。如果您擁有JSON,這個外掛將以一致、易於存取的方式呈現它,並且不會將數據發送給第三方。

問題與答案:
1. 這個外掛的關鍵特點是什麼?
- 不受供應商限制:可與任何DPP JSON源代碼一起使用,不會被特定供應商鎖定。
- 適用於WooCommerce:在產品編輯畫面上添加一個元框以存儲JSON。
- 人性化的HTML視圖:整潔的手風琴版面,具有友好的標籤,調整了ESP法命名風格。

2. 這個外掛的使用方式是怎樣的?
- 快速入門:
- 編輯任何文章、頁面或WooCommerce產品,找到“Digital Product Passport”元框。
- 粘貼有效的JSON並更新/發布,外掛將將其存儲為文章的元數據。
- 使用短代碼或下面提供的塊在您想要出現的地方插入查看器。

3. 這個外掛提供了哪些短代碼特性?
- 預設呈現在元框中保存的JSON。
- 通過json屬性傳遞內聯JSON(建議在JSON周圍使用單引號)。

4. 如何在區塊(Gutenberg)中使用這個外掛?
- 添加塊,並(可選)在塊設置中粘貼JSON來覆蓋該塊的帖子/產品元數據。
- 在塊檢查器中選擇默認標籤(HTML或JSON)。

5. 如何在經典編輯器中使用這個外掛?
- 點擊按鈕,選擇標題和默認視圖(HTML或JSON),然後插入。它使用在元框中保存的JSON。

6. 如何在WooCommerce的產品編輯畫面上使用這個外掛?
- 在產品編輯畫面上可以找到相同的元框。
- 在任何產品描述區域或區塊中放置[digital_product_passport]短碼可顯示查看器。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Digital Product Passport」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin exists to solve a simple but common need: display a Digital Product Passport (DPP) on WordPress sites, including WooCommerce product pages, without being tied to a specific provider or API. If you have the JSON, this plugin will render it consistently, accessibly, and without sending data to third parties.
Key features

Vendor-agnostic: Works with any DPP JSON source. No provider lock-in.
WooCommerce ready: Adds a meta box on product edit screens to store the JSON.
Human-readable HTML view: Clean accordion layout with friendly labels (for example, “End of Life and Circularity”), tuned for Ecodesign for Sustainable Products Regulation (ESPR) naming styles.
JSON view: Inspect the raw JSON in a formatted code block; one-click Copy JSON.
Shortcode and Block: Insert the viewer with a shortcode or the included Gutenberg block.
Classic Editor button: “Insert Digital Product Passport” modal for quick shortcode setup.
Accessibility: Keyboard navigation, ARIA roles, semantic HTML (details/summary).
Responsive: Looks great on phones, tablets, and desktops.
Privacy by design: No tracking, no external calls, no cookies.
Translation ready: All strings can be localized.

Why this plugin

One viewer for WordPress and WooCommerce that is independent of provider.
Displays your DPP from post/product meta in a consistent way across themes.
Uses only the JSON you supply and renders it locally in the browser.

Usage

Quick start:

Edit any post, page, or WooCommerce product and find the “Digital Product Passport” meta box.
Paste valid JSON and update/publish. The plugin stores it as post meta.
Insert the viewer where you want it to appear using either the shortcode or the block below.

Shortcode: [digital_product_passport]

By default renders the JSON saved in the meta box for that post/product.
You can also pass inline JSON via the json attribute (single quotes recommended around the JSON):
Example: [digital_product_passport json='{"id":"urn:uuid:123","type":"Product","name":"Sample"}']
Attributes:
json: Inline JSON to render (optional). If omitted, uses the saved post meta JSON.
view: html|json to pick the default tab (default html).
show_raw: true|false to force JSON (deprecated; overrides view).
title: Optional title displayed above the viewer.
limit: Number of top-level sections to show before a Show more toggle. 0 (default) shows all.
include: Comma-separated list of section keys/labels to include (case-insensitive; matches raw keys or humanized labels). Example: include="id,type,manufacturer".
exclude: Comma-separated list of section keys/labels to hide. Example: exclude="identifiers,documentation".
order: Comma-separated preferred order of sections. Items not listed keep their natural order after these. Example: order="id,type,manufacturers,identifiers".

more_label / less_label: Override the Show more/Show less button text.

Examples:

[digital_product_passport view="html" title="Digital Product Passport"]
[digital_product_passport view="json"]
[digital_product_passport limit="5" order="ID,Type,Manufacturers" exclude="Documentation"]
[digital_product_passport include="ID,Version,Language,Identifiers" more_label="Show all details" less_label="Show fewer"]
Note: The legacy [dpp] shortcode has been removed to comply with wp.org prefixing guidelines. Use [digital_product_passport].

Block (Gutenberg): “Digital Product Passport”

Add the block and (optionally) paste JSON in the block settings to override the post/product meta for that block.
Choose the default tab (HTML or JSON) in the block inspector.

Classic Editor: Use the “Digital Product Passport” toolbar button

Click the button, pick a title and default view (HTML or JSON), then insert. It uses the JSON saved in the meta box.

WooCommerce: On product edit screens, the same meta box is available. Place the [digital_product_passport] shortcode in any product description area or block to display the viewer on the product page.

Viewer controls (front end):

Tabs switch between HTML and JSON. The JSON view has a “Copy JSON” button.
Large passports show a Show more/less toggle when limit is set.

Troubleshooting:

If you see “No Digital Product Passport JSON found.”, either save valid JSON in the meta box or pass JSON via the shortcode json attribute.
Ensure the shortcode [digital_product_passport] is present where you expect the viewer to appear.

Compliance and Privacy

Privacy by design: No tracking, no external calls, no cookies.
Data handling: DPP JSON is stored as post meta and rendered client-side. Nothing is sent to third parties.
Security: Output is escaped and JSON is normalized server-side before embedding.
Accessibility: Semantic HTML with ARIA, keyboard navigation, and visible focus.
Performance: Minimal CSS/JS loaded only when the viewer is present.

External services

None required: This plugin does not connect to, depend on, or transmit data to any third‑party/external service. No data leaves your site when rendering a passport.
Example placeholders: The sample JSON shown in the editor includes illustrative links such as https://example.com and https://example.com/manual.pdf. These are placeholders for demonstration only; the plugin does not fetch or otherwise contact those URLs. Replace them with your own documentation links as needed.
Namespaces in SVG: The editor/block icon contains inline SVG markup that references the XML namespace http://www.w3.org/2000/svg. This is a namespace identifier, not a network request or external service.

No third‑party terms of service or privacy policies apply because the plugin does not use any external services.
GDPR and EU Privacy Notes

Personal data scope: This plugin does not collect, track, or profile users. It only renders the DPP JSON you provide. If your JSON contains personal data (for example, a contact person’s name or email), you are the controller of that data.
Lawful basis: Ensure you have a lawful basis under GDPR to publish any personal data included in the DPP. Prefer business contacts or shared inboxes over named individuals where possible.
Data minimization: Avoid including personal data unless strictly necessary for the product passport. Consider using role-based contacts (e.g., [email protected]).
Data location and transfers: The plugin does not perform network requests or transfer data to third countries. Any links inside your JSON are rendered as links only; the plugin does not fetch or proxy them.
Retention: DPP JSON is stored as post meta and retained until you edit or delete the post/product or remove the meta.
Data subject rights (DSR): The plugin does not store visitor-level personal data, so it does not add custom exporters or erasers. If you include personal data in DPP JSON, handle DSRs by updating/removing the JSON in your content.
Privacy Policy helper: The plugin registers guidance for Tools > Privacy so you can include accurate information on your site’s Privacy Policy page.
Redaction hooks: Developers can filter or redact fields before display using the digital_product_passport_viewer_data filter.
Access control: The viewer displays wherever the post/product is visible. Use WordPress visibility/roles or your membership tools to restrict access if needed.
Disclaimer: This is not legal advice. Consult your legal counsel to confirm compliance for your use case.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon