This guide covers both URL Contains and Pages (Wildcards) restrictions in the PopMate WHMCS addon module.
1. Overview
PopMate provides two different URL restriction methods that work together to provide precise control over when popups are displayed:
- URL Contains - Simple phrase matching for basic targeting
- Pages (Wildcards) - Advanced wildcard pattern matching for precise targeting
2. URL Contains Restriction
How It Works
- Simple substring matching using
stripos()(case-insensitive) - Single value - one phrase per restriction
- Searches anywhere in the current URL
Syntax
Examples
| URL Contains Setting | Current URL | Result |
|---|---|---|
cart.php |
https://domain.com/cart.php |
✅ SHOW |
cart.php |
https://domain.com/cart.php?promo=SAVE20 |
✅ SHOW |
invoices |
https://domain.com/clientarea.php?action=invoices |
✅ SHOW |
products |
https://domain.com/clientarea.php?action=products&id=123 |
✅ SHOW |
support |
https://domain.com/clientarea.php |
❌ HIDE |
Use Cases
- Simple targeting: Show popup on any page containing "cart.php"
- Keyword matching: Show popup on pages with "invoices" in URL
- Quick setup: Easy to configure for basic needs
3. Pages (Wildcards) Restriction
How It Works
- Advanced pattern matching with wildcard support
- Multiple values separated by commas
- Three types of patterns with different matching logic
Syntax
Pattern Types
A. Wildcard Patterns (*pattern)
- Starts with
*followed by the pattern to match - Matches if the pattern appears anywhere in the URL
- Case-insensitive matching
Examples:
B. Main Page Only (/)
- Special pattern for homepage only
- Universal detection - works on any WHMCS installation
- Matches homepage regardless of installation path
Examples:
C. Exact Page Matching
- No wildcard - exact substring matching
- Works like URL Contains but within the Pages system
Examples
| Pages Setting | Current URL | Result |
|---|---|---|
*action=invoices |
https://domain.com/clientarea.php?action=invoices |
✅ SHOW |
*action=invoices |
https://domain.com/clientarea.php?action=quotes |
❌ HIDE |
*action=invoices, *action=quotes |
https://domain.com/clientarea.php?action=invoices |
✅ SHOW |
*action=invoices, *action=quotes |
https://domain.com/clientarea.php?action=quotes |
✅ SHOW |
/ |
https://domain.com/ |
✅ SHOW |
/ |
https://domain.com/clientarea.php |
❌ HIDE |
cart.php, *action=invoices |
https://domain.com/cart.php |
✅ SHOW |
4. How Both Work Together
Logic
Both restrictions use AND logic:
- If both are set, both must pass for popup to show
- If only one is set, that one must pass
- If neither is set, no URL restriction applies
Example Scenarios
Scenario 1: Both Set
Result: ✅ SHOW (both pass)
Scenario 2: Both Set - One Fails
Result: ❌ HIDE (URL Contains fails)
Scenario 3: Only URL Contains Set
Result: ✅ SHOW (URL Contains passes)
Scenario 4: Only Pages Set
Result: ✅ SHOW (Pages passes)
5. Admin Interface Usage
URL Contains Field
- Type: Single text input
- Placeholder:
e.g., cart.php, invoices, products - Help: "Show popup only on pages containing this text anywhere in the URL (single phrase only)"
Pages Field
- Type: Single text input
- Placeholder:
e.g., *action=invoices, cart.php, / - Help: "Provide specific wildcard URLs where the popup should be available. Use comma to separate multiple pages. Supports: *pattern (wildcard), / (main page), exact (no wildcard)"
6. Best Practices
When to Use URL Contains
- Simple targeting: Basic phrase matching
- Quick setup: Easy to configure
- Single pattern: One specific text to match
When to Use Pages (Wildcards)
- Precise targeting: Specific URL patterns
- Multiple pages: Targeting several related pages
- Complex patterns: Advanced URL matching
- Homepage targeting: Main page only
When to Use Both
- Extra precision: Double-check URL matching
- Fallback logic: URL Contains as backup for Pages
- Complex scenarios: Multiple targeting requirements
7. Real-World Examples
Marketing Campaigns
Service Notifications
Homepage Welcome
Product Promotions
Support Pages
8. Troubleshooting
Common Issues
Issue: Popup not showing on homepage
/ for universal homepage detection