https://github.com/wpdevup/tap-chat
Lightweight WordPress plugin to add a floating WhatsApp click-to-chat button with shortcode, greeting bubble, and country picker.
https://github.com/wpdevup/tap-chat
clicktochat whatsapp wordpress wordpress-plugin
Last synced: 7 months ago
JSON representation
Lightweight WordPress plugin to add a floating WhatsApp click-to-chat button with shortcode, greeting bubble, and country picker.
- Host: GitHub
- URL: https://github.com/wpdevup/tap-chat
- Owner: wpdevup
- License: gpl-2.0
- Created: 2025-09-24T19:45:13.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-11-21T21:17:31.000Z (7 months ago)
- Last Synced: 2025-11-21T23:14:35.414Z (7 months ago)
- Topics: clicktochat, whatsapp, wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 178 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Tap Chat - WordPress Click-to-Chat Plugin
**Version:** 1.4.0 | **Requires:** WordPress 5.8+ | **PHP:** 7.4+
[](https://wordpress.org/plugins/tap-chat/)
[](https://wordpress.org/plugins/tap-chat/)
[](https://www.gnu.org/licenses/gpl-2.0.html)
Lightweight WordPress plugin for adding a professional floating chat button to your website. Connect with visitors instantly through popular messaging platforms with zero configuration complexity.
## π Features
### Core Features
- β¨ **Floating Chat Button** - Beautiful, customizable button that sticks to your site
- π¬ **Welcome Bubble** - Friendly greeting message with Modern & Simple styles
- π― **Smart Triggers** - Show bubble at the perfect moment based on visitor behavior
- π **Country Selector** - 150+ country codes with flags
- β° **Working Hours** - Display button only during business hours
- ποΈ **Page Visibility** - Control where button appears
- π¨ **Fully Customizable** - Colors, sizes, positions, labels
- π± **Mobile Optimized** - Separate mobile/desktop configurations
- π **GDPR Compliant** - Zero tracking, no cookies
- π **Translation Ready** - Fully translatable with .pot file
### Smart Triggers (New in 1.4.0)
Control when the welcome bubble appears based on visitor behavior:
- β±οΈ **Time on Page** - After visitor stays for X seconds (enabled by default, recommended)
- π **Scroll Depth** - When visitor scrolls to X% of page
- πͺ **Exit Intent** - When visitor moves mouse to close tab
- π€ **Idle Detection** - When visitor is inactive for X seconds
**How it works:** When multiple triggers are enabled, the bubble shows when ANY condition is met first. This gives you flexible control over user engagement.
### Welcome Bubble Styles
**Modern Style:**
- Avatar image
- Agent/team name
- Online status indicator
- Positioned above button
**Simple Style:**
- Clean, minimal design
- Message only
- Positioned above or beside button
- Faster configuration
## π¦ Installation
### From WordPress.org
1. Go to **WordPress Dashboard β Plugins β Add New**
2. Search for "**Tap Chat**"
3. Click **Install Now** and then **Activate**
4. Go to **Settings β Tap Chat** to configure
### Manual Installation
1. Download the latest release from [WordPress.org](https://wordpress.org/plugins/tap-chat/)
2. Upload to `/wp-content/plugins/` directory
3. Activate through the **Plugins** menu in WordPress
4. Configure via **Settings β Tap Chat**
### For Developers
```bash
# Clone the repository
git clone https://github.com/wpdevup/tap-chat.git
# Navigate to plugin directory
cd tap-chat
# Link to WordPress plugins directory
ln -s $(pwd) /path/to/wordpress/wp-content/plugins/tap-chat
```
## βοΈ Configuration
### Basic Setup
1. **General Tab:**
- Select country code
- Enter phone number (without country code)
- Customize appearance (color, size, position)
- Set default message and label
2. **Welcome Bubble Tab:**
- Enable welcome bubble
- Choose style (Modern or Simple)
- Customize message, name, avatar
- **Configure smart triggers:**
- Time on Page (default: 3 seconds)
- Scroll Depth (customize percentage)
- Exit Intent (mouse leaves viewport)
- Idle Detection (no activity timeout)
3. **Business Hours Tab:**
- Set working hours per day
- Choose timezone
- Add optional offline message
4. **Visibility Tab:**
- Show on specific pages only
- Hide on specific pages
- Combine rules for precise control
5. **Advanced Tab:**
- Page context appending
- Additional options
### Shortcode Usage
Basic shortcode:
```php
[tapchat]
```
With custom parameters:
```php
[tapchat phone="+1234567890" message="Hello!" label="Contact us"]
```
### Programmatic Usage
```php
// Get plugin instance
$tap_chat = \Tap_Chat\Plugin::instance();
// Hooks available
add_action( 'tapchat_click', 'my_custom_function' );
```
## π― Smart Triggers Usage
### Best Practices
**For E-commerce Sites:**
```
Recommended: Scroll Depth + Exit Intent
- Enable Scroll Depth: 50%
- Enable Exit Intent
```
**For Service/Support Sites:**
```
Recommended: Time on Page (default)
- Enable Time on Page: 3-5 seconds
```
**For High-Traffic Blogs:**
```
Recommended: Scroll Depth + Idle
- Enable Scroll Depth: 30%
- Enable Idle Detection: 30 seconds
```
### Trigger Priority
When multiple triggers are enabled:
1. Whichever condition is met **first** will trigger the bubble
2. Once shown, bubble won't show again in the same session
3. User can manually close bubble at any time
4. Closed bubbles are remembered for the current session only
### Testing Triggers
```javascript
// Clear session storage to reset bubble
sessionStorage.clear();
// Reload page to test triggers again
location.reload();
```
## π¨ Customization
### CSS Customization
Override default styles in your theme:
```css
/* Custom button color */
.tapchat-fab {
--tapchat-color: #your-color !important;
}
/* Custom bubble style */
.tapchat-welcome-bubble {
border-radius: 20px;
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
/* Custom positioning */
.tapchat-fab.tapchat-pos-right {
bottom: 30px;
right: 30px;
}
```
### JavaScript Hooks
```javascript
// Listen for button clicks
jQuery(document).on('click', '.tapchat-fab', function() {
console.log('Tap Chat button clicked!');
});
// WordPress hook (if wp.hooks available)
wp.hooks.addAction('tapchat_click', 'myNamespace', function() {
// Custom tracking or analytics
});
```
## π οΈ Development
### Requirements
- WordPress 5.8 or higher
- PHP 7.4 or higher
- Modern browser with ES6 support
### File Structure
```
tap-chat/
βββ assets/
β βββ css/
β β βββ tapchat.css # Frontend styles
β β βββ admin.css # Admin styles
β βββ js/
β β βββ tapchat.js # Frontend scripts
β β βββ admin.js # Admin scripts
β βββ images/
βββ includes/
β βββ class-tap-chat.php # Main plugin class
β βββ admin/
β βββ class-tap-chat-admin.php # Admin controller
β βββ class-tap-chat-settings.php # Settings handler
β βββ class-tap-chat-fields.php # Field renderer
βββ languages/
β βββ tap-chat.pot # Translation template
βββ tap-chat.php # Plugin entry point
βββ readme.txt # WordPress.org readme
```
### Coding Standards
This plugin follows:
- [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/)
- [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/)
- [WordPress Security Best Practices](https://developer.wordpress.org/plugins/security/)
### Building for Production
```bash
# Run WordPress coding standards check
phpcs --standard=WordPress tap-chat.php includes/
# Check for translation strings
wp i18n make-pot . languages/tap-chat.pot
# Create release package
zip -r tap-chat.zip . -x "*.git*" "node_modules/*" "*.DS_Store"
```
## π§ͺ Testing
### Manual Testing Checklist
- [ ] Button displays correctly on frontend
- [ ] Welcome bubble shows with enabled triggers
- [ ] Smart triggers work as expected (Time, Scroll, Exit, Idle)
- [ ] Country selector works properly
- [ ] Phone number validation works
- [ ] Working hours logic is correct
- [ ] Visibility controls work as expected
- [ ] Mobile responsiveness is good
- [ ] Shortcode works in posts/pages
- [ ] Settings save correctly
- [ ] No JavaScript console errors
- [ ] No PHP errors in debug mode
### Browser Compatibility
Tested and working on:
- β
Chrome/Edge (latest)
- β
Firefox (latest)
- β
Safari (latest)
- β
Mobile Safari (iOS)
- β
Chrome Mobile (Android)
## π Translations
Tap Chat is translation-ready! We welcome translations in all languages.
### How to Translate
1. Download [POEdit](https://poedit.net/)
2. Open `languages/tap-chat.pot`
3. Create translation for your language
4. Save as `tap-chat-{locale}.po` and `tap-chat-{locale}.mo`
5. Submit via [WordPress.org translation system](https://translate.wordpress.org/)
### Available Translations
- π¬π§ English (default)
- π©πͺ German (coming soon)
- πͺπΈ Spanish (coming soon)
- π«π· French (coming soon)
Want to contribute a translation? [Contact us](https://wordpress.org/support/plugin/tap-chat/)!
## π Performance
Tap Chat is optimized for performance:
- **Tiny Footprint:** < 15KB total (CSS + JS)
- **No External Requests:** Everything loads locally
- **Async Loading:** Scripts load asynchronously
- **No jQuery Dependency:** Vanilla JavaScript on frontend
- **Optimized CSS:** Minimal, modern CSS3
- **No Database Queries on Frontend:** Settings cached
### Performance Metrics
- β
GTmetrix Grade: A
- β
Google PageSpeed: 95+/100
- β
Pingdom Speed: A
- β
Load Time: < 50ms
## π Security
Security is our priority:
- β
All inputs sanitized and validated
- β
Nonces for all form submissions
- β
Capability checks for admin actions
- β
SQL injection prevention
- β
XSS attack prevention
- β
CSRF protection
- β
No external dependencies
- β
Regular security audits
Found a security issue? Please report privately to [WordPress.org](https://wordpress.org/support/plugin/tap-chat/)
## π€ Contributing
We welcome contributions! Here's how you can help:
### Ways to Contribute
1. **Code Contributions**
- Fork the repository
- Create a feature branch (`git checkout -b feature/amazing-feature`)
- Commit your changes (`git commit -m 'Add amazing feature'`)
- Push to the branch (`git push origin feature/amazing-feature`)
- Open a Pull Request
2. **Bug Reports**
- Use GitHub Issues
- Provide detailed description
- Include steps to reproduce
- Add screenshots if applicable
3. **Feature Requests**
- Open an issue with [FEATURE] prefix
- Explain the use case
- Describe expected behavior
4. **Documentation**
- Improve README
- Add code comments
- Write tutorials or guides
5. **Translations**
- Translate to your language
- Submit via WordPress.org
### Development Setup
```bash
# Clone repository
git clone https://github.com/wpdevup/tap-chat.git
cd tap-chat
# Create development branch
git checkout -b feature/your-feature-name
# Make changes and test
# Follow WordPress coding standards
phpcs --standard=WordPress .
# Commit with clear message
git commit -m "Add: Description of your changes"
```
## π Changelog
### [1.4.0] - 2025-11-21
**Added:**
- π― Smart Triggers system for welcome bubble
- Time on Page trigger (enabled by default, 3 seconds)
- Scroll Depth trigger (show after X% scroll)
- Exit Intent trigger (show on exit attempt)
- Idle Detection trigger (show after inactivity)
- Improved trigger configuration interface
**Improved:**
- Simplified UX for trigger settings
- Better default settings for new installations (Time on Page auto-enabled)
- Enhanced performance for trigger detection algorithms
- Optimized JavaScript for multiple trigger combinations
**Fixed:**
- Removed duplicate Display Delay field
- Fixed trigger priority when multiple conditions met
- Improved session storage handling for bubble display
- Various minor bug fixes and stability improvements
### [1.3.0] - 2025-08-15
**Added:**
- Welcome Bubble feature with Modern & Simple styles
- Bubble customization options (message, name, avatar)
- Session-based display control
**Improved:**
- Better mobile experience
- Optimized CSS animations
**Fixed:**
- Avatar upload functionality
### [1.2.0] - 2025-06-10
**Added:**
- Business Hours with timezone support
- Page visibility controls
- Offline message option
**Improved:**
- Settings organization with tabs
- Enhanced admin UI
### [1.1.0] - 2025-04-20
**Added:**
- Country selector (150+ countries)
- Separate mobile/desktop controls
- Page context appending
**Improved:**
- Phone number validation
- URL encoding for messages
### [1.0.0] - 2025-03-01
- Initial release
## π License
This project is licensed under the GPL v2 or later.
```
Tap Chat - WordPress Click-to-Chat Plugin
Copyright (C) 2025 iruserwp9
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
- Icons from messaging platform brand resources
- Country flags from Unicode emoji standard
- Developed with β€οΈ by [iruserwp9](https://profiles.wordpress.org/iruserwp9/)
## π Support
Need help? We're here for you!
- π [Documentation](https://wordpress.org/plugins/tap-chat/)
- π¬ [Support Forum](https://wordpress.org/support/plugin/tap-chat/)
- π [Report Bug](https://github.com/wpdevup/tap-chat/issues)
- β¨ [Request Feature](https://github.com/wpdevup/tap-chat/issues)
- β [Rate Plugin](https://wordpress.org/support/plugin/tap-chat/reviews/)
## πΊοΈ Roadmap
### Completed β
- β
Smart Triggers (v1.4.0)
- β
Welcome Bubble (v1.3.0)
- β
Working Hours (v1.2.0)
- β
Country Selector (v1.1.0)
### Coming Soon π
- [ ] Multiple agents support with round-robin
- [ ] Analytics dashboard (privacy-friendly)
- [ ] More bubble styles and animations
- [ ] Pre-chat form integration
- [ ] Quick replies templates
- [ ] Team chat widget
- [ ] A/B testing for triggers
- [ ] Advanced trigger combinations
- [ ] Custom trigger scheduling
## β Show Your Support
If you find this plugin helpful, please:
- β Star this repository
- π Share with others
- βοΈ Write a review on [WordPress.org](https://wordpress.org/support/plugin/tap-chat/reviews/)
- π Report bugs and help improve
---
Made with β€οΈ for the WordPress community
[WordPress.org](https://wordpress.org/plugins/tap-chat/) | [GitHub](https://github.com/yourusername/tap-chat) | [Support](https://wordpress.org/support/plugin/tap-chat/)