=== Nepa Forms Builder ===
Contributors: khanalsaroj083
Tags: contact form, form builder, ajax form, custom form, email notifications
Requires at least: 5.8
Tested up to: 7.1
Stable tag: 2.2.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight, AJAX-powered WordPress contact form builder with a visual drag-and-drop editor, submission management, and email notifications.

== Description ==

**Nepa Forms Builder** is a powerful yet lightweight WordPress contact form plugin. It lets you build fully custom forms using a visual editor, embed them anywhere using shortcodes, and manage every submission from a clean admin dashboard — all without writing a single line of code.

**Key Features:**

* **Visual 3-Column Form Builder** — Drag-and-drop fields (Text, Email, Textarea, Select Dropdown, Radio, Checkboxes, Phone, URL, Number, Date) with live canvas and settings inspector.
* **Multi-Column Layouts** — Freely arrange form fields into 1 Column (100%), 2 Columns (50%), 3 Columns (33%), or 4 Columns (25%) with seamless mobile responsiveness.
* **9 Designer Themes** — Choose between Default (Modern Glass), Material Design, Minimalist, Neo-Brutalist, Soft Pill, Classic Outline, Glassmorphism, Neumorphism, and Floating Line.
* **Granular Color Customization** — Custom color pickers for Primary Accent, Text, Field Background, Label/Placeholder, Submit Button, and Form Background.
* **Live Popup Preview** — Instant modal preview of your form layout and styling in the editor and from the forms list.
* **Form Import & Export** — Export form templates as JSON (single or bulk) and easily import them onto any site.
* **Honeypot Anti-Spam** — Built-in invisible honeypot protection blocks spam bots without frustrating CAPTCHAs.
* **Shortcode Integration** — Embed any form on any page, post, or widget using `[nepa_form id="X"]`.
* **AJAX Submissions** — Forms submit seamlessly without page reloads.
* **Submission Management** — Dedicated admin dashboard to view, mark read/unread, search, filter, and bulk delete submissions.
* **CSV & PDF Export** — Export submissions to CSV or download professionally formatted PDF reports.
* **Email Notifications** — Receive beautifully styled HTML email notifications for every new inquiry.
* **Secure by Default** — Built strictly to WordPress.org guidelines with nonces, capability checks, and prepared SQL statements.
* **Clean Uninstall** — All custom tables and options are removed upon deletion.

== Installation ==

1. Upload the `nepa-forms-builder` folder to the `/wp-content/plugins/` directory, or install it directly through the WordPress Plugins screen.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to the **Nepa Forms Builder** menu item in the admin panel.
4. Click **New Form** to open the form builder and add your desired fields.
5. Copy the shortcode shown in the Form Builder List (e.g., `[nepa_form id="1"]`).
6. Paste the shortcode into any page, post, or widget to display the form.

== Frequently Asked Questions ==

= How do I embed a form on my page? =

Use the shortcode `[nepa_form id="X"]` where `X` is the form ID displayed in the Form Builder List. You can add this shortcode to any page, post, or text widget.

= Can I customize the form colors? =

Yes. Each form has its own **Primary Theme Color** setting inside the form editor. The color is applied to the form border, labels, and the submit button, making it easy to match your site's brand.

= How do I export submissions? =

Go to **Inquiry Entries**, select your form from the dropdown, and then click the **Export CSV** button in the page header. A CSV file containing all submissions for that form will be downloaded immediately.

= What field types does the plugin support? =

Nepa Forms Builder supports the following field types: **Text**, **Email**, **Textarea**, **Dropdown Select**, **Checkboxes**, and **Radio Buttons**. Each field can be marked as required or optional.

= Where is my submission data stored? =

All submission data is stored securely in your WordPress database in a dedicated custom table (`wp_nepa_submissions`). No data is sent to any external server.

= Does the plugin work with page builders like Elementor or Divi? =

