PHPackages                             shazzad/wp-admin-notice - 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. shazzad/wp-admin-notice

ActiveWordpress-library[Utility &amp; Helpers](/categories/utility)

shazzad/wp-admin-notice
=======================

Library to add &amp; display admin notices in WordPress

1746PHP

Since Jul 25Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

WP Admin Notice
===============

[](#wp-admin-notice)

Helper class to display admin notices.

Installation
------------

[](#installation)

```
composer require shazzad/wp-admin-notice
```

Initialization
--------------

[](#initialization)

Initialize the service provider.

```
\Shazzad\WpAdminNotice\Provider::setup();
```

Adding notice.
--------------

[](#adding-notice)

Call the function `do_action` with appropriate parameter to add a notice. This code must be placed before wp admin area start rendering content on screen. Use `admin_notices`, `all_admin_notices` or `network_admin_notices` action hook to add notice.

```
do_action(
	'swpan_notice',
	array(
		'success' => __('You setting is stored successfully.'),
		'id'      => 'plugin-setting',
	)
);

do_action(
	'swpan_notice',
	array(
		'error' => __('Sorry, we could not save your settings.'),
	)
);
```

Adding user notice.
-------------------

[](#adding-user-notice)

Use user notice when you perform some action and redirect the user to a page. The notice will be stored for until it is displayed to the user. Add a third parameter to the action hook to add a user notice.

```
do_action(
	'swpan_notice',
	array(
		'message' => __('You setting is stored successfully.'),
		'type'    => 'success',
		'id'      => 'my-notice-id',
	),
	'user'
);

do_action(
	'swpan_notice',
	array(
		'message' => __('Sorry, we could not save your settings.'),
		'type'    => 'error',
		'id'      => 'my-notice-id',
	),
	'user'
);
```

### Requirements

[](#requirements)

- WordPress: 6.0.1
- PHP: 7.4
- Tested: 6.2.2

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?d=identicon)[shazzad](/maintainers/shazzad)

---

Top Contributors

[![shazzad](https://avatars.githubusercontent.com/u/2789126?v=4)](https://github.com/shazzad "shazzad (6 commits)")

---

Tags

wordpress-library

### Embed Badge

![Health badge](/badges/shazzad-wp-admin-notice/health.svg)

```
[![Health](https://phpackages.com/badges/shazzad-wp-admin-notice/health.svg)](https://phpackages.com/packages/shazzad-wp-admin-notice)
```

###  Alternatives

[aneeshikmat/yii2-time-down-counter

Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library

1546.0k](/packages/aneeshikmat-yii2-time-down-counter)[optimistdigital/nova-resizable

Simple Laravel Nova tool to enable column resizing

1818.9k](/packages/optimistdigital-nova-resizable)[haruncpi/laravel-simple-captcha

A laravel simple captcha package

1128.3k](/packages/haruncpi-laravel-simple-captcha)

PHPackages © 2026

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