Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ashutoshpalhare/smartcontacthub/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A clean, modern contact form plugin for WordPress. It sends messages by email, can open a WhatsApp chat after submission, and includes basic spam protection. The form submits without reloading the page and works on mobile and desktop.
Features
- Shortcode: place the form anywhere with
[smart_contact_hub]. - AJAX submission: no page reload, with a loading state and clear success or error messages.
- Email notifications: sent with
wp_mail(), with the visitor set as the reply-to address. - WhatsApp redirect: optional "Continue on WhatsApp" button after success, with the message pre-filled.
- Admin settings page: Settings > Smart Contact Hub, built on the WordPress Settings API.
- Spam protection: a hidden honeypot field catches simple bots.
- Security: nonces, input sanitization, output escaping, and capability checks.
- Performance: styles and scripts load only on pages that use the shortcode.
- No dependencies: no external CSS frameworks, no external requests.
Requirements
- WordPress 5.8 or higher
- PHP 7.4 or higher
Installation
- Copy the
smart-contact-hubfolder towp-content/plugins/, or zip it and upload it from Plugins > Add New > Upload Plugin. - Activate Smart Contact Hub from the Plugins screen.
- Open Settings > Smart Contact Hub and configure the options below.
- Add the shortcode
[smart_contact_hub]to a page or post.
Settings
| Setting | Description |
|---|---|
| Recipient Email | Address that receives new messages. Defaults to the site admin email. |
| Success Message | Text shown to the visitor after a successful submission. |
| WhatsApp Number | Number with country code and digits only, for example 919876543210. |
| Enable WhatsApp Button | When set to Yes, shows a WhatsApp button after submission. |
| Form Title | Heading displayed above the form. |
Usage
[smart_contact_hub]
The form includes Name, Email, Phone (optional), Subject, and Message fields. Name, Email, Subject, and Message are required.
How It Works
- The visitor fills in the form. The browser checks required fields first.
- The form is sent to WordPress over AJAX, with a nonce for verification.
- The server checks the honeypot, validates and sanitizes the data, and emails it to the recipient.
- The visitor sees the success message. If WhatsApp is enabled, a button opens a chat with their message pre-filled.
Project Structure
smart-contact-hub/
├── smart-contact-hub.php Main plugin file, settings helpers, bootstrap
├── uninstall.php Removes settings when the plugin is deleted
├── includes/
│ ├── class-sch-admin.php Settings page and settings API registration
│ ├── class-sch-frontend.php Shortcode, asset loading, AJAX handler
│ └── class-sch-email.php Email composition and wp_mail() delivery
├── assets/
│ ├── css/frontend.css Form styles
│ └── js/frontend.js AJAX submission and UI states
├── readme.txt WordPress.org plugin readme
└── README.md Project documentation
Security Notes
- Every AJAX request is checked against a nonce.
- All input is sanitized on the server, and email header values are stripped of line breaks to prevent header injection.
- Admin settings are restricted to users with the
manage_optionscapability. - Output is escaped with WordPress escaping functions.
Roadmap Ideas
- Rate limiting per IP address
- Optional CAPTCHA integration
- Admin copy of submissions stored in the database
License
GPL-2.0-or-later. See the GNU General Public License.
Author
Ashutosh Palhare