=== Universal Form Cropper ===
Contributors: madebysaad
Tags: image cropper, form upload, contact form 7, wpforms, gravity forms
Requires at least: 6.2
Requires PHP: 8.0
Stable tag: 0.6.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a drag-and-drop square image cropper to any WordPress form. The cropped image is saved on your server and its URL is sent with the form.

== Description ==

Universal Form Cropper places an upload box inside any form: Contact Form 7, WPForms, Gravity Forms or a plain HTML form. The visitor drops or picks an image, crops it to a square and zooms. On Save, the image is uploaded and cropped on the server, and the final URL is written into a hidden field. When the form is submitted, that field carries the image URL, not the image file.

Developer: Mohamed Saad - https://madebysaad.com/
Full documentation: https://madebysaad.com/universal-form-cropper/

= Shortcode =

[universal_form_cropper field="cropped_image" label="Upload photo"]

* field: name of the hidden input that receives the URL. Letters, numbers, _ and - only; anything else falls back to cropped_image.
* label: text shown above the box.
* key (optional): a number that makes the name field[key], e.g. key="2" gives cropped_image[2]. Useful for several croppers in one form.

The shortcode must be inside a <form>, and it has to be rendered as HTML there (if the shortcode text shows up instead of the upload box, that spot does not run shortcodes). If the form already has a hidden field with the same name, the plugin uses it; otherwise it creates one. With a form builder, give one of the builder's own fields exactly that name, since a builder may ignore inputs it did not create. In Contact Form 7, add [hidden cropped_image] and use the mail-tag [cropped_image] in the email. Contact Form 7 does not run other plugins' shortcodes in its form template by default; if the shortcode shows as text there, add add_filter( 'wpcf7_form_elements', 'do_shortcode' ); to your theme's functions.php or a small custom plugin.

= Settings (Settings > Universal Form Cropper) =

* Allow guest uploads (off by default: users must be logged in with the upload_files capability; turn it on for public forms).
* Max upload size (default 2 MB). JPG, PNG and WebP only.
* Output size (default 600 x 600).
* Minimum crop size (default 100 px, measured on the original image).
* Token lifetime (default 600 seconds).
* Rate limits per IP (defaults: 60 token requests, 20 uploads and 20 final crops; a counter clears one window, 1 hour by default, after the last request it counted).
* Temp file retention (default 24 hours; 0 turns cleanup off). Final images are not deleted.
* Widget UI: crop box size, preview size, zoom limits.
* Enable event logging for debugging.

== Installation ==

1. Plugins > Add Plugin (Add New in older versions) > Upload Plugin, choose the ZIP, click Install Now, then Activate Plugin.
2. Put the shortcode inside your form.
3. Review Settings > Universal Form Cropper (enable guest uploads for public forms).

== Changelog ==

= 0.6.4 =
* Added Plugin URI and Author URI, a Settings link on the Plugins screen (plus a Documentation link when WordPress does not already link to the plugin page), a developer credit on the settings page, and this readme.