Yes. Because Nepa Forms Builder uses standard WordPress shortcodes, the `[nepa_form id="X"]` shortcode works in any page builder that supports shortcode rendering.

= Will the plugin data be deleted if I uninstall it? =

Yes. When you delete the plugin from the WordPress Plugins screen (not just deactivate it), all custom database tables and stored options are permanently removed for a clean uninstall.

== Screenshots ==

1. The main Nepa Forms Builder admin dashboard showing submission statistics.
2. The visual form builder editor with drag-and-drop field ordering.
3. The Inquiry Entries page showing submission cards with read/unread status.
4. A live contact form rendered on the frontend with custom accent color.

== Changelog ==

= 2.2.0 =
* Feature: Added visual 3-column builder layout (Toolbox, Canvas, Field Inspector).
* Feature: Added multi-column field widths (1 Column 100%, 2 Columns 50%, 3 Columns 33%, 4 Columns 25%) with automatic responsive mobile stacking.
* Feature: Added 9 beautifully designed themes (Default Modern Glass, Material Design, Minimalist, Neo-Brutalist, Soft Pill, Classic Outline, Glassmorphism, Neumorphism, Floating Line).
* Feature: Added granular color customization (Text, Field Background, Labels/Placeholders, Submit Button, Form Background).
* Feature: Added live modal popup preview in both form builder and form list screens with auto-refresh on theme changes.
* Feature: Added form template import and export (JSON) supporting single form and bulk export.
* Feature: Added bulk delete management for form entries and form templates.
* Security: Added built-in honeypot anti-spam protection for all frontend contact forms.
* Fix: Fixed form_id handling in frontend AJAX submissions.
* Performance: Optimized database version checking to prevent redundant table checks on every page load.

* Fix: Replaced all `phpcs:ignore` annotations on multi-line SQL queries with `phpcs:disable`/`phpcs:enable` blocks so every interpolated line is properly suppressed.
* Fix: Restructured `submissions.php` pagination queries to pre-build prepared SQL strings, eliminating `UnescapedDBParameter` and `ReplacementsWrongNumber` warnings.
* Fix: Wrapped PDF export queries in `nepa-forms-builder.php` with `phpcs:disable`/`phpcs:enable` blocks.

= 2.1.1 =
* Fix: Resolved all WordPress Plugin Check tool warnings for WordPress.org submission compliance.
* Fix: Normalized line endings (CRLF to LF) in all included FPDF library font files.
* Fix: Added direct file access protection (`ABSPATH` guard) to all FPDF font files.
* Fix: Updated `phpcs:disable`/`phpcs:enable` annotations on multi-line SQL queries to correctly suppress per-line sniff warnings.
* Improvement: Bumped `Tested up to` value to WordPress 7.0.

= 2.1.0 =
* Security: Added capability checks to all admin AJAX handlers.
* Security: Added JSON structure validation for form field configurations.
* Fix: Select dropdown fields now correctly respect the required attribute.
* Fix: Dashboard color picker no longer has duplicate name attributes.
* Fix: Corrected a duplicate label in the success message setting field.
* Improvement: Refactored submission queries into a single query builder.
* Improvement: Added a version constant for consistent asset versioning.
* Improvement: Extracted email notification builder into a reusable helper function.
* Improvement: Added accessibility enhancements (reduced motion support, focus-visible styles, keyboard navigation).
* Improvement: Added an unsaved changes warning in the form builder editor.
* Database: Added an `updated_at` column to the forms table.

= 2.0.0 =
* Upgraded to a dynamic visual form builder.
* Added support for custom option fields (Dropdowns, Checkboxes, Radio Buttons).

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.2.0 =
Major update: multi-column widths, 9 designer themes, live popup previews, custom colors, form import/export, honeypot spam protection, and WordPress.org Plugin Check compliance.

= 2.1.0 =
This release includes important security improvements. All users are strongly encouraged to upgrade immediately.
