PHPackages                             ignitekit/wp-notices - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ignitekit/wp-notices

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ignitekit/wp-notices
====================

Easy to use dashboard notices manager for WordPress

1.0.2(4y ago)268911GPL-2.0-or-laterPHPPHP &gt;=5.3

Since Feb 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/IgniteKit/wp-notices)[ Packagist](https://packagist.org/packages/ignitekit/wp-notices)[ RSS](/packages/ignitekit-wp-notices/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (1)

WP Notices
==========

[](#wp-notices)

Easy to use notices management library for WordPress that implements [WordPress notices](https://developer.wordpress.org/reference/hooks/admin_notices/)

The library creates all the necessary stuff and ajax handling for dismissing the notices and also offers manual dismissing through code.

Quick Start
-----------

[](#quick-start)

### 1. How to install the library

[](#1-how-to-install-the-library)

```
composer require ignitekit/wp-notices

```

### 2. How to use `NoticesManager` class

[](#2-how-to-use-noticesmanager-class)

The class `IgniteKit\WP\Notices\NoticesManager` is the one that need to be used in order to add new notices as follows:

```
use IgniteKit\WP\Notices\NoticesManager;

class My_Plugin_Bootstrap() {

    private $notices_manager;

    public function __construct() {
        // Create instance of NoticesManager annd pass some custom identifier / prefix here.
        $this->notices_manager = new NoticesManager('myplugin');
        add_action('init', array($this, 'init'));
    }

    public function init() {

        // Eg. Add error notice if Woocommerce is not installed.
        if( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {

            // Returns instance of IgniteKit\WP\Notices\Notice
            $notice = $this->notices_manager->add_error( 'missing_wc', 'WooCommerce not installedPlease install WooCommerce in order to use My Plugin', NoticesManager::DISMISS_FOREVER );

            // Methods available in Notice
            var_dump($notice->id); // The notice ID
            var_dump($notice->is_dismissed()); // True or false
            var_dump($notice->dismiss()); // Dismisses the notice
            var_dump($notice->reset()); // Resets the notice. Removes the dismissed status.
        }

        // Somewhere later you can use this to retrieve the error notice you added before...
        // ...apply some logic.
        $notice = $this->notices_manager->get_notice('missing_wc', 'error');
        $notice->reset(); // Then maybe reset it?
        $notice->dismiss(); // Somewhere later, maybe dismiss again?
    }
}
```

### 3. List of methods available in `NoticesManager` for adding notices.

[](#3-list-of-methods-available-in-noticesmanager-for-adding-notices)

There are several methods available in the `IgniteKit\WP\Notices\NoticesManager` for adding notices.

Every mehtod of those returns `IgniteKit\WP\Notices\Notice` instance. This is basically the notice class.

#### Method add\_success()

[](#method-add_success)

```
/**
 * Add success notice. Displayed with greeen border.
 *
 * @param $key
 * @param $message - html of the notice
 * @param string|int $expiry - Specifes how much time the notice stays disabled.
 *
 * Expiry parameter can be: NoticesManager::DISMISS_FOREVER, NoticesManager::DISMISS_DISABLED or number of seconds)
 *
 * @return Notice
 */
public function add_success( $key, $message, $expiry );
```

#### Method add\_error()

[](#method-add_error)

```
/**
 * Add error notice. Displayed with red border.
 *
 * @param string $key - unique identifier
 * @param string $message - html of the notice
 * @param string|int $expiry - Specifes how much time the notice stays disabled.
 *
 * Expiry parameter can be: NoticesManager::DISMISS_FOREVER, NoticesManager::DISMISS_DISABLED or number of seconds)
 *
 * @return Notice
 */
public function add_error( $key, $message, $expiry );
```

#### Method add\_info()

[](#method-add_info)

```
/**
 * Add info notice. Displayed with blue border.
 *
 * @param string $key - unique identifier
 * @param string $message - html of the notice
 * @param string|int $expiry - Specifes how much time the notice stays disabled.
 *
 * Expiry parameter can be: NoticesManager::DISMISS_FOREVER, NoticesManager::DISMISS_DISABLED or number of seconds)
 *
 * @return Notice
 */
public function add_info( $key, $message, $expiry );
```

#### Method add\_warning()

[](#method-add_warning)

```
/**
 * Add warning notice. Displayed with orange border.
 *
 * @param string $key - unique identifier
 * @param string $message - html of the notice
 * @param string|int $expiry - Specifes how much time the notice stays disabled.
 *
 * Expiry parameter can be: NoticesManager::DISMISS_FOREVER, NoticesManager::DISMISS_DISABLED or number of seconds)
 *
 * @return Notice
 */
public function add_warning( $key, $message, $expiry );
```

#### Method add\_custom()

[](#method-add_custom)

```
/**
 * Add custom notice. Displayed with gray border.
 *
 * @param string $key - unique identifier
 * @param string $message - html of the notice
 * @param string|int $expiry - Specifes how much time the notice stays disabled.
 *
 * Expiry parameter can be: NoticesManager::DISMISS_FOREVER, NoticesManager::DISMISS_DISABLED or number of seconds)
 *
 * @return Notice
 */
public function add_custom( $key, $message, $expiry );
```

#### Method get\_notice\_by\_id()

[](#method-get_notice_by_id)

```
/**
 * Return the notice object
 *
 * @param $id
 *
 * @return Notice|null
 */
public function get_notice_by_id( $id )
```

#### Method get\_notice()

[](#method-get_notice)

```
/**
 * Return notice by key and type
 *
 * @param $key
 * @param $type
 *
 * @return Notice|null
 */
public function get_notice( $key, $type );
```

### 4. List of methods available in `Notice` instance that is returned after notice is added.

[](#4-list-of-methods-available-in-notice-instance-that-is-returned-after-notice-is-added)

There are several methods available in the `IgniteKit\WP\Notices\Notice` class. You can manually dismiss or reset the notice, also check if the notice is dismissed.

#### Method is\_dismissed()

[](#method-is_dismissed)

```
/**
 * Check if notice is dismissed.
 *
 * @return bool
 */
public function is_dismissed()
```

#### Method dismiss()

[](#method-dismiss)

```
/**
 * Dismisses the notice
 */
public function dismiss()
```

#### Method reset()

[](#method-reset)

```
/**
 * Removes notice dismissal flag. After this call the notice is not dismissed anymore.
 */
public function reset()
```

### 5. File templates

[](#5-file-templates)

The plugin supports file templates instead of simple string messages.

To display notice from a file template, you can provide a path to it with the `file://` prefix as follows:

```
file:///home/site.com/public_html/wp-content/themes/my-theme/templates/my-notice.php

```

License
-------

[](#license)

```
Copyright (C) 2021 Darko Gjorgjijoski (https://darkog.com)

This file is part of WP Notices

WP Notices 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.

WP Notices 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.

You should have received a copy of the GNU General Public License
along with WP Notices. If not, see .

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~140 days

Total

3

Last Release

1626d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/092968da21d868077ffac225d195f167f19435d61409f8ec656136c6f3d6f197?d=identicon)[gdarko](/maintainers/gdarko)

---

Top Contributors

[![gdarko](https://avatars.githubusercontent.com/u/5760249?v=4)](https://github.com/gdarko "gdarko (5 commits)")

### Embed Badge

![Health badge](/badges/ignitekit-wp-notices/health.svg)

```
[![Health](https://phpackages.com/badges/ignitekit-wp-notices/health.svg)](https://phpackages.com/packages/ignitekit-wp-notices)
```

###  Alternatives

[hillholliday/craft-user-manual

Craft User Manual allows developers (or even content editors) to provide CMS documentation using Craft's built-in sections (singles, channels, or structures) to create a `User Manual` or `Help` section directly in the control panel.

8472.1k1](/packages/hillholliday-craft-user-manual)[laravolt/semantic-form

Semantic UI form helpers

5213.0k2](/packages/laravolt-semantic-form)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
