Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/amirrezashf/woocommerce-order-customer-attachments/archive/refs/heads/main.zipAdd customer-visible file links to WooCommerce orders, manage them through AJAX in the order editor, and keep internal change logs.
Features
- Up to 15 attachment links per order
- Customer-visible attachment name and URL
- Internal admin-only note per attachment
- Automatic file-type detection from URL extension
- Independent AJAX loading and saving
- Admin audit log for add/edit/delete operations
- Customer display on WooCommerce order details
- Server-side order ownership check
- HPOS-compatible
WC_Ordermeta storage - Legacy metadata fallback
- Configurable allowed link hosts
- Responsive admin and customer UI
Requirements
- WordPress 6.0+
- PHP 7.4+
- WooCommerce
Installation
- Upload the
WooCommerce-Order-Customer-Attachmentsfolder to/wp-content/plugins/. - Activate WooCommerce Order Customer Attachments.
- Edit a WooCommerce order.
- Use the Customer-visible attachments meta box.
- Add a valid file URL and save.
Allowed File Hosts
By default, only links from the site's own hostname are accepted.
add_filter( 'wcoca_allowed_hosts', function ( $hosts ) {
$hosts[] = 'files.example.com';
$hosts[] = 'cdn.example.com';
return $hosts;
} );
Use hostnames only, without scheme or path.
Customer Visibility
Attachments are shown only when the current user owns the order or has manage_woocommerce.
Internal notes and audit logs are never rendered to customers.
Data Storage
New order meta:
_wcoca_order_attachments_wcoca_order_attachments_log
Legacy fallback:
_fa_user_order_attachments_fa_user_order_attachments_log
Security
- Authenticated AJAX only
- Nonce verification
manage_woocommercecapability check- Server-side URL validation
- Only configured HTTP/HTTPS hosts are allowed
- Server-side order ownership check for customer display
- Internal notes are not exposed on the frontend
The plugin links to files; it does not upload, proxy, or malware-scan them.
Compatibility
HPOS compatibility is declared and order storage uses WC_Order metadata APIs.
License
GPL-3.0
Author
Amirreza Shayesteh Far
https://github.com/amirrezashf
ضمیمه فایل سفارش ووکامرس
این افزونه امکان ثبت لینک فایل برای سفارش WooCommerce، نمایش آن به مشتری و نگهداری تاریخچه تغییرات مدیریتی را فراهم میکند.
قابلیتها
- حداکثر ۱۵ ضمیمه برای هر سفارش
- نام و لینک قابل مشاهده برای مشتری
- یادداشت داخلی مخصوص مدیران
- تشخیص نوع فایل از پسوند URL
- ذخیره مستقل با AJAX
- ثبت Log برای افزودن، ویرایش و حذف
- نمایش ضمیمهها در جزئیات سفارش مشتری
- بررسی Ownership سفارش در سمت سرور
- سازگاری با HPOS
- خواندن Metaهای نسخه قدیمی
- امکان تعیین دامنههای مجاز
دامنههای مجاز
بهصورت پیشفرض فقط Host اصلی خود سایت مجاز است.
add_filter( 'wcoca_allowed_hosts', function ( $hosts ) {
$hosts[] = 'files.example.com';
$hosts[] = 'cdn.example.com';
return $hosts;
} );
ذخیرهسازی داده
Metaهای جدید:
_wcoca_order_attachments_wcoca_order_attachments_log
Legacy fallback:
_fa_user_order_attachments_fa_user_order_attachments_log
امنیت
- AJAX فقط برای کاربران لاگینشده
- بررسی Nonce
- نیاز به
manage_woocommerce - اعتبارسنجی URL در سمت سرور
- محدودیت به Hostهای مجاز
- بررسی Ownership سفارش برای مشتری
- عدم نمایش یادداشت داخلی در Frontend
این افزونه فایل را Upload، Proxy یا Malware Scan نمیکند.
مجوز
GPL-3.0
نویسنده
Amirreza Shayesteh Far
https://github.com/amirrezashf