Contact Enquiry Manager
A WordPress plugin to save contact enquiries in database and manage them easily from admin dashboard.
by Shubham · github.com/shubhamchoudharyshubh/my_crud_form_plugin
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/shubhamchoudharyshubh/my_crud_form_plugin/archive/refs/heads/main.zipReadme
Contact Enquiry Manager Plugin
Purpose
This plugin displays a contact enquiry form on the frontend using a shortcode. It saves enquiries in the database and allows admins to view, delete, and manage settings.
Shortcode
[contact_enquiry_form]
Add this shortcode to any WordPress page to display the enquiry form.
Folder Structure
My_CRUD_Form_Plugin/
│
├── my-crud-form-plugin.php
├── uninstall.php
│
├── includes/
│ ├── frontend-form.php
│ ├── admin-enquiries.php
│ └── settings.php
│
└── assets/
├── css/
│ └── frontend.css
│
└── js/
├── frontend.js
└── admin.js
File Details
my-crud-form-plugin.php
Main plugin file that contains the plugin header, activation, deactivation, and database table creation. It also loads other plugin files and enqueues frontend and admin assets.
includes/frontend-form.php
Creates the frontend enquiry form using the [contact_enquiry_form] shortcode.
It validates, sanitizes, saves form data, and shows success or error messages.
includes/admin-enquiries.php
Creates the Enquiries admin menu and displays saved enquiries in a table. It also handles secure enquiry deletion using nonce and permission checks.
includes/settings.php
Creates the plugin settings page using the WordPress Settings API. It manages the form title, success message, and admin notification email.
assets/css/frontend.css
Adds basic styling to the frontend enquiry form, inputs, button, and messages. It loads only on pages containing the enquiry form shortcode.
assets/js/frontend.js
Handles frontend form behaviour when the user submits an enquiry. It disables the submit button and changes its text to prevent duplicate submissions.
assets/js/admin.js
Adds a confirmation popup before an admin deletes an enquiry. It stops the delete request when the admin clicks Cancel.
uninstall.php
Runs when the plugin is deleted from the WordPress dashboard. It removes the custom database table and all plugin settings permanently.
Main Features
- Frontend contact enquiry form
- Shortcode support
- Custom database table
- Admin enquiry list
- Secure delete option
- Plugin settings page
- Nonce verification
- Input validation and sanitization
- Safe output escaping
- Frontend and admin CSS/JS
- Uninstall cleanup