=== Checkout Files Upload for WooCommerce === Contributors: wpwham Tags: woocommerce, checkout files upload, checkout, woo commerce Requires at least: 4.4 Tested up to: 7.1 Stable tag: 2.4.2 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html Let your customers upload files on (or after) WooCommerce checkout. == Description == Checkout Files Upload for WooCommerce plugin lets your customers upload files on (or after) WooCommerce checkout. = Features = Set field's **position** on WooCommerce checkout page: * Before checkout form. * After checkout form. * Do not add on checkout. Set if file upload **is required**. If you need files to be uploaded after order is created, you can optionally add field to: * WooCommerce **Thank You** (i.e. **Order Received**) page. * WooCommerce **My Account** page. Add custom **label** to the field. Set **accepted file types**. Set custom Upload and Remove **button labels**. Set **custom messages**: * "Wrong file type". * "Wrong image dimensions" and "Couldn't get image dimensions". * "File is required". * "File was successfully uploaded". * "No file selected". * "File was successfully removed". Optionally set field to show up only if in cart there are selected: * **Products**. * **Product categories**. * **Product tags**. Add uploaded files to admin and customers **emails**. Send **additional emails** if user uploads or removes files on "Thank You" or "My Account" pages. **Customize** the frontend files upload form. Optionally enable **AJAX form** for file uploads. Set **max file size** option. Optionally **validate image dimensions**. = Feedback = * We are open to your suggestions and feedback. Thank you for using or trying out one of our plugins! * Drop us a line at [www.wpwham.com](https://wpwham.com). = More = * Visit the [Checkout Files Upload for WooCommerce plugin page](https://wpwham.com/products/checkout-files-upload-for-woocommerce/). == Installation == 1. Upload the entire plugin folder to the `/wp-content/plugins/` directory. 2. Activate the plugin through the "Plugins" menu in WordPress. 3. Start by visiting plugin settings at "WooCommerce > Settings > Checkout Files Upload". == Screenshots == 1. Checkout Files Upload for WooCommerce - Front End. 2. Checkout Files Upload for WooCommerce - Settings: General. 3. Checkout Files Upload for WooCommerce - Settings: Emails. 4. Checkout Files Upload for WooCommerce - Settings: Template. 5. Checkout Files Upload for WooCommerce - Settings: File Uploader. == Changelog == = 2.4.2 - 2026-11-12 = * FIX: filename in email attachments (bug introduced in v2.4.1) (#112246, #112263, #112282, #112296). * FIX: prevent potential crash if upload session was lost (#112169). = 2.4.1 - 2026-11-05 = * FIX: improved MIME type detection and handling for uploaded files. = 2.4.0 - 2026-10-20 = * NEW: **Breaking Change** Leaving blank the "accepted file types" setting no longer means all files are allowed. Only certain file types allowed by WordPress are accepted. If you want to allow other file types (for example: .svg, .psd, .ttf, etc) you MUST specifically enter them in this setting, along with all other types you wish to accept. = 2.3.0 - 2026-08-28 = * NEW: add setting "Allow delete" (allows users with access to WooCommerce/Orders to delete files from orders -- previously this was always true). * FIX: prevent upload progress bars from having duplicate IDs (minor UI glitch). * FIX: potential bug when deleting pending checkout uploads (thanks to Tobias -- #110420). * UPDATE: updated .pot file for translations. = 2.2.6 - 2026-05-15 = * FIX: recent Woocommerce changes breaking HPOS compatibility mode. = 2.2.5 - 2026-05-06 = * FIX: error when "Max file size" setting is empty on PHP 8 (#107736). * FIX: add capability check. = 2.2.4 - 2026-03-10 = * FIX: preventing multiple uploaders from appearing (#106708). * FIX: potential conflict with Divi theme (#106397). = 2.2.3 - 2026-02-18 = * FIX: PHP notice. = 2.2.2 - 2025-05-31 = * FIX: add filter 'wpwham_checkout_files_upload_validate_file_type'. = 2.2.1 - 2025-04-24 = * FIX: "file required" not working if uploader placed outside of main checkout form via shortcode (#89416). * FIX: PHP notice. * FIX: escape text in translation shortcodes. = 2.2.0 - 2024-08-28 = * NEW: add shortcode 'wpwham_checkout_files_uploader'. * FIX: issue with uploads sometimes not being processed. * FIX: issue with metabox not displaying on admin Order page when "HPOS" enabled. = 2.1.5 - 2023-07-13 = * FIX: PHP 8.2 notices. = 2.1.4 - 2022-06-02 = * FIX: add nonce checks to AJAX actions. * UPDATE: updated .pot file for translations. = 2.1.3 - 2022-05-10 = * FIX: escape filenames on order confirmation/thank you pages. = 2.1.2 - 2021-12-23 = * FIX: minor display bug in settings due to WooCommerce update. = 2.1.1 - 2021-09-16 = * UPDATE: PHP 8 now officially supported. * UPDATE: updated .pot file for translations. = 2.1.0 - 2021-04-15 = * NEW: added more options to "validate image dimensions" setting: "greater than or equal", and "less than or equal". * NEW: added button to delete file attachments on admin "edit order" page. (If you don't want the ability to delete files, you can use the filter `wpwham_checkout_files_upload_allow_admin_delete_files` to disable it). * FIX: check if server's temporary directory is writeable. If not, display an error message. (Solves an issue with 0-byte files being uploaded). * FIX: bug where sometimes 0-byte files were attached to order emails. * UPDATE: for text labels/notices, made it possible for a translated string to take precedence over stored settings. (Previously it was the other way around. This should now make things easier if you use a translation plugin like LocoTranslate, Polylang, etc). * UPDATE: performance improvement -- load our admin assets only when needed. * UPDATE: updated .pot file for translations. = 2.0.4 - 2021-01-12 = * FIX: clean output buffer before downloads (solves conflict with some 3rd-party plugins which interfere with the output buffer, causing downloads to appear as empty or corrupt). = 2.0.3 - 2020-09-17 = * UPDATE: display our settings in WC status report. = 2.0.2 - 2020-08-21 = * FIX: upload button translation issue (removed old label settings, added new ones). * UPDATE: updated .pot file for translations. = 2.0.1 - 2020-06-17 = * FIX: issue with upload button not working in certain themes. * FIX: user permissions issue incorrectly preventing downloading of images from the WP admin side. * FIX: JS typo. = 2.0.0 - 2020-06-11 = * NEW: **Breaking Change** the `Form (simple)` template has been removed, and `Form (AJAX)` is now the standard template. `Form (AJAX)` has been the default since v1.4.0 (2018-08-25), so for most people this change will have no effect. However, if you were using `Form (simple)`, or if you had customized either template, please double check your settings to make sure things look correct. Or, you can reset the settings to get a fresh start. * NEW: **Breaking Change** in template settings, the variable `%field_html%` which previously contained BOTH the field html AND the upload button itself, has been split into separate variables `%field_html%` and `%button_html%`. Your template settings will be updated automatically to reflect this. * NEW: image thumbnails will be shown by default. The image feature has existed since v1.4.0 (2018-08-25), but some people didn't realize this and/or didn't know they needed to add `%image%` into the template to enable it. Now `%image%` is included in the template by default. If you don't want this, simply edit your template settings and remove the `%image%` variable. * NEW: show spinner when processing, and prevent checkout form submission before upload is completed. * UPDATE: change the way we handle sessions -- only start them when needed, not on every page load. * UPDATE: extensive code refactoring. * UPDATE: updated some styling and text. For example, progress bars (if enabled) are now green. * UPDATE: updated .pot file for translations. = 1.5.4 - 2020-01-14 = * UPDATE: add new filters 'wpw_checkout_files_upload_form_html' and 'wpw_checkout_files_upload_form_ajax_html'. * UPDATE: wrap checkout page file upload controls in