=== FormLedger – Entries for Contact Form 7 ===
Contributors: chiraglad23
Tags: contact form 7, contact form 7 db, form entries, database, csv export
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Save every Contact Form 7 submission to your WordPress database. View, search, filter and export entries to CSV, even when the email fails.

== Description ==

**FormLedger saves every Contact Form 7 submission to your WordPress database**, so you never lose an enquiry again, even when the notification email fails or lands in spam. Just install and activate it: every new submission appears under **Contact → CF7 Entries**, ready to read, search and export.

Contact Form 7 only sends submissions by email and does not keep a copy. FormLedger adds the missing Contact Form 7 database (CF7 DB) inside your own WordPress site. No setup, no limits, no external services.

**Requires Contact Form 7.** FormLedger is an add-on for Contact Form 7, which must be installed and active. WordPress will ask you to install Contact Form 7 first if it is missing.

= How to use =

1. Install and activate Contact Form 7 and FormLedger.
2. Submit any Contact Form 7 form on your site.
3. Go to **Contact → CF7 Entries** to see the entry.
4. Filter by form or date, search, open an entry, or click **Export all to CSV**.

= Features =

**Save every submission**

* Automatically stores every successful Contact Form 7 submission in the database
* Keeps the entry even when mail sending fails
* Unlimited forms and unlimited entries
* Supports text, email, tel, textarea, number, URL, date, select, checkbox, radio, acceptance, hidden, quiz and file fields

**Find entries fast**

* Clean entries list with pagination, sorting and screen options
* Search across entry ID, form title, field names and field values
* Filter by form (including deleted forms)
* Filter by date: today, yesterday, last 7 days, last 30 days, this month, last month or a custom date range
* Read / unread status with bulk mark as read or unread

**View, export and manage**

* Detailed entry screen with every submitted field, clickable email, phone and website links
* Export all, filtered or selected entries to CSV (opens in Excel and Google Sheets), UTF-8 encoded, with protection against spreadsheet formula injection
* Uploaded files are copied to a protected folder and can be downloaded securely from the entry screen
* Delete entries one at a time or in bulk

**Privacy and security**

* IP addresses are not collected; browser user agent storage is optional and off by default
* Works with the WordPress personal data export and erase tools
* Only administrators can see entries by default
* **Multisite compatible**: each site in the network stores and manages its own form entries separately
* Translation ready

= Privacy =

FormLedger stores form submissions in your own WordPress database. Nothing is sent to external services, and there is no tracking.

* Stores what visitors enter in your forms, any uploaded files, and the page the form was submitted from.
* IP addresses are not collected. Browser user agent storage is optional and off by default.
* Delete entries one at a time or in bulk whenever you like.
* Works with the WordPress personal data export and erase tools (Tools → Export Personal Data / Erase Personal Data).
* Adds suggested text to your privacy policy guide (Settings → Privacy).

This plugin does not by itself make your site compliant with GDPR or any other law. You remain responsible for your own privacy policy and how long you keep data.

== Installation ==

1. Install and activate Contact Form 7 (required).
2. Upload the `formledger` folder to `/wp-content/plugins/`, or install the plugin from Plugins → Add New.
3. Activate **FormLedger**.
4. Submit any Contact Form 7 form. The entry appears under **Contact → CF7 Entries**.
5. Review the privacy options under **Contact → Entry Settings**.

== Frequently Asked Questions ==

= Does it work without Contact Form 7? =

No. Contact Form 7 is required. On WordPress 6.5 and later, FormLedger cannot be activated until Contact Form 7 is installed and active, and Contact Form 7 cannot be deactivated while FormLedger is active.

If Contact Form 7 goes missing anyway, FormLedger shows a notice with a one-click Install or Activate button. Your existing entries stay safe and viewable.

= Where can I find my Contact Form 7 entries? =

In your WordPress admin under **Contact → CF7 Entries**. Click **View** to open an entry, or use the form and date filters to narrow the list.

= Can I export entries to Excel? =

Yes. Click **Export all to CSV**, or select entries and choose the export bulk action. The CSV file opens directly in Excel, Google Sheets and Numbers. Your current filters are applied to the export.

= Are old submissions saved from before I installed FormLedger? =

No. Contact Form 7 does not keep submissions, so FormLedger can only save entries submitted after it is activated.

= Are spam submissions stored? =

No. Entries are captured after Contact Form 7 has completed validation and its spam checks.

= Is anything stored if the email fails to send? =

Yes. Entries are saved just before Contact Form 7 sends mail, so a failed email does not mean a lost submission.

= What happens when I delete or rename a form? =

Entries are never deleted with their form. For deleted forms, the original title is shown with a "(deleted form)" label. For renamed forms, the entry screen also shows the title it was submitted under.

= Who can see entries and uploaded files? =

Only administrators, by default. To give access to another role (for example, Editors), grant it the `manage_cf7_entries` capability using a role editor plugin. Only administrators can change the plugin settings.

Uploaded files are stored privately and can only be downloaded by logged-in users who can see entries.

= Can I back up entries before removing the plugin? =

Yes. When "Delete all data when the plugin is deleted" is on, clicking Deactivate opens a dialog that offers to download all entries as a CSV file (opens in Excel) before you continue. WordPress only allows deleting a plugin after it is deactivated, so this is the last point where the plugin can offer a backup.

= What happens when I deactivate or delete the plugin? =

Deactivating keeps all data. Deleting the plugin also keeps all data, unless you enable **Delete all data when the plugin is deleted** under Contact → Entry Settings.

= Does it support multisite? =

Yes. Each site has its own entries, files and settings. Network activation sets up every site, and new sites are set up automatically.

== Screenshots ==

1. Entries list with form, date and status filters.
2. Single entry screen with all submitted fields and attachments.
3. Privacy, uploaded files and uninstall settings.

== Changelog ==

= 1.0.2 =
* Fixed: On MySQL 8 servers the entries list stayed empty and CSV export failed, even though submissions were saved. All entries now show.

= 1.0.1 =
* Changed: IP address storage and automatic retention (scheduled deletion of old entries) have been removed from the free plugin. They are planned for the separate FormLedger Pro add-on.
* Changed: Settings page now shows Privacy, Uploaded files and Uninstall sections, and the overview shows total entries and stored files.
* Changed: Contact Form 7 is now a declared required plugin. WordPress asks you to install it before FormLedger can be activated.
* Changed: Minimum WordPress version is now 6.5.
* Improved: Clear notice with an Install or Activate Contact Form 7 button whenever Contact Form 7 is missing.
* Changed: Readme reorganised and FAQ simplified.
* Note: no entries are deleted by this update. The old daily cleanup task is removed automatically.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.2 =
Fixes an empty entries list on MySQL 8 servers. Your saved entries appear again after updating.

= 1.0.1 =
Contact Form 7 is now required, and WordPress 6.5 or later is needed. IP address storage and automatic deletion of old entries are no longer part of the free plugin. No entries are deleted by this update.

= 1.0.0 =
Initial release.
