welcome banner for first 48 hours #355
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR implements a transient-based system for the WelcomeBanner component that shows it only for first-time visitors or if 48 hours have passed since it was last shown. The banner can also be manually dismissed by users. Additionally, the banner width has been increased from
lgtoxlto better utilize the available space and provide a more prominent welcome experience.Type of Change
Production
Development
Video
Checklist
Further comments
Welcome Banner Width Decision
Initially, the entire width of the container was
lg. There were three possible iterations for the welcome banner width:xlwidth - This would create an inconsistent layout with the welcome banner being wider than other componentsI chose the third option as it provides the best user experience by making better use of the available screen real estate while maintaining visual hierarchy. The welcome banner is a key component that users see first, so giving it more prominence makes sense from a UX perspective.
Technical Implementation
The transient system uses WordPress's built-in transient API with a 48-hour expiration period. The banner automatically shows for first-time visitors and reappears after 48 hours if not manually dismissed. Users can manually close the banner using the X button in the top-right corner, which sets the transient and immediately hides the banner.
The implementation includes:
SettingsController.phpWelcomeBanner.jsTesting
To test the functionality:
window.testWelcomeBanner()in browser consoleThe system creates minimal database impact with WordPress automatically cleaning up expired transients.