feat: helper text for 'visits' metric#966
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds helper text and tooltip functionality to clarify the 'visits' metric in the Optimole dashboard. It provides users with better understanding of how visits are counted and when their quota resets.
- Adds tooltip with explanation of what constitutes a visit and renewal date information
- Displays renewal date next to the usage percentage
- Introduces new translatable strings for the tooltip content and renewal date format
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| inc/admin.php | Adds new translatable strings for tooltip title, description, and renewal date format |
| assets/src/dashboard/parts/connected/dashboard/index.js | Implements tooltip UI component with visit explanation and adds renewal date display |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const renewalDate = useMemo( () => { | ||
| const timestamp = userData.renews_on; | ||
|
|
||
| if ( ! timestamp ) { | ||
| return 'N/A'; | ||
| } | ||
|
|
||
| const date = new Date( timestamp * 1000 ); | ||
| return date.toLocaleDateString( undefined, { year: 'numeric', month: 'short', day: 'numeric' }); | ||
| }, [ userData.renews_on ]); |
There was a problem hiding this comment.
The hardcoded 'N/A' fallback should be a translatable string since this text will be displayed to users and the codebase appears to use internationalization throughout.
|
🎉 This PR is included in version 4.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Added clarity for ‘visits’ metric with helper text and renewal info

Closes https://github.com/Codeinwp/optimole-service/issues/1544
Other information: