=== Frontierline Forms – Confirmation & Multi-Step for Contact Form 7 ===
Contributors: frontierline2015, freemius
Tags: contact form 7, confirmation, multi step form, database, csv export
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a confirmation page, multi-step forms, and database storage with CSV export to Contact Form 7. Save every submission — no limits.

== Description ==

Frontierline Forms extends Contact Form 7 with the features it is missing out of the box: a confirmation screen (preview submission before sending), multi-step and multi-page forms, conditional logic, and submission history saved to your WordPress database with one-click CSV export. Use it to save Contact Form 7 submissions to the database, add a confirmation page, build multi-step forms, export entries to CSV, or migrate from MW WP Form — all from the WordPress admin, with no usage limits.

This plugin is an add-on for Contact Form 7 and requires Contact Form 7 to be installed and active. It is not affiliated with, endorsed by, or sponsored by the Contact Form 7 project or its author.

= Features =

* **Multi-step forms** — Split a single Contact Form 7 form into multiple steps using a `[step]` tag. No limit on the number of steps.
* **Confirmation screen** — Add an "input -> confirm -> submit" flow that Contact Form 7 does not provide out of the box.
* **Completion screen** — Replace the form with a custom completion message on success, or redirect to a thank-you page (useful for GA4 conversion tracking).
* **Conditional logic** — Show or hide fields based on what the visitor enters, using simple HTML data attributes. No limit on the number of rules.
* **Progress bar** — Three styles (numbered steps, bar, dots).
* **Submission history** — Every submission is saved to your own WordPress database and can be browsed, searched, and viewed in the admin screen.
* **CSV export** — Export your saved submissions to a CSV file (UTF-8 with BOM, Excel-friendly).
* **Honeypot** — Built-in spam protection, enabled automatically.
* **MW WP Form migration** — Convert your MW WP Form forms to Contact Form 7 with one click. Fields, validation rules, mail settings, and the confirmation flow are migrated automatically, with a report of anything that needs manual review.
* **Brand colors** — Set primary/secondary colors, border radius, and font family to match your site's design.

= Requirements =

* Contact Form 7 5.7 or later
* WordPress 6.0 or later
* PHP 7.4 or later

= Premium version =

A separate premium version with additional features is available from the developer's website. The premium code is **not** included in this free plugin. See https://frontierline.co.jp/en/plugins/frontierline-forms/ for details.

== External services ==

This plugin connects to one external service.

**Freemius** — This plugin uses the Freemius SDK to manage the optional upgrade to the premium version, license activation, and update delivery. When you opt in to usage tracking (you are asked, and it is optional), or when you activate a premium license, the plugin sends information such as your site URL, WordPress and PHP versions, and the active theme/plugins list to Freemius. No form submission content is ever sent. Freemius is provided by Freemius, Inc.
Terms of Service: https://freemius.com/terms/
Privacy Policy: https://freemius.com/privacy/

The free plugin does not send your form submissions to any external service. Any services used by the separate premium version are documented within that version and are only active when you configure them.

== Installation ==

1. Make sure Contact Form 7 is installed and active.
2. In your WordPress admin, go to Plugins -> Add New, search for "Frontierline Forms", then install and activate it.
3. Open the "Frontierline Forms" menu in the admin sidebar to configure it.

= Creating a multi-step form =

In the Contact Form 7 form editor, insert a `[step]` tag at each step boundary:

`[step "Basic info"]
[text* your-name]
[email* your-email]

[step "Your message"]
[textarea your-message]

[step "Confirm" confirmation]
Please review your input and submit.

[submit "Send"]`

= Using conditional logic =

Wrap the fields you want to toggle with HTML data attributes:

`<div data-cf7mp-show-if="contact-type" data-cf7mp-show-value="estimate">
  [text estimate-amount placeholder "Budget"]
</div>`

== Frequently Asked Questions ==

= Do I need Contact Form 7? =

Yes. Contact Form 7 5.7 or later must be installed and active. This plugin is an add-on for it.

= Is the confirmation screen on by default? =

No. Enable it under Settings -> General. It is off by default.

= Where are submissions stored? =

In your own WordPress database, in tables created by this plugin. Nothing is sent to an external service.

= Can I migrate from MW WP Form? =

Yes. Open Frontierline Forms -> MW WP Form Migration and convert each form with one click. Fields, validation rules, mail settings, and the input -> confirm -> submit flow are converted to Contact Form 7 automatically, and a report lists anything that needs manual review. The premium version can also import your saved MW WP Form inquiry data and convert all forms at once.

= Does the plugin keep what a visitor typed in their browser? =

By default, no. Nothing is written to cookies or to localStorage. Temporary saving of entries is off by default. If you turn it on under Settings -> General, entries are held in sessionStorage only: they are removed as soon as the browser tab is closed, discarded after the time limit you set, and cleared once the form is submitted. Moving back from the confirmation screen keeps the entries either way, because the values simply stay in the form.

