Skip to content

ufukart/Comment-Approved-Notifier-Extended

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comment Approved Notifier Extended

WordPress Plugin Version WordPress Compatibility PHP Version License

🎯 Zero bloat, single purpose plugin - Automatically send beautiful email notifications when WordPress comments are approved.

📖 Description

Comment Approved Notifier Extended is a lightweight WordPress plugin designed with a single focus: notify comment authors instantly when their comments are approved. No bloat, no unnecessary features—just one thing done exceptionally well.

✨ Why Choose This Plugin?

  • 🎯 Single Purpose - Does ONE thing perfectly: sends approval notifications
  • 🪶 Zero Bloat - No unnecessary features or performance overhead
  • 🔒 Security First - Built following WordPress security best practices
  • 📱 Responsive Emails - Beautiful HTML templates with dark mode support
  • 🌍 Translation Ready - Fully internationalized with .pot file
  • ⚡ Lightning Fast - Minimal database queries, optimized code
  • 👨‍💻 Developer Friendly - Clean, well-documented code

🚀 Features

Email Notifications

  • Automatic notifications when comments are approved
  • Customizable subject and body with shortcodes
  • Professional, responsive HTML email template
  • Dark mode support for better user experience

Security

  • Email validation with is_email()
  • Nonce verification for all form submissions
  • Data sanitization (sanitize_text_field(), wp_kses_post())
  • Output escaping for XSS prevention
  • ABSPATH security checks
  • Error logging for debugging

Customization

  • 6 available shortcodes for personalization
  • HTML support in email body
  • Easy-to-use admin interface
  • Click-to-copy shortcode sidebar

Performance

  • Loads admin assets only on settings page
  • No frontend resources loaded
  • Minimal database queries
  • Efficient hook usage

📦 Installation

Via WordPress Admin

  1. Go to Plugins > Add New
  2. Search for "Comment Approved Notifier Extended"
  3. Click Install Now, then Activate
  4. Navigate to Settings > Comment Approved Notifier
  5. Customize your email template
  6. Save and test!

Manual Installation

# Download and extract
cd wp-content/plugins/
wget https://downloads.wordpress.org/plugin/comment-approved-notifier-extended.zip
unzip comment-approved-notifier-extended.zip
rm comment-approved-notifier-extended.zip

# Or clone from GitHub
git clone https://github.com/yourusername/comment-approved-notifier-extended.git

Then activate via WordPress admin.

🎨 Available Shortcodes

Use these shortcodes in your email subject and body:

Shortcode Description Example Output
[commentauthor] Comment author's name John Doe
[commentedposttitle] Post title "10 Best WordPress Plugins"
[commentaddress] Direct link to comment https://yoursite.com/post#comment-123
[commentcontent] Comment text "Great article! Thanks for sharing..."
[blogname] Your site name My Awesome Blog
[blogurl] Your site URL https://yoursite.com

Example Email Template

Subject:

Your comment on [commentedposttitle] has been approved!

Body:

Dear [commentauthor],

Your comment has been approved for the following post:
[commentedposttitle]

You can view your comment at:
[commentaddress]

Your comment:
[commentcontent]

Thank you for contributing to our discussion!

Best regards,
[blogname]
[blogurl]

⚙️ Configuration

Basic Setup

  1. Navigate to Settings > Comment Approved Notifier
  2. Customize the Email Subject using shortcodes
  3. Customize the Email Body (HTML supported)
  4. Click Save Changes
  5. Approve a test comment to verify!

SMTP Configuration (Recommended)

For better email deliverability, use an SMTP plugin:

Debugging

Enable WordPress debug logging to see error messages:

// In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Check logs at: wp-content/debug.log

🔧 Technical Details

Requirements

  • WordPress: 5.0 or higher
  • PHP: 5.6 or higher (tested up to PHP 8.5)
  • MySQL: 5.6 or higher

Hooks Used

// When comment status changes from unapproved to approved
add_action('comment_unapproved_to_approved', 'cane_send_email');

File Structure

comment-approved-notifier-extended/
├── comment-approved-notifier-extended.php  # Main plugin file
├── readme.txt                              # WordPress.org readme
├── README.md                               # GitHub readme
├── assets/
│   ├── css/
│   │   └── admin.css                       # Admin styles
│   └── js/
│       └── admin.js                        # Admin scripts
├── templates/
│   └── email-template-1.php                # Email HTML template
└── lang/
    └── comment-approved-notifier-extended.pot  # Translation template

WordPress Coding Standards

This plugin follows WordPress Coding Standards:

  • ✅ Proper sanitization and validation
  • ✅ Nonce verification
  • ✅ Data escaping
  • ✅ Internationalization
  • ✅ Security best practices
  • ✅ PHPDoc documentation

🌍 Translation

The plugin is fully translatable:

  1. Use the .pot file in /lang/ directory
  2. Create translations with Poedit or Loco Translate
  3. Save as comment-approved-notifier-extended-{locale}.po

Text Domain: comment-approved-notifier-extended

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone repository
git clone https://github.com/yourusername/comment-approved-notifier-extended.git
cd comment-approved-notifier-extended

# Install WordPress Coding Standards
composer install

# Check code standards
phpcs --standard=WordPress comment-approved-notifier-extended.php

# Fix code standards automatically
phpcbf --standard=WordPress comment-approved-notifier-extended.php

📝 Changelog

Version 5.4

  • ✨ Enhanced code documentation with PHPDoc blocks
  • ✨ Better error handling and logging
  • ✨ Consistent escape function usage
  • 🔒 Added capability checks in admin page
  • 🔒 Improved nonce error messages
  • 🎨 Better code formatting and WordPress standards compliance
  • ⚡ More efficient array declarations
  • 🔒 Fixed XSS vulnerability
  • ✨ Added email validation
  • ✨ Added error logging
  • ✨ Settings link in plugin list
  • 🎨 Modern card-based admin UI
  • ⚡ Better template handling

Version 5.3

  • 🔒 Fixed XSS vulnerability

View full changelog

❓ FAQ

Does this work with all comment types?

No, it only sends notifications for actual comments. Trackbacks and pingbacks are excluded to prevent unnecessary emails.

Can I customize the email design?

Yes! The email body supports HTML. For advanced customization, modify templates/email-template-1.php.

Will this work with my SMTP plugin?

Absolutely! This plugin uses WordPress's native wp_mail() function, compatible with all SMTP plugins.

Does this slow down my site?

No. The plugin is extremely lightweight with zero bloat. It only loads when needed.

Is this GDPR compliant?

The plugin only uses email addresses already stored in WordPress comments. No additional data is collected.

📄 License

This project is licensed under the GPL v2 or later - see the LICENSE file for details.

Copyright (C) 2024 UfukArt

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

🙏 Credits

  • Original Author: yakuphan
  • Current Maintainer: UfukArt
  • Email Template: Based on responsive HTML email best practices

📞 Support

Need help? Have a feature request?

☕ Donate

If you find this plugin useful, consider supporting development:

Donate


Made with ❤️ by UfukArt

⭐ If you find this plugin useful, please give it a star on GitHub! ⭐

About

Comment Approved Notifier sends an e-mail to your commenters when you approve their comments. It is a very simple plugin. There are no settings, options. It starts to work when you activate it.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages