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

dev-master 2025-12-06 23:45 UTC

This package is auto-updated.

Last update: 2025-12-06 23:45:30 UTC


README

WordPress Plugin Version WordPress PHP License

A fully functional WordPress plugin that displays a customizable top bar with optional countdown timer and advanced scheduling capabilities.

Topbar Countdown Notice Banner

๐Ÿ“‹ Table of Contents

โœจ 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)

  1. Log in to your WordPress admin panel
  2. Navigate to Plugins > Add New
  3. Search for "Topbar Countdown Notice"
  4. Click Install Now and then Activate

Manual Installation

  1. Download the latest release from GitHub
  2. Upload the topbar-countdown-notice folder to /wp-content/plugins/
  3. Activate the plugin through the Plugins menu in WordPress
  4. Go to Settings > Topbar Countdown to configure

Via Composer

composer require antikton/topbar-countdown-notice

๐Ÿš€ Usage

Quick Start

  1. Activate the Plugin: Go to Settings > Topbar Countdown
  2. Enable the Bar: Check "Activate Bar" in General Settings
  3. Add Content: Enter your message in the "Main Content" field
  4. Configure Countdown (Optional): Enable countdown timer and set target date
  5. Customize Appearance: Choose colors and padding to match your theme
  6. 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

Active Countdown Bar Example of the top bar with active countdown timer showing urgency for a limited-time offer

Alternative Content (After Expiration)

Alternative Content Example of alternative content displayed after the countdown expires

Admin Settings Panels

1. General & Schedule Settings

General Settings Configure activation status and scheduling options for when the bar should appear

2. Content & Countdown Settings

Content Settings Set up your main content, call-to-action buttons, and countdown timer configuration

3. Action on Finish Settings

Finish Action Settings Define what happens when the countdown ends - hide bar or show alternative content

4. Appearance Settings

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:

  1. Hide the bar - The bar disappears automatically
  2. 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:

๐Ÿ“ 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_textdomain function
  • 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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:

๐Ÿ“„ 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)

Made with โค๏ธ for the WordPress community

If you find this plugin useful, please consider: