Awesome Support Reply Limit
Limits the character count for Awesome Support reply forms with real-time validation and visual feedback.
by SPARKWEB Studio · github.com/spkcd/as-reply-limit · 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/spkcd/as-reply-limit/archive/refs/heads/main.zipA WordPress plugin that limits the character count for Awesome Support reply forms with real-time validation and visual feedback.
Plugin URI: https://sparkwebstudio.com
Author: SPARKWEB Studio
Version: 1.0.0
License: GPL v2 or later
Description
The Awesome Support Reply Limit plugin provides character count limitations for support ticket replies, ensuring concise and manageable communication between customers and support teams. The plugin features both frontend JavaScript validation with real-time feedback and backend PHP validation for security.
Features
✨ Frontend Features
- Real-time character counting with visual countdown
- Progressive color feedback (gray → orange → red)
- Smart form detection for Awesome Support forms
- Prevents typing beyond limit while allowing navigation keys
- Handles paste operations with automatic truncation
- Form submission blocking when limit is exceeded
- Visual flash warnings when attempting to exceed limit
- Mobile responsive design
🛡️ Backend Features
- Server-side validation as security fallback
- Admin bypass capability for administrators and editors
- Detailed error messages with character count information
- WP_Error integration with Awesome Support error handling
🎨 Styling Features
- Professional CSS styling that integrates with WordPress themes
- Dark theme support via CSS media queries
- Responsive design for mobile devices
- Smooth animations and transitions
- Multiple visual states for different character count levels
Requirements
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- Awesome Support Plugin: Any compatible version
- Modern browser with JavaScript enabled (for frontend features)
Installation
See INSTALL.md for detailed installation instructions.
Quick Installation
- Download the plugin files
- Upload to
/wp-content/plugins/awesome-support-reply-limit/ - Activate the plugin through WordPress admin
- The plugin works automatically on pages with Awesome Support forms
Usage
Automatic Detection
The plugin automatically detects Awesome Support forms using multiple methods:
- Shortcode detection:
[supportcandy],[wpas_submit_ticket],[awesome_support], etc. - Page slug detection: Pages named 'support', 'tickets', 'submit-ticket', etc.
- Plugin class detection: Checks for active Awesome Support installations
- DOM element detection: Scans for support form elements in the page
Character Limit
- Default limit: 500 characters
- Warning threshold: 400 characters (80% of limit)
- Admin bypass: Administrators and editors can exceed the limit
- Configurable: Can be modified in the plugin code
Visual Feedback States
- Normal (0-400 chars): Gray text - "X characters remaining"
- Warning (401-499 chars): Orange text - "X characters remaining"
- Limit reached (500 chars): Red bold text - "Character limit reached!"
- Over limit: Red highlighted box with error message
Technical Details
File Structure
awesome-support-reply-limit/
├── awesome-support-reply-limit.php # Main plugin file
├── assets/
│ ├── css/
│ │ └── reply-limit.css # Frontend styles
│ └── js/
│ └── reply-limit.js # Frontend functionality
├── README.md # This file
├── CHANGELOG.md # Version history
└── INSTALL.md # Installation guide
Hooks & Filters
Actions
init- Initialize plugin and load text domainwp_enqueue_scripts- Enqueue frontend assetswp_footer- Add DOM detection script
Filters
wpas_before_reply_insert- Backend validation hookasrl_should_enqueue_scripts- Override script enqueuing logic
JavaScript API
The plugin exposes the following JavaScript object:
window.asrlData = {
maxChars: 500,
warningThreshold: 400,
messages: {
charactersRemaining: 'characters remaining',
characterLimit: 'Character limit reached!',
overLimit: 'You have exceeded the character limit by'
}
};
CSS Classes
.asrl-character-countdown- Base counter element.asrl-warning- Warning state (approaching limit).asrl-limit-reached- Limit reached state.asrl-over-limit- Over limit state.asrl-error-message- Form submission error message
Customization
Modifying Character Limit
To change the character limit, edit the $max_chars property in the main plugin file:
private $max_chars = 750; // Change from 500 to 750
Custom CSS
You can override the default styles by adding CSS to your theme:
.asrl-character-countdown {
font-size: 14px;
color: #333;
}
.asrl-character-countdown.asrl-warning {
color: #f39c12;
}
Extending Functionality
Use the provided filter to customize when scripts are loaded:
add_filter('asrl_should_enqueue_scripts', function($should_enqueue) {
// Custom logic here
return $should_enqueue;
});
Browser Support
- Chrome: 60+
- Firefox: 55+
- Safari: 12+
- Edge: 79+
- Mobile browsers: iOS Safari 12+, Chrome Mobile 60+
Troubleshooting
Plugin Not Working
- Check Awesome Support is active and functioning
- Clear browser cache and WordPress caches
- Check browser console for JavaScript errors
- Verify page has support forms using browser developer tools
Character Counter Not Appearing
- Check if scripts are loading in browser Network tab
- Try different Awesome Support shortcodes or page setups
- Check for JavaScript conflicts with other plugins
- Enable WordPress debug mode to see PHP errors
Backend Validation Not Working
- Check user permissions - admins bypass validation
- Verify Awesome Support hooks are available
- Check error logs for PHP errors
- Test with different user roles
Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes with proper documentation
- Test thoroughly
- Submit a pull request
Support
For support and questions:
- Website: https://sparkwebstudio.com
- Email: support@sparkwebstudio.com
- Documentation: See INSTALL.md for setup help
License
This plugin is licensed under the GPL v2 or later.
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Credits
Developed by SPARKWEB Studio - Professional WordPress Development
Last updated: December 2024