OZD Simple Contact Form
A lightweight, modular and extensible contact form plugin for WordPress, built with OOP and modern WordPress coding standards.
by Sadık Özdoğan · github.com/sadikozdogan/ozd-simple-contact-form · website
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/sadikozdogan/ozd-simple-contact-form/archive/refs/heads/main.zipOZD Simple Contact Form is a small, modular WordPress contact form plugin intended as a clean example project for GitHub. It stores messages as a private custom post type, sends optional notification emails, and lets administrators reply from the WordPress dashboard.
Highlights
- Object-oriented, modular architecture.
- Namespaced PHP code using
OZD\\Simple_Contact_Form. - Public shortcode:
[ozd_contact_form]. - Private message storage using a custom post type and post meta.
- Nonce and capability checks for form and admin actions.
- Sanitized input and escaped output.
- Translatable user-facing strings with the
ozd-simple-contact-formtext domain. - Bundled
languages/directory and POT template. - Separate assets for public/admin CSS and admin JavaScript.
- WordPress Coding Standards configuration for PHPCS/PHPCBF.
- PHPCompatibilityWP checks for PHP 8.1 through PHP 8.4.
- GitHub Actions quality workflow.
- Optional data cleanup on uninstall.
Requirements
- WordPress 6.6 or later.
- PHP 8.1 or later.
- PHP 8.4 compatible.
Installation
- Download or build the plugin ZIP.
- In WordPress, go to Plugins > Add New > Upload Plugin.
- Upload the ZIP and activate OZD Simple Contact Form.
- Add
[ozd_contact_form]to a post or page. - Configure notification and reply settings under Contact Form > Settings.
Project Structure
ozd-simple-contact-form/
├── admin/ Admin UI and actions
├── assets/ CSS, JavaScript, and future images
├── includes/ Core services and plugin coordinator
├── languages/ Translation template/files
├── public/ Public form and submission handler
├── templates/ Public/admin view templates
├── tests/ Lightweight package contract tests
├── uninstall.php Optional cleanup on deletion
└── ozd-simple-contact-form.php
Development
Install development dependencies:
composer install
Check WordPress coding standards:
composer lint
Automatically fix PHPCBF-fixable issues:
composer format
Check PHP compatibility:
composer compatibility
Run the package smoke test:
php tests/smoke.php
Data Storage
Messages are stored using the private ozd_scf_message custom post type. Sender details are stored in prefixed post meta. Plugin settings are stored in the ozd_scf_settings option.
By default, uninstalling the plugin does not remove saved messages. Administrators can enable Delete Data on Uninstall before deleting the plugin if permanent cleanup is wanted.
Extension Hooks
The plugin provides hooks intended for future extension without editing core files:
ozd_scf_submission_dataozd_scf_notification_recipientozd_scf_notification_subjectozd_scf_notification_bodyozd_scf_reply_subjectozd_scf_reply_messageozd_scf_reply_headersozd_scf_message_createdozd_scf_reply_sent
Translation
Source strings are written in English and use the ozd-simple-contact-form text domain. The translation template is located at languages/ozd-simple-contact-form.pot.
License
OZD Simple Contact Form is licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later).
Copyright (C) 2026 Sadık Özdoğan.
Website: https://www.sadikozdogan.com