Skip to content

mukesh0272/wp-quick-notice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 WP Quick Notice

A lightweight, flexible, and developer-friendly notice bar plugin for WordPress.
Display announcements, alerts, or CTAs at the top or bottom of your site with full control over visibility and behavior.

WordPress PHP License


✨ Features

  • ✅ Enable / Disable notice bar
  • 📍 Position: Top or Bottom
  • 📝 Message supports safe HTML (links, strong, em)
  • 🎨 Custom colors (background, text, CTA)
  • 🔘 Optional CTA button (with new-tab support)
  • ❌ Dismiss options:
    • Session only
    • For N days
    • Forever
  • 🧠 Smart display rules:
    • Entire site / Home / Posts / Pages
    • Include or exclude specific post/page IDs
    • Logged-in users only
    • User role targeting
  • ⚡ Optimized performance (assets load only when needed)
  • 🧩 Developer hooks & filters
  • 🧼 Clean, modern, namespaced OOP architecture

📦 Installation

Option 1: Manual (Recommended for development)

  1. Clone or download this repository:

     git clone https://github.com/mukesh0272/wp-quick-notice.git
    
  2. Move it to:

     wp-content/plugins/wp-quick-notice
    
  3. Run:

     composer dump-autoload
    
  4. Activate WP Quick Notice from WP Admin → Plugins

  5. Configure via Settings → WP Quick Notice

Option 2: ZIP Upload

  1. Download the ZIP from GitHub
  2. Go to WP Admin → Plugins → Add New → Upload Plugin
  3. Upload and activate

⚙️ Usage

  1. Go to Settings → WP Quick Notice
  2. Enable the notice bar
  3. Add your message
  4. Customize position, colors, CTA, and dismiss behavior
  5. Configure display rules
  6. Save — done 🎉

🧩 Developer Hooks

WP Quick Notice is built with extensibility in mind.

Filter options before use

add_filter('wpqn_options', function ($options) {
    $options['position'] = 'bottom';
    return $options;
});

Control visibility dynamically

add_filter('wpqn_should_render', function ($should_render, $options) {
    if (is_page(42)) {
        return false;
    }
    return $should_render;
}, 10, 2);

Modify message HTML

add_filter('wpqn_message_html', function ($html, $options) {
    return $html . '<span class="extra-text"> Limited time!</span>';
}, 10, 2);

🏗️ Project Structure

wp-quick-notice/
├─ assets/
│  ├─ css/
│  └─ js/
├─ src/
│  ├─ Admin/
│  ├─ Frontend/
│  └─ Support/
├─ wp-quick-notice.php
├─ composer.json
├─ README.md
├─ readme.txt
├─ uninstall.php
└─ LICENSE

🛡️ Security

  • Uses WordPress Settings API
  • All inputs sanitized and escaped
  • Safe HTML via wp_kses
  • Capability checks for admin actions

🗺️ Roadmap

  • Shortcode support
  • Gutenberg block
  • REST API integration
  • Multisite support
  • Translation template (.pot)

📄 License

Licensed under the MIT License.


⭐ Support the Project

If you find this plugin useful:

  • Star the repository
  • Report bugs
  • Suggest features

About

A lightweight, customizable notice bar for WordPress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published