EffortLess Custom Form Type

Description

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.

On submit, the form is sent by AJAX to admin-ajax.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.

Blocks

This plugin provides 6 blocks.

  • Submit Button Submit button for an EffortLess form.
  • Email Field Required email field for an EffortLess form.
  • Arithmetic CAPTCHA Simple server-verified arithmetic CAPTCHA for EffortLess forms.
  • Form Row Responsive row for EffortLess form fields and buttons.
  • Form Field A form field: text, textarea, email, phone, URL, number, date, time, dropdown, radio buttons, checkboxes, file upload or hidden value.
  • EffortLess Form Insert a reusable translated EffortLess form post.

Installation

  1. Upload the plugin folder to /wp-content/plugins/, or use Plugins > Add New > Upload Plugin.
  2. Activate it from the Plugins screen. On Multisite it can be network activated; each site keeps its own forms.
  3. Activation creates a form named “Early Access Form” (slug early-access-form) on each site.
  4. Open Forms in the admin menu and edit that form, or choose Add Form.
  5. In the form editor, add an Email Field, optionally an Arithmetic CAPTCHA, and a Submit Button. Set the recipient and subject in the Form delivery box, then publish the form.
  6. Edit a page, add the EffortLess Form block (category “EffortLess”), enter the form slug and publish. Alternatively, put [elcft_form slug="early-access-form"] in the page.

FAQ

I configured a form but nothing happens

Check the following:

  • The form post is published. Drafts and private forms are not displayed and cannot receive submissions; logged-in users who can edit posts see “Form not found.” in that case.
  • The slug in the block or shortcode matches the form’s slug.
  • The form content contains at least one Form Field or Email Field and a Submit Button. A form without fields refuses every submission. A field marked required, or with an invalid value, is refused with a message naming the field.
  • If the form contains an Arithmetic CAPTCHA, the answer must be correct. The question is valid for 12 hours, so a page cached for longer needs a refresh.
  • The site can send email. The plugin uses wp_mail(), so a mail plugin or server configuration is needed where PHP mail does not work.
  • Full-page caching can serve an expired nonce. Exclude pages that show a form from caching, or keep the cache lifetime under 12 hours.

Where are submissions stored?

In the database as entries (Forms > Entries) unless “Save submissions in the database” is switched off for the form, and in the notification email. Uploaded files are stored in wp-content/uploads/elcft/. Form posts and entries are kept when the plugin is deleted.

Can the same form be translated on a multisite network?

Create a form with the same slug on each language site and reference the slug in the block. The form text lives in the post, so tools that translate posts can process it.

Does the plugin call external services?

No. See the External services section.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“EffortLess Custom Form Type” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.5.9

  • Removed: the bundled translation files (/languages) and the code that loaded them. Translations are delivered through translate.wordpress.org language packs.

0.5.8

  • Removed: the per-form Custom CSS setting (Form Settings panel in the editor sidebar). Forms can be styled with Additional CSS in the Customizer or Site Editor, using the .elcft-form-{form ID} class on the form wrapper. Stored _elcft_custom_css values are deleted on update.

0.5.7

  • Added: translations for Spanish, Traditional Chinese, Korean, French, Japanese, German, Italian and Brazilian Portuguese, with a template (.pot), block-editor strings and block titles. A language pack from translate.wordpress.org takes precedence when one is installed; otherwise the bundled file for the site or user language is loaded.

0.5.6

  • Changed: the one-time rename collects the matching posts page by page and then rewrites them, instead of excluding processed posts with post__not_in.

0.5.5

  • Fixed: the one-time rename from 0.5.1 and earlier names (shortcodes, blocks, classes) did not rewrite form posts that held the old block names, so forms built before 0.5.2 could lose their CAPTCHA and fields. Forms are now found by post type and rewritten first; other posts are found by search.
  • Changed: a solved CAPTCHA works once, so one answer cannot be reused for several submissions.
  • Changed: a form cannot be embedded inside another form; fields kept in synced patterns are recognised; the upload folder gets an empty index.php; an upload larger than the server limit gives a clear message.
  • Changed: the personal data exporter and eraser handle more than 50 entries per address and include entries in the trash.
  • Added: filter elcft_client_ip for sites behind a reverse proxy, where every visitor shares one address for rate limiting.
  • Changed: the version option is autoloaded.

0.5.4

  • Fixed: the Form Field block can be placed inside a Form Row.
  • Fixed: on light themes, inputs, selects, textareas and the CAPTCHA box were unreadable (translucent background with light text). They now have a solid dark background; --elcft-input-background and --elcft-input-color change it. Field labels follow the theme text colour in inline forms and are light inside the popup (--elcft-label-color).
  • Fixed: after a server-side field error, focus goes to the field that has the error instead of the first field of the form.

0.5.3

  • Added: Form Field block with 13 field types (text, textarea, email, phone, URL, number, date, time, dropdown, radio buttons, checkboxes or consent box, file upload, hidden value), two-column layout, help text, default values and per-field limits.
  • Added: server-side validation of every field against the form definition, with field-level errors.
  • Added: saved entries (Forms > Entries) with a form filter, CSV export, personal data exporter and eraser.
  • Added: several recipients, {field} placeholders in the subject, success message, redirect after success and an optional auto-reply.
  • Added: file uploads stored in uploads/elcft/ with type and size checks.
  • Changed: the notification email lists every field; the first Email field sets Reply-To; rate limits are an identical-submission limit and a per-IP burst limit.
  • Changed: elcft_submission_sent receives the field rows and the entry ID as extra arguments.

0.5.2

  • Changed: shortcodes, block names, block category and CSS classes now use the elcft prefix: [elcft_form], [elcft_email], [elcft_captcha], [elcft_submit], blocks elcft/*, classes elcft-*. On update, existing posts, pages and form CSS are rewritten once to the new names. The old [effortless_*] and [honeyedge_*] tags are no longer registered.
  • Changed: the plugin author is now domclic.
  • Fixed: form lookups by slug no longer skip posts_* query filters.

0.5.1

  • Fixed: the CAPTCHA signing secret is now a separate random value stored in the elcft_secret network option instead of being derived from the WordPress authentication salt.
  • Fixed: shortcode and block output is filtered with a form-aware allowed-HTML list.
  • Changed: the main class is renamed ELCFT_Custom_Form_Type.
  • Removed: the load_plugin_textdomain() call and the unused Domain Path header.
  • Added: Requires at least, Requires PHP and license headers, a donate notice on the Forms screen, and an uninstall.php that removes the plugin’s options.
  • Changed: the readme documents every setting, shortcode attribute and hook.

0.5.0

  • Popup auto-close (close_after), field locking while sending, separate popup trigger and submit button colours.

0.4.1

  • Fixed: per-form Custom CSS disappearing after saving in the block editor (custom-fields support added to the post type).

0.4.0

  • Added: per-form Custom CSS, scoped to the form.

0.3.0

  • Added: arithmetic CAPTCHA block and shortcode.

0.2.0

  • Added: Gutenberg blocks (Form, Form Row, Email Field, Submit Button).