=== EaseAttach - Product Attachment for WooCommerce ===
Contributors: malun728
Tags: woocommerce, product attachments, product files, downloads, resources
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Attach files and resource links to WooCommerce products and show them in a clear, accessible tab on the product page.

== Description ==

**EaseAttach** lets you add PDFs, manuals, spec sheets, images, spreadsheets, archives, audio and video files, and external resource links to any WooCommerce product. Customers find everything in an **Attachments** tab on the product page, with a button to view, download or open each item.

= Features =

* **Several attachments per product** (up to 50), added from the **Attachments** tab in the Product data box.
* **Two sources**: a file from the Media Library, or an external http(s) link.
* **Per-attachment fields**: customer-facing title, optional plain-text description, optional button label, and an action (View, Download or a normal link).
* **Drag to reorder**, and switch any attachment on or off without deleting it.
* **File-type icons** and readable file sizes.
* **List or card layout**, with colour or single-colour icons.
* **Display settings**: show or hide the tab, rename the tab and section heading, change the button labels, show or hide file sizes, and choose whether external links open in a new tab.
* **Live preview** on the settings page, so you see changes as you make them.
* **Dashboard** with attachment counts, recently updated products and quick links.
* **Responsive and keyboard-accessible** output, with visible focus states and screen-reader text.
* **Developer friendly**: helper functions, filters and actions to extend fields, sources, visibility, icons and output.
* **Clean uninstall option**: your data is kept by default and removed only if you choose so.

= Where to find it =

After activation a new **EaseAttach Woo** menu appears in the admin sidebar with a **Dashboard** and a **Settings** page. Attachments themselves are added on each product's edit screen.

= Supported file types =

PDF, common images (JPG, PNG, GIF, WebP), Word, Excel and PowerPoint documents, OpenDocument files, plain text, CSV, ZIP, 7z and RAR archives, and common audio and video formats. Executable and script file types are always rejected.

= Security =

* Executable and script file types (such as PHP, HTML, SVG and JavaScript) are always rejected, even if a filter tries to allow them.
* External links must start with http:// or https:// and may not contain a username or password.
* Settings and attachment fields are validated on save and escaped on output. Saving is protected by nonces and capability checks.

= EaseAttach Pro =

Need to manage files across your whole catalog, or control who can download them? **EaseAttach Pro - Product Attachment for WooCommerce** is a separate paid add-on that works on top of this plugin. It adds:

* A shared attachment library: add a file once and reuse it on many products.
* Rule-based assignment by product, category, tag, attribute, variation or globally, with exclusions.
* Access rules: public, logged-in users, selected roles, buyers only, or by order status, plus start and end dates and download limits.
* Protected file storage with secure download links.
* Order attachments, with links shown on the order page and in WooCommerce emails.
* Customer uploads on orders, with approval review.
* Bulk assign tools and CSV import.
* Download log and reports.
* A shortcode and a block to place attachments anywhere.

