Anonymous Messages
A powerful WordPress plugin that enables site visitors to send anonymous messages through a customizable Gutenberg block with advanced spam protection, user management, and comprehensive admin features.
by Hadi Alahmad · github.com/hadealahmad/anonymous-messages · 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/hadealahmad/anonymous-messages/archive/refs/heads/main.zipAnonymous Messages for WordPress
A WordPress plugin that enables site visitors to send anonymous messages through a customizable Gutenberg block with advanced spam protection, user management, and comprehensive admin features.
🚀 Features
🎯 Core Features
- Modular Gutenberg Form Builder: Leverage rearrangeable sub-blocks (InnerBlocks) to build, delete, style, and reorder input textareas, upload triggers, action buttons, and lists of answered questions.
- Full Styling Controls: Customize colors, border properties, typography sizing, margins, and padding of the parent block and inner controls natively within Gutenberg.
- Native Custom Post Type & Taxonomy Architecture: Message records, categorization terms, replies, and image uploads are saved as standard WordPress CPT items (
anonymous_message), custom taxonomies, standard post content, and media attachments. - Anonymous Messaging: Visitors can send messages without revealing their identity.
- Image Uploads: Allow users to attach images to their messages.
📱 Frontend
- Instant Search: Real-time search functionality
- Live Filtering: Combine search with category filtering
- Responsive Design: Mobile-friendly interface
⚙️ Dashboard
- Message Management: View, respond to, and manage all messages
- Multiple Response Types: Short text answers – Full WordPress posts
- Status Management: Message states: pending, answered, and featured
- Export: Export messages with filtering options
- Email Notifications: Get email alerts for new messages (sent to assigned user or site admin)
- Admin Bar Counter: See pending messages at a glance (frontend & backend, with red badge)
👥 User Management
- User-specific Inbox: Messages from specific forms can be assigned to specific WordPress users
🛡️ Security
- Google reCAPTCHA v3: Invisible CAPTCHA for spam protection
- Rate Limiting: Configurable cooldown periods between messages (default: 60 seconds)
- Honeypot Protection: Hidden fields to catch automated bots
- Input Sanitization: Comprehensive data validation and cleaning
- Nonce Verification: CSRF protection for all admin actions
🏷️ Category System
- Category Filtering: Visitors can filter answered questions by category
🔧 Integration
- Use existing post types as the designated post type for responses
- Theme Integration: Special styling for Blocksy theme using theme formats directly
🌍 Internationalization
- Translation Ready: Full multilingual support
- POT Files: Translation template included
- Arabic Translation: Complete Arabic translation included
- RTL Support: Right-to-left language compatibility
📋 Requirements
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- MySQL: 5.7 or higher
- Google reCAPTCHA: API keys required for spam protection
🛠️ Installation
Method 1: Upload Plugin
- Download the plugin files
- Upload the
anonymous-messagesfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Configure your settings in Anonymous Messages > Settings
Method 2: WordPress Admin
- Go to Plugins > Add New in your WordPress admin
- Upload the plugin zip file
- Activate the plugin
- Configure your settings
⚙️ Configuration
1. Google reCAPTCHA Setup
- Visit Google reCAPTCHA
- Register your site for reCAPTCHA v3
- Copy your Site Key and Secret Key
- Go to Anonymous Messages > Settings
- Enter your reCAPTCHA credentials
2. Basic Settings
- Rate Limiting: Set the cooldown period between submissions
- Messages Per Page: Configure pagination for answered questions
- Categories: Enable/disable the category system
- Featured Messages: Allow marking messages as featured
3. Post Answer Configuration
Choose how you want to handle detailed responses:
- Existing Post Type: Use WordPress posts or pages
- Custom Post Type: Create a dedicated "Anonymous Answers" post type
- Disabled: Only allow short text responses
4. Image Upload Settings
- Enable Image Uploads: Allow users to attach images
- Max Image Size: Set the maximum file size for uploads
- Max Images Per Message: Limit the number of images per submission
- Allowed Image Types: Define accepted image formats (e.g., JPG, PNG, GIF)
📝 Usage
Adding the Block
- Edit any page or post
- Add a new block and search for "Anonymous Messages"
- Configure the block settings:
- Show/hide category filtering
- Show/hide answered questions section
- Set questions per page
- Enable/disable reCAPTCHA
- Assign to specific user (if configured)
- Enable/disable email notifications for the assigned user
Block Attributes
showCategories: Display category filter for answered questionsshowAnsweredQuestions: Show the answered questions sectionquestionsPerPage: Number of questions per pageenableRecaptcha: Enable reCAPTCHA protectionassignedUserId: Assign messages to specific usersenableEmailNotifications: Send an email notification to the assigned userplaceholder: Custom placeholder textenableImageUploads: Allow image attachments in the block
Managing Messages
- Go to Anonymous Messages > Messages
- View all submitted messages and their attachments
- Respond with short answers or create full posts
- Assign categories and update status
- Mark important messages as featured
Category Management
- Go to Anonymous Messages > Categories
- Create new categories with names and descriptions
- Assign categories to messages from the messages page
- Categories help organize content for visitors
🎨 Customization
CSS Styling
The plugin includes comprehensive CSS for styling:
assets/css/block-style.css- Default stylingassets/css/block-style-blocksy.css- Blocksy theme integrationassets/css/admin-style.css- Admin interface styling
Theme Integration
The plugin automatically detects popular themes and applies appropriate styling. Currently includes special integration for:
- Blocksy theme
- Default WordPress themes
Hooks and Filters
The plugin provides various hooks for customization:
anonymous_messages_before_submissionanonymous_messages_after_submissionanonymous_messages_message_savedanonymous_messages_response_created
🔧 Database Structure
Tables Created
wp_anonymous_messages: Core message storagewp_anonymous_message_categories: Category managementwp_anonymous_message_responses: Message responseswp_anonymous_message_attachments: Image attachment data
Database Versioning
The plugin includes automatic database migration system for updates.
🛡️ Security Features
- Input Validation: All inputs are sanitized and validated
- SQL Injection Prevention: Prepared statements for all database queries
- XSS Protection: Proper output escaping
- CSRF Protection: Nonce verification for all admin actions
- Rate Limiting: Server-side and client-side submission limits
- Capability Checks: Proper permission verification
- Secure File Uploads: Validates file types and sizes on the server
🌐 API Endpoints
AJAX Endpoints
submit_anonymous_message: Handle message submissions (with images)get_answered_questions: Retrieve answered questions with filteringam_respond_to_message: Admin response handlingam_update_message_status: Status updatesam_update_message_category: Category assignment
📊 Performance
- Optimized Queries: Efficient database queries with proper indexing
- AJAX Loading: Minimal page reloads for better user experience
- Debounced Search: Optimized search with 300ms debouncing
- Pagination: Efficient handling of large datasets
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
- Clone the repository
- Set up a local WordPress development environment
- Install the plugin in development mode
- Make your changes and test thoroughly
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Hadi Alahmad
- Website: hadealahmad.com
- GitHub: @hadealahmad
🙏 Acknowledgments
- WordPress community for excellent documentation
- Google reCAPTCHA for spam protection
- All contributors and testers
📈 Changelog
Version 2.0.0
- Added: Modular Gutenberg Form Builder supporting rearrangeable sub-blocks (InnerBlocks).
- Added: Four new customizable block components (
message-textarea,image-uploader,submit-button,questions-list). - Added: Complete styling supports (colors, borders, spacing, typography) inside Gutenberg.
- Added: Standard WordPress Custom Post Type (
anonymous_message) and Taxonomy (anonymous_message_category) data modeling. - Added: Automated data migration pipeline to convert legacy database tables to native WordPress structures on plugin load.
Version 1.2.0
- Added: Image upload functionality for messages
- Added: Admin settings for image uploads (size, type, count)
- Added: Email notifications for new messages
- Added: Admin bar counter for pending messages
- Improved: Full plugin internationalization
- Fixed: Recaptcha badge now only appears where the block is present
Version 1.1.1
- fixed: Recaptcha Integration
Version 1.1.0
- Email Notification
- Dashboard Notification
Version 1.0.1
- better readme
- fixed: blocksy mobile version display issue
Version 1.0.0
- Initial release
- Core messaging functionality
- Gutenberg block integration
- Admin management system
- Security features implementation
- Multilingual support
- User assignment system
- Advanced category management
For more information, visit the plugin homepage