WP Manifestindependent plugin directory
manifest / ecommerce / woocommerce-order-customer-attachments

WooCommerce Order Customer Attachments

Add customer-visible file attachments to WooCommerce orders with AJAX management, internal notes, audit logs, URL validation, and HPOS support.

★ 0stars

Install

Download source zip No release zip yet

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.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Add 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_Order meta storage
  • Legacy metadata fallback
  • Configurable allowed link hosts
  • Responsive admin and customer UI

Requirements

  • WordPress 6.0+
  • PHP 7.4+
  • WooCommerce

Installation

  1. Upload the WooCommerce-Order-Customer-Attachments folder to /wp-content/plugins/.
  2. Activate WooCommerce Order Customer Attachments.
  3. Edit a WooCommerce order.
  4. Use the Customer-visible attachments meta box.
  5. 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_woocommerce capability 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