You can buy it from the [EaseAttach Pro product page](https://www.techbellasolutions.com/product/easeattach-product-attachment-pro/). This plugin is fully usable without it, and the Pro promotions in the admin can be switched off with the `epaw_show_pro_promotions` filter.

= Privacy =

Files from the Media Library are public: anyone who has a file's link can open it, so do not attach confidential files. The plugin does not collect or store customer personal data, does not set cookies, and does not send any data to external services. The "Buy Pro" links are plain links that open in a new tab only when clicked.

Removing an attachment from a product never deletes the file from the Media Library.

= Not affiliated =

EaseAttach - Product Attachment for WooCommerce is an independent plugin. It is not affiliated with, endorsed by, or sponsored by WooCommerce or Automattic. "WooCommerce" is used only to describe the integration.

== Installation ==

1. Install WooCommerce and activate it.
2. Upload the plugin folder to `/wp-content/plugins/`, or install it from **Plugins > Add New**, then activate it.
3. Edit a product, open the **Attachments** tab in the Product data box, click **Add attachment**, choose a file or paste a link, enter a title and update the product.
4. Open the product page. An **Attachments** tab appears next to Description and Reviews.
5. Optional: open **EaseAttach Woo > Settings** to change the layout, labels and icons.

== Frequently Asked Questions ==

= Where are the settings? =

In the admin sidebar under **EaseAttach Woo > Settings**. The tabs are Display, Appearance, Button labels and Data.

= Does it need WooCommerce? =

Yes. WooCommerce must be installed and active. WordPress will not activate the plugin without it.

= Which file types are allowed? =

PDF, common images, office documents, spreadsheets, presentations, text, CSV, ZIP, 7z and RAR archives, and common audio and video formats. Executable and script files are always rejected.

= Are the files private? =

No. Media Library files and external links are public. Anyone with the link can open them, so do not attach confidential files. Protected downloads with access rules are part of EaseAttach Pro.

= Are video links embedded? =

No. Video links are shown as normal resource links with a video icon.

= How many attachments can a product have? =

Up to 50. Developers can change the limit with the `epaw_max_attachments` filter.

= I added attachments but customers do not see them. =

Check that **Frontend display** is switched on in **EaseAttach Woo > Settings > Display**, that the attachment's "Show on the product page" box is ticked, and that the product is published. Some themes replace the product tabs; in that case contact the theme author or use the developer functions listed below.

= Can I change the tab name or the button text? =

Yes. Use **Settings > Display** for the tab name and heading, and **Settings > Button labels** for the View, Download and Link buttons. You can also set a label on a single attachment.

= What happens to my data if I delete the plugin? =

Attachment data is kept by default. To remove it on uninstall, switch on "Delete all attachment data and settings when the plugin is deleted" in **Settings > Data** first. Media Library files are never deleted.

= Is it compatible with High-Performance Order Storage and the block checkout? =

Yes. The plugin declares compatibility with both. It stores nothing on orders.

= Does it work with the EaseAttach Pro add-on? =

Yes. When EaseAttach Pro is active and licensed, its settings appear as extra tabs on the same Settings page, and shared attachments appear in the same product tab.

= Can developers extend it? =

Yes. Attachments are stored per product in the meta key `_epaw_attachments`.

Helper functions: `epaw_get_product_attachments( $product_id, $visible_only )`, `epaw_get_attachments_html( $product )`, `epaw_get_allowed_file_types()`, `epaw_validate_url( $url )`, `epaw_get_media_info( $id )` and `epaw_get_setting( $key )`.

Filters: `epaw_allowed_file_types`, `epaw_attachment_sources`, `epaw_sanitize_attachment`, `epaw_max_attachments`, `epaw_product_attachments`, `epaw_attachment_is_visible`, `epaw_visible_attachments`, `epaw_tab_priority`, `epaw_attachment_item_html`, `epaw_attachments_html`, `epaw_icon_map`, `epaw_default_settings`, `epaw_settings_tabs`, `epaw_dashboard_stats`, `epaw_dashboard_links`, `epaw_pro_url` and `epaw_show_pro_promotions`.

Actions: `epaw_loaded`, `epaw_upgrade`, `epaw_admin_row_fields`, `epaw_attachments_saved`, `epaw_before_attachments`, `epaw_after_attachments`, `epaw_settings_panels`, `epaw_settings_before_form`, `epaw_settings_after_form` and `epaw_dashboard_sections`.

Executable and script file types are always removed from the allowed types, whatever a filter returns.

= Is this an official WooCommerce plugin? =

No. It is an independent plugin and is not affiliated with WooCommerce or Automattic.

== Screenshots ==

1. The Attachments tab in the Product data box, with drag-to-reorder rows.
2. The Attachments tab on the product page, list layout.
3. The Attachments tab on the product page, card layout.
4. Settings page with live preview.
5. EaseAttach Woo dashboard.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
