antikton / topbar-countdown-notice
A fully functional WordPress plugin that displays a customizable top bar with optional countdown timer and advanced scheduling capabilities. Perfect for sales, events, announcements, and revealing discount coupons.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:wordpress-plugin
pkg:composer/antikton/topbar-countdown-notice
Requires
- php: >=7.4
- composer/installers: ^1.0 || ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- wp-coding-standards/wpcs: ^3.0
This package is auto-updated.
Last update: 2025-12-06 23:45:30 UTC
README
A fully functional WordPress plugin that displays a customizable top bar with optional countdown timer and advanced scheduling capabilities.
๐ Table of Contents
- Features
- Installation
- Usage
- Configuration
- Screenshots
- Frequently Asked Questions
- Development
- Changelog
- Contributing
- Support
- License
โจ Features
Core Features
- ๐ Global Top Bar: Easily display a notification bar across your entire WordPress site
- ๐ Flexible Scheduling: Set start and end dates/times for automatic bar display
- โฑ๏ธ Countdown Timer: Drive urgency with a countdown timer targeting a specific date
- ๐ Alternative Content: Show different content when the timer finishes (e.g., reveal discount coupons, announce sale start, or show "Offer Ended" messages)
- ๐จ Full Customization: Complete visual control over colors, padding, and styling
- ๐ Rich Content Editor: Use the familiar WordPress editor for your bar's content
- ๐ฑ Mobile Responsive: Fully responsive design that works on all devices
- ๐ฏ Action Buttons: Add clickable call-to-action buttons with custom links
Advanced Features
- Custom Countdown Target: Choose between end date or a custom target date
- Alternative Colors: Set different colors for expired content
- Custom CSS Support: Add your own CSS for advanced styling
- Debug Mode: Built-in debugging for troubleshooting
- Translation Ready: Full i18n support with text domain
- WordPress Standards: Follows WordPress coding standards and best practices
๐ฆ Installation
From WordPress.org (Recommended)
- Log in to your WordPress admin panel
- Navigate to Plugins > Add New
- Search for "Topbar Countdown Notice"
- Click Install Now and then Activate
Manual Installation
- Download the latest release from GitHub
- Upload the
topbar-countdown-noticefolder to/wp-content/plugins/ - Activate the plugin through the Plugins menu in WordPress
- Go to Settings > Topbar Countdown to configure
Via Composer
composer require antikton/topbar-countdown-notice
๐ Usage
Quick Start
- Activate the Plugin: Go to Settings > Topbar Countdown
- Enable the Bar: Check "Activate Bar" in General Settings
- Add Content: Enter your message in the "Main Content" field
- Configure Countdown (Optional): Enable countdown timer and set target date
- Customize Appearance: Choose colors and padding to match your theme
- Save Changes: Click "Save Changes" to activate your top bar
Common Use Cases
1. Limited Time Sale
โ
Activate Bar: ON
๐
Start Date: 2024-01-15 00:00
๐
End Date: 2024-01-20 23:59
โฑ๏ธ Countdown: ON (Target: End Date)
๐ Content: "๐ฅ Flash Sale! 50% OFF Everything!"
๐ Link: /shop/sale
๐จ Colors: Red background, White text
2. Event Announcement
โ
Activate Bar: ON
๐
Start Date: (empty - always show)
๐
End Date: 2024-02-14 18:00
โฑ๏ธ Countdown: ON (Target: End Date)
๐ Content: "Join our Valentine's Day Webinar!"
๐ Link: /register
3. Maintenance Notice
โ
Activate Bar: ON
๐
Start Date: 2024-01-10 22:00
๐
End Date: 2024-01-11 02:00
โฑ๏ธ Countdown: OFF
๐ Content: "โ ๏ธ Scheduled maintenance tonight 10 PM - 2 AM"
๐จ Colors: Orange background, Black text
4. Countdown to Promotion Start + Reveal Coupon
โ
Activate Bar: ON
๐
Start Date: 2024-01-10 00:00
๐
End Date: 2024-01-15 23:59
โฑ๏ธ Countdown: ON (Target: End Date)
๐ Content: "๐ New Year Sale starts soon!"
๐ Link: /shop
๐ฏ Action on Finish: Show alternative content
๐ Alternative Text: "๐ Sale is LIVE! Use code: NEWYEAR2024 for 30% OFF"
๐ Alternative Link: /shop/sale
๐จ Alternative Colors: Green background, White text
Perfect for building anticipation before a sale starts, then revealing the discount code once it begins
โ๏ธ Configuration
General Settings
| Setting | Description |
|---|---|
| Activate Bar | Toggle to show/hide the top bar globally |
Scheduling
| Setting | Description |
|---|---|
| Start Date/Time | When the bar should start appearing (leave empty for immediate) |
| End Date/Time | When the bar should stop appearing (leave empty for permanent) |
Bar Content
| Setting | Description |
|---|---|
| Main Content | The primary message displayed in the bar (supports HTML) |
| Main Link | Optional URL for the call-to-action button |
| Main Link Button Text | Text displayed on the CTA button (default: "Learn More") |
| Open in New Tab | Whether the link opens in a new browser tab |
Countdown Timer
| Setting | Description |
|---|---|
| Activate Countdown | Enable/disable the countdown timer |
| Countdown Target | Choose between "End Date" or "Custom Date" |
| Custom Target Date/Time | Set a specific countdown target (if Custom is selected) |
| Countdown Prefix Text | Text displayed before the countdown (e.g., "Ends in:") |
| Show Seconds | Display seconds in the countdown timer |
Action on Finish
| Setting | Description |
|---|---|
| When End Date/Time is Reached | Choose to hide bar or show alternative content |
| Alternative Text | Message shown when countdown/schedule ends |
| Alternative Link | Optional URL for alternative content |
| Alternative Link Button Text | Text for alternative CTA button |
| Alternative Colors | Use same colors or set custom colors for expired state |
| Alternative Background Color | Background color for expired content |
| Alternative Text Color | Text color for expired content |
Appearance
| Setting | Description |
|---|---|
| Background Color | Bar background color (default: #2c3e50) |
| Text Color | Bar text color (default: #ffffff) |
| Padding Top | Top padding in pixels (default: 12px) |
| Padding Bottom | Bottom padding in pixels (default: 12px) |
| Padding Left | Left padding in pixels (default: 20px) |
| Padding Right | Right padding in pixels (default: 20px) |
| Custom CSS | Add custom CSS for advanced styling |
| Debug Mode | Enable console logging for troubleshooting |
Available CSS Classes
Use these classes in your Custom CSS field:
.tcn-topbar /* Main bar container */ .tcn-topbar-inner /* Inner content wrapper */ .tcn-content /* Main content area */ .tcn-countdown-wrapper /* Countdown container */ .tcn-countdown-prefix /* Countdown prefix text */ .tcn-countdown /* Countdown timer */ .tcn-link /* Action button/link */
๐ธ Screenshots
Frontend Display
Active Countdown Bar
Example of the top bar with active countdown timer showing urgency for a limited-time offer
Alternative Content (After Expiration)
Example of alternative content displayed after the countdown expires
Admin Settings Panels
1. General & Schedule Settings
Configure activation status and scheduling options for when the bar should appear
2. Content & Countdown Settings
Set up your main content, call-to-action buttons, and countdown timer configuration
3. Action on Finish Settings
Define what happens when the countdown ends - hide bar or show alternative content
4. Appearance Settings
Customize colors, padding, and add custom CSS for advanced styling
โ Frequently Asked Questions
Can I use this for a scheduled sale?
Yes! Set the Start Date/Time to when your sale begins and the End Date/Time to when it ends. Enable the countdown to target the End Date for maximum urgency.
What happens when the countdown ends?
You have two options:
- Hide the bar - The bar disappears automatically
- Show alternative content - Replace with a new message (e.g., "This offer has expired")
Is it mobile friendly?
Absolutely! The top bar is fully responsive and optimized for all screen sizes, including mobile devices.
Can I reveal a discount code after the countdown ends?
Absolutely! This is a popular use case. Set up a countdown to build anticipation, then use the "Show alternative content" option to reveal your discount code, coupon, or special offer when the timer reaches zero. You can even change the colors to make it stand out! See the "Countdown to Promotion Start + Reveal Coupon" example in the Usage section.
Can I customize the appearance?
Yes! You have complete control over:
- Background and text colors
- Padding (top, bottom, left, right)
- Custom CSS for advanced styling
- Alternative colors for expired content
Does it work with caching plugins?
The plugin uses JavaScript for countdown functionality, which works with most caching plugins. However, for time-sensitive content, you may need to configure your cache to refresh appropriately.
Can I translate the plugin?
Yes! The plugin is fully translation-ready with the text domain topbar-countdown-notice. You can use tools like Loco Translate or create your own .po and .mo files.
How do I remove the bar temporarily?
Simply uncheck "Activate Bar" in the General Settings and save. This will hide the bar without losing your configuration.
Can I show different bars on different pages?
Currently, the plugin displays a single global bar across all pages. Page-specific targeting may be added in future versions.
๐ ๏ธ Development
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Modern browser with JavaScript enabled
File Structure
topbar-countdown-notice/
โโโ assets/
โ โโโ css/
โ โ โโโ admin.css # Admin panel styles
โ โ โโโ frontend.css # Frontend bar styles
โ โโโ js/
โ โโโ admin.js # Admin panel functionality
โ โโโ frontend.js # Frontend countdown logic
โโโ languages/ # Translation files
โ โโโ topbar-countdown-notice.pot
โ โโโ ...
โโโ topbar-countdown-notice.php # Main plugin file
โโโ uninstall.php # Cleanup on uninstall
โโโ readme.txt # WordPress.org readme
โโโ README.md # This file
Hooks & Filters
The plugin provides several hooks for developers:
Actions
// Modify locale for translations add_filter('topbar_countdown_notice_locale', function($locale) { return $locale; }, 10, 2);
Building from Source
# Clone the repository git clone https://github.com/antikton/topbar-countdown-notice.git # Navigate to the plugin directory cd topbar-countdown-notice # Install in WordPress plugins directory cp -r . /path/to/wordpress/wp-content/plugins/topbar-countdown-notice/
Coding Standards
This plugin follows:
- WordPress Coding Standards
- WordPress Plugin Handbook
- Security best practices (sanitization, escaping, nonce verification)
๐ Changelog
Version 1.0.4 (2024-12-07)
Added:
- Professional banner images in multiple sizes for WordPress.org (772x250, 1544x500, 1200x300)
Improved:
- Reorganized assets: moved screenshots and banners to assets/ folder for WordPress.org compliance
- Updated all documentation to reflect new asset structure
Version 1.0.3 (2024-12-07)
Added:
- Composer support with composer.json for Packagist installation
- Upgrade Notice section in readme.txt for WordPress.org
- Donate link support in plugin metadata
Improved:
- Screenshots renamed to WordPress.org standard format (screenshot-1.png, etc.)
- Full WordPress.org readme validator compliance
- Enhanced documentation for coupon reveal use cases
Version 1.0.2 (2024-12-07)
Added:
- Comprehensive README.md documentation for GitHub
- 6 professional screenshots showing frontend and admin panels
- Detailed usage examples and configuration tables
- Developer documentation with hooks and file structure
Improved:
- Enhanced documentation with better organization
- Added visual examples of plugin functionality
Version 1.0.1 (2024-12-06)
Fixed:
- Alternative background color now applies correctly when content expires
- Improved compatibility with WordPress Plugin Check (PCP)
Improved:
- Removed deprecated
load_plugin_textdomainfunction - All outputs properly escaped for security
- Simplified codebase by removing unnecessary hooks
- Hook names now use proper WordPress prefix standards
Version 1.0.0 (2024-11-23)
Initial Release:
- Complete scheduling system
- Countdown timer functionality
- Alternative content display
- Full customization options
- Rich content editor integration
- Mobile responsive design
- Translation ready
๐ค Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Reporting Bugs
Found a bug? Please open an issue with:
- WordPress version
- PHP version
- Plugin version
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
๐ฌ Support
Need help? Here are your options:
- Documentation: Read this README and the WordPress.org plugin page
- Support Forum: WordPress.org Support
- GitHub Issues: Report bugs or request features
๐ License
This plugin is licensed under the GNU General Public License v2.0 or later.
Topbar Countdown Notice - WordPress Plugin
Copyright (C) 2024 Eduardo Pagรกn
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.
๐จโ๐ป Author
Eduardo Pagรกn (@antikton)
- GitHub: https://github.com/antikton
- Plugin URI: https://github.com/antikton/topbar-countdown-notice
Made with โค๏ธ for the WordPress community
If you find this plugin useful, please consider:
- โญ Starring the repository
- ๐ข Sharing with others
- ๐ฌ Leaving a review on WordPress.org
- โ Buying me a coffee (optional)
