About this plugin
The plugin registers a custom post type, elcft_form (“Forms”). The form’s fields are the block content of that post, so the form can be edited in the block editor and handled by any tool that works on posts. A form is displayed on a page with the “EffortLess Form” block or with the [elcft_form] shortcode, either inline or in a popup opened by a button.
php. The server checks a nonce, a hidden honeypot field, the optional arithmetic CAPTCHA, every field against the definition stored in the form post (required, type, length, allowed choices) and two rate limits, then sends a plain-text email with wp_mail() listing every field. Submissions are also saved as entries in the database unless that is switched off for the form.
Blocks
- EffortLess Form – displays a published form chosen by its slug. Settings: form slug, popup on/off, popup trigger label, and seconds before the popup closes after a successful submission.
- Form Field – one block for all field types, chosen with the Type setting or by inserting one of the variations: Text, Message (textarea), Email, Phone, Website URL, Number, Date, Time, Dropdown, Radio buttons, Checkboxes / consent, File upload, Hidden value. Settings: label, field key, required, width (full or half for two columns), placeholder, default value, help text, options (one per line, value|Label shows a different text; a checkbox without options is a single consent box), maximum length, minimum and maximum for number and date.
- Form Row – a container for fields and the submit button.
- Email Field – the original email input, kept for existing forms. Settings: label, placeholder, required.
- Arithmetic CAPTCHA – a question such as “5 + 6 =?”. Settings: label, placeholder.
- Submit Button – the submit button; its text is edited in place.
Form settings
In the form editor:
- Recipient email (Form delivery box): one or several addresses separated by commas. Invalid addresses are dropped. When empty, the site administrator email is used.
- Email subject (Form delivery box): when empty, “New form submission: {form title}” is used. {field_key} inserts a submitted value.
- Save submissions in the database (Form delivery box): on by default. Saved entries are listed under Forms > Entries.
- Success message (Messages and auto-reply box): shown after sending; the default is “Thank you. Your submission was received.”
- Redirect after success (Messages and auto-reply box): an http or https address opened about a second after the success message.
- Send an auto-reply to the visitor (Messages and auto-reply box): off by default. Sends the auto-reply subject and message to the first Email field, only when the visitor filled it in and a message text is set. Placeholders: {field_key}, {all_fields} (plain-text summary), {form}, {site}. An auto-reply sends mail to whatever address is typed in the form, so add an Arithmetic CAPTCHA block to forms that use it.
- Excerpt: used as the popup trigger button label when the block or shortcode does not give one.
Shortcodes
- [elcft_form slug="my-form"] – attributes: id (post ID, alternative to slug ), slug, popup ( true / false, default true ), trigger (button label), close_after (seconds 0-60, default 4, 0 keeps the popup open), class.
- [elcft_email label="" placeholder=""], [elcft_captcha label="" placeholder=""], [elcft_submit label=""] – the same fields as the blocks, for use inside a form post.
Entries
Forms > Entries lists saved submissions (administrators only, capability manage_options ). Each entry shows every field; a filter above the list selects one form, and Export CSV downloads that form’s entries (cells that start with =, +, - or @ are prefixed with an apostrophe). Entries are removed with the Delete link or in bulk.
Deleting an entry also deletes its uploaded files. The plugin registers a personal data exporter and eraser that look entries up by the first Email field value (WordPress Tools > Export / Erase Personal Data).
File uploads
A File field accepts jpg, png, gif, webp, pdf, txt, csv, doc, docx, xls and xlsx files up to 5 MB, checked by extension and content type. Files are stored in wp-content/uploads/elcft/ under an unguessable name and appear as links in the email and the entry. They are public to anyone who knows the link.
The elcft_upload_mimes and elcft_max_upload_bytes filters change the allowed types and the size limit; the PHP upload_max_filesize and post_max_size limits also apply.
Submission behaviour
- While a submission is pending, the fields and button are disabled. If the server returns an error they become editable again.
- After a successful submission the button shows “Sent” and a popup closes after the configured delay.
- Two rate limits apply: an identical submission from the same IP address is refused for 60 seconds, and one IP address can send at most 10 submissions to a form in 10 minutes (filter elcft_burst_limit ).
- Hidden fields always send the value stored in the form, not the value in the browser.
- If the notification email cannot be sent but the entry was saved, the visitor still sees the success message and the entry is marked “notification email could not be sent”.
- Two fields with the same key get the suffix _2, _3 in document order.
- The CAPTCHA token is signed with a random secret stored in the elcft_secret network option and expires after 12 hours.
Hooks
- Filter elcft_resolved_form_post( $post, $atts ) – map the resolved form to another post, for example a translation.
- Filter elcft_mail( $mail, $post, $email ) – change the recipient (a list of addresses), subject, body or headers before wp_mail(). $email is the first Email field value.
- Action elcft_submission_sent( $post, $email, $rows, $entry_id ) – runs after the submission was processed; $rows lists key, label, type and value of each field.
- Filters elcft_upload_mimes, elcft_max_upload_bytes, elcft_burst_limit – see above.
External services
The plugin does not connect to any external service. Form submissions are sent through the site’s own wp_mail() configuration; if a mail plugin on the site relays mail to a third-party provider, that plugin’s documentation applies.