PHPackages                             josantonius/wp-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. [Admin Panels](/categories/admin)
4. /
5. josantonius/wp-notice

AbandonedArchivedLibrary[Admin Panels](/categories/admin)

josantonius/wp-notice
=====================

Display notices in WordPress administration panel.

1.0.2(8y ago)464MITPHP

Since Jul 18Pushed 3y ago2 watchersCompare

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

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

PHP WordPress Notice
====================

[](#php-wordpress-notice)

[![Latest Stable Version](https://camo.githubusercontent.com/2af8bcaa6d4f35fed13dd59771052f91026d819d8dd8c15fb271e13dce1023a3/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73616e746f6e6975732f77702d6e6f746963652f762f737461626c65)](https://packagist.org/packages/josantonius/wp-notice)[![License](https://camo.githubusercontent.com/9653346212c5dd50f77770fac50e137c8c40d0f4a3c150e0f7122f24f5865a00/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73616e746f6e6975732f77702d6e6f746963652f6c6963656e7365)](LICENSE)

[Versión en español](README-ES.md)

Display notices in WordPress administration panel.

---

- [Requirements](#requirements)
- [Installation](#installation)
- [Available Methods](#available-methods)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Tests](#tests)
- [Sponsor](#Sponsor)
- [License](#license)

---

Requirements
------------

[](#requirements)

This library is supported by **PHP versions 5.6** or higher and is compatible with **HHVM versions 3.0** or higher.

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

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **WP\_Notice library**, simply:

```
composer require josantonius/wp-notice

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
composer require josantonius/wp-notice --prefer-source

```

You can also **clone the complete repository** with Git:

```
git clone https://github.com/josantonius/wp-notice.git

```

Or **install it manually**:

[Download WP\_Notice.php](https://raw.githubusercontent.com/josantonius/wp-notice/master/src/class-wp-notice.php):

```
wget https://raw.githubusercontent.com/josantonius/wp-notice/master/src/class-wp-notice.php

```

Available Methods
-----------------

[](#available-methods)

Available methods in this library:

### - Generate success notice

[](#--generate-success-notice)

```
WP_Notice::success($message, $dismissable);
```

AtttributeDescriptionTypeRequiredDefault$messageNotice message.stringYes$dismissableDimissable notice.booleanNotrue**@return** (boolean true)

### - Generate warning notice

[](#--generate-warning-notice)

```
WP_Notice::warning($message, $dismissable);
```

AtttributeDescriptionTypeRequiredDefault$messageNotice message.stringYes$dismissableDimissable notice.booleanNotrue**@return** (boolean true)

### - Generate error notice

[](#--generate-error-notice)

```
WP_Notice::error($message, $dismissable);
```

AtttributeDescriptionTypeRequiredDefault$messageNotice message.stringYes$dismissableDimissable notice.booleanNotrue**@return** (boolean true)

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

[](#quick-start)

To use this library with **Composer**:

```
require __DIR__ . '/vendor/autoload.php';

use Josantonius\WP_Notice;
```

Or If you installed it **manually**, use it:

```
require_once __DIR__ . '/class-wp-notice.php';

use Josantonius\WP_Notice\WP_Notice;
```

Usage
-----

[](#usage)

Example of use for this library:

### - Generate success notice

[](#--generate-success-notice-1)

```
WP_Notice::success('Success example');
WP_Notice::success('Success not dismissable', false);
```

### - Generate warning notice

[](#--generate-warning-notice-1)

```
WP_Notice::warning('Warning example');
WP_Notice::warning('Warning not dismissable', false);
```

### - Generate error notice

[](#--generate-error-notice-1)

```
$error = new \WP_Error('error', 'Example of error creation from WP_Error');

WP_Notice::error($error);
WP_Notice::error('Example of error creation without going through WP_Error');
WP_Notice::error('Error not dismissable', false);
```

[![image](resources/images/english-notices.png)](resources/images/english-notices.png)

Tests
-----

[](#tests)

To run [tests](tests) you just need [composer](http://getcomposer.org/download/) and to execute the following:

```
git clone https://github.com/josantonius/wp-notice.git

cd WP_Notice

bash bin/install-wp-tests.sh wordpress_test root '' localhost latest

composer install

```

Run unit tests with [PHPUnit](https://phpunit.de/):

```
composer phpunit

```

Run [WordPress](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/) code standard tests with [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer):

```
composer phpcs

```

Run [PHP Mess Detector](https://phpmd.org/) tests to detect inconsistencies in code style:

```
composer phpmd

```

Run all previous tests:

```
composer tests

```

Sponsor
-------

[](#sponsor)

If this project helps you to reduce your development time, [you can sponsor me](https://github.com/josantonius#sponsor) to support my open source work 😊

License
-------

[](#license)

This repository is licensed under the [MIT License](LICENSE).

Copyright © 2017-2022, [Josantonius](https://github.com/josantonius#contact)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~87 days

Total

3

Last Release

3043d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b221283501ec8a9cbaefaf27821a91ae8ddd33bddf1fccc6c6815b7ad216ff1?d=identicon)[Josantonius](/maintainers/Josantonius)

---

Top Contributors

[![josantonius](https://avatars.githubusercontent.com/u/18104336?v=4)](https://github.com/josantonius "josantonius (21 commits)")

---

Tags

phpwordpress-php-librarywordpress-pluginwordpress-themephpwordpresserrorhhvmadminwarningnoticessuccess

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[tyxla/carbon-breadcrumbs

A basic WordPress plugin for breadcrumbs with advanced capabilities for extending.

195.2k](/packages/tyxla-carbon-breadcrumbs)[rockys/ex-admin-thinkphp

Ex-admin-thinkphp 是一个基于Ant Design of Vue + Thinkphp 开发而成后台系统构建工具，无需关注页面模板JavaScript，只用php代码即可快速构建出一个功能完善的后台系统。

163.0k](/packages/rockys-ex-admin-thinkphp)

PHPackages © 2026

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