Google Review Incentive for WooCommerce
Encourages customers to leave Google reviews by offering one-time coupon codes after order completion
by Ahmad Wael · github.com/devwael/google-review-incentive · website
★ 0stars
0forks
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/devwael/google-review-incentive/archive/refs/heads/master.zipReadme
Google Review Incentive for WooCommerce
Version: 1.0.0
Author: Ahmad Wael
Website: www.bbioon.com
Requires: WordPress 5.8+, WooCommerce 5.0+, PHP 7.4+
Description
A professional WordPress/WooCommerce plugin that encourages customers to leave Google reviews by offering one-time coupon codes after order completion.
Features
- ✅ Custom review link in order completion emails
- ✅ One-time incentive system (prevents duplicate usage)
- ✅ Automatic coupon generation with customer restrictions
- ✅ Scheduled email delivery using WooCommerce Action Scheduler
- ✅ Secure nonce-protected links
- ✅ Comprehensive admin settings panel
- ✅ Full WooCommerce integration
- ✅ WordPress coding standards compliant
- ✅ PSR-2 compliant code
- ✅ Comprehensive logging
Installation
- Upload the
google-review-incentivefolder to/wp-content/plugins/ - Activate the plugin through the WordPress admin
- Go to WooCommerce → Review Incentive
- Configure your settings:
- Enter your Google Place ID (required)
- Set coupon type and amount
- Customize email content
- Adjust timing settings
Finding Your Google Place ID
- Search for your business on Google Maps
- Click "Share" → "Embed a map"
- Copy the Place ID from the embed code (starts with "ChIJ")
File Structure
google-review-incentive/
├── google-review-incentive.php # Main plugin file
├── README.md
├── uninstall.php
├── includes/
│ ├── class-google-review-incentive.php
│ ├── class-activator.php
│ ├── class-deactivator.php
│ ├── admin/
│ │ ├── class-admin-menu.php
│ │ └── class-admin-settings.php
│ └── public/
│ ├── class-email-handler.php
│ ├── class-review-link-handler.php
│ ├── class-coupon-generator.php
│ └── class-customer-tracker.php
└── assets/
├── css/
│ └── admin-styles.css
└── js/
└── admin-scripts.js
Workflow
- Order Completed → WooCommerce sends order completion email
- Custom Link Added → Plugin adds review link to email
- Customer Clicks → Link tracked with nonce verification
- Coupon Generated → Unique code with customer restrictions
- Email Scheduled → Action Scheduler queues email (default: 1 hour)
- Google Redirect → Customer redirected to Google Reviews
- Email Sent → Follow-up email with coupon code
- One-Time Use → System prevents duplicate usage
Settings
General Settings
- Enable/Disable coupon generation
- Google Place ID
- Review link text
Coupon Settings
- Coupon type (percentage, fixed cart, fixed product)
- Coupon amount
- Validity period (days)
Email Settings
- Email delay (minutes)
- Email subject
- Email content (supports {coupon_code} placeholder)
Security Features
- Nonce verification on all links
- User meta tracking to prevent duplicates
- Email-restricted coupons
- One-time usage limits
- Input sanitization and validation
Developer Hooks
Filters
// Customize coupon code format
add_filter( 'gri_coupon_code_format', function( $code, $customer_id ) {
return 'CUSTOM-' . $code;
}, 10, 2 );
// Modify Google review URL
add_filter( 'gri_google_review_url', function( $url, $place_id ) {
return add_query_arg( 'utm_source', 'email', $url );
}, 10, 2 );
Actions
// After review link click
add_action( 'gri_after_review_link_click', function( $customer_id, $order_id ) {
// Custom tracking
}, 10, 2 );
// After coupon generation
add_action( 'gri_after_coupon_generated', function( $coupon_code, $customer_id ) {
// Custom logic
}, 10, 2 );
Troubleshooting
Emails Not Sending
Check Action Scheduler: WooCommerce → Status → Scheduled Actions
Review Link Not Working
- Verify Google Place ID is valid
- Check link hasn't expired (24 hours)
- Ensure customer hasn't clicked before
Coupons Not Applying
- Verify email matches customer email
- Check coupon hasn't been used
- Ensure coupon hasn't expired
Requirements
- WordPress 5.8 or higher
- WooCommerce 5.0 or higher
- PHP 7.4 or higher
Changelog
1.0.0
- Initial release
- Core functionality
- Admin settings panel
- Email customization
- Coupon generation
- Action Scheduler integration
License
GPL-2.0+
Support
For support, please visit www.bbioon.com
Credits
Developed by Ahmad Wael
Following WordPress and WooCommerce coding standards