
內容簡介
總結:這款「Product Media Video Viewer for WooCommerce」外掛能增強 WooCommerce 預設的商品庫存,讓商店擁有者可以在商品圖片旁邊展示影片。這外掛添加了一個平滑的滑塊和彈出式模式,支援圖片和影片,提高了商品展示和客戶互動。
問題與答案:
1.這個外掛的主要功能是什麼?
- 可以在 WooCommerce 商品圖庫旁邊展示影片,提升產品展示和客戶互動。
2.開發人員可以如何擴展這個外掛的功能?
- 這外掛提供了動作和過濾器,讓開發人員可以擴展功能。
- 動作包括 pvmg_init(在外掛初始化時觸發)、pvmg_before_save_videos(在保存產品視頻數據之前觸發)、pvmg_after_save_videos(在保存產品視頻數據後觸發)。
- 過濾器包括 pvmg_save_videos(在保存視頻數據之前修改)、pvmg_video_item_html(在彈出式模式中自定義視頻 HTML 輸出)、pvmg_product_images(修改媒體庫中使用的產品圖片)。
3.這外掛有哪些性能優化?
- CSS 和 JS 文件僅在產品頁面上加載。
- YouTube API 異步加載。
- 影像在模式中被懶加載。
- 數據庫查詢最小化。
4.關於安全性,這外掛有哪些保護措施?
- 所有輸入值都經過檢查和轉義。
- YouTube URL 被驗證。
- 表單提交時針對 nonce 進行驗證。
- 管理功能的能力檢查。
5.如何獲取支援?
- 查看上面的疑難排解部分。
- 檢查瀏覽器控制台是否有錯誤。
- 檢查 WordPress 和 WooCommerce 的相容性。
外掛標籤
開發者團隊
② 後台搜尋「Product Media Video Viewer for WooCommerce」→ 直接安裝(推薦)
原文外掛簡介
Product Media Video Viewer for WooCommerce enhances the default WooCommerce product gallery by allowing store owners to display videos alongside product images.
The plugin adds a smooth slider and popup modal with support for both images and videos, improving product presentation and customer engagement.
Key Features
Video icon displayed on WooCommerce product image gallery
Modal popup with separate Images and Videos tabs
Image gallery view with thumbnail sidebar and full-size image slider
Video gallery view with video list sidebar and embedded YouTube player
Custom repeater field in product admin to add multiple YouTube videos
Fully responsive design for desktop, tablet, and mobile
Smooth animations, transitions, and hover effects
Seamless YouTube video embedding and playback
Lightweight and performance-optimized
No theme modification required
Developer Hooks
This plugin provides actions and filters for developers to extend functionality.
Actions
pvmg_init – Fires when the plugin initializes
pvmg_before_save_videos – Fires before product video data is saved
pvmg_after_save_videos – Fires after product video data is saved
Filters
pvmg_save_videos – Modify video data before saving
pvmg_video_item_html – Customize video HTML output in the popup modal
pvmg_product_images – Modify product images used in the media gallery
Performance
The plugin is optimized for performance:
– CSS and JS files are only loaded on product pages
– YouTube API is loaded asynchronously
– Images are lazy-loaded in the modal
– Minimal database queries
Security
– All inputs are sanitized and escaped
– YouTube URLs are validated
– Nonce verification on form submissions
– Capability checks for admin functions
Support
For issues, questions, or feature requests:
– Check the troubleshooting section above
– Review the browser console for errors
– Check WordPress and WooCommerce compatibility