= Does it work with file uploads? =

Yes. Use Contact Form 7's [file] tag as usual. The confirmation screen lists the selected file names, and the file is sent with the submission in the normal Contact Form 7 way. For security reasons browsers never let a script re-attach a file, so an uploaded file is not part of the temporary save.

= Do I need to exclude the form page from page caching? =

The form itself is rendered by Contact Form 7, which handles caching plugins on its own. If your cache plugin serves the page to logged-out visitors from a static copy, exclude the pages that contain the form so that each visitor receives a fresh security token.

= How do I remove all data on uninstall? =

Enable the data-deletion option in the settings before deleting the plugin. Otherwise, your data is preserved on uninstall.

== Screenshots ==

1. The Input -> Confirm -> Complete flow in action, with English and Japanese labels included.
2. Set up in minutes: add a [step] tag in the Contact Form 7 editor and enable the confirmation screen.
3. Every submission is saved to your own database, with keyword search, priority/category, and CSV export.
4. Match your site's design: brand colors, corner radius, font, and 3 progress bar styles.
5. Dashboard overview: submissions this month, today, and conversion rate at a glance.
6. Upgrade to Pro for Slack and Chatwork notifications plus automatic email replies.

== Changelog ==

= 2.1.2 =
* Fixed: on multi-step forms the Next button could look unresponsive. When a required field was empty the step refused to advance without saying why; empty fields are now highlighted, a message is shown, and focus moves to the first one.
* Fixed: required fields hidden by conditional logic no longer block the step, so forms that use conditional rules can always be completed.
* Changed: entries are no longer stored in localStorage. Temporary saving of entries is now off by default; when enabled it uses sessionStorage with a time limit, so nothing a visitor typed survives closing the browser tab. Drafts left behind by earlier versions are deleted on update.
* Added: a setting for temporary saving of entries, with a configurable time limit.
* Improved: the confirmation screen now lists uploaded file names instead of the browser's fake path, and ships with readable default styling.
* Improved: Next / Back and the confirmation and completion labels are translatable, and fall back to Japanese on Japanese sites until translations are published.
* Improved: tested with WordPress 7.1.

= 2.1.1 =
* Updated the plugin listing (name, description) and product links. No functional changes.

= 2.1.0 =
* New: MW WP Form migration wizard. Convert MW WP Form forms to Contact Form 7 with one click — fields, validation rules, mail settings, and the confirmation flow are migrated automatically, with a Japanese/English report of anything to review manually.
* Improved: encrypted submission storage is now decoded with a fixed-length header, making decryption robust for all stored records.
* Improved: corrupted legacy records are skipped with a notice during data import (premium) so they can be re-imported after repair.

= 2.0.5 =
* Added a "Free vs Pro" comparison and upgrade overview to the plugin's own dashboard screen.
* Internal hardening (safer module loading) and small admin style additions.

= 2.0.4 =
* Fixed: the multi-step progress bar, Back/Next buttons, and confirmation/completion text now follow the site language instead of always showing Japanese.

= 2.0.3 =
* The admin interface is now in English by default, with a bundled Japanese translation. Additional languages can be contributed on translate.wordpress.org.

= 2.0.2 =
* Added an optional review request shown only on the plugin's own admin screens. It appears after the plugin has been used and is permanently dismissible.

= 2.0.1 =
* Added a "Complete" step to the progress bar so multi-step and confirmation forms show the standard Input -> Confirm -> Complete (3-step) flow.
* The progress bar now stays visible on the completion screen with the final step highlighted.

= 2.0.0 =
* Renamed the plugin and made all built-in features fully functional with no usage limits.
* Multi-step forms and conditional logic are now unlimited.
* Submission history and CSV export available with no limits.
* Removed the arbitrary custom-CSS input; brand styling is now done with discrete color/typography settings.
* Moved all admin scripts to properly enqueued assets and added nonce verification to the CSV export.
* Documented external services.

== Upgrade Notice ==

= 2.1.2 =
Important fixes for multi-step forms: the Next button no longer stalls without explanation, and entries are no longer kept in localStorage. Update recommended.

= 2.1.1 =
Listing and link updates only. Safe to update.

= 2.1.0 =
New: one-click MW WP Form migration wizard, plus more robust encrypted-data handling.

= 2.0.5 =
Minor update. Adds a Free vs Pro overview to the plugin dashboard.

= 2.0.4 =
Front-end step labels and messages are now translatable (previously always Japanese regardless of site language).

= 2.0.3 =
Admin UI is now English by default with a bundled Japanese translation.

= 2.0.2 =
Minor update. Adds a dismissible review request on the plugin's own screens.

= 2.0.1 =
Adds the Input -> Confirm -> Complete 3-step progress display. Recommended update.

= 2.0.0 =
All built-in features are now fully functional with no limits. Recommended update.
