Admin Notifier
Admin Notifier WordPress plugin
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/coveas/admin-notifier/archive/refs/heads/main.zipA WordPress plugin that displays dismissible admin notices from Markdown files. Perfect for communicating updates, maintenance windows, or important information to admin users.
Features
- Markdown-based notices — Write notices as
.mdfiles with YAML frontmatter - Time-based visibility — Schedule when notices appear and expire
- Per-user dismissal — Each user can dismiss notices independently
- Notice history — View all notices (active, scheduled, expired, dismissed) in Tools → Update Notices
- WP-CLI support — Quickly create notices from the command line
Usage
Creating a Notice
Create a .md file in the /notices/ directory at your project root:
---
title: "Site Maintenance Scheduled"
type: info
visible_from: "2026-02-06T10:00:00+01:00"
visible_until: "2026-02-13T23:59:59+01:00"
---
We will be performing scheduled maintenance on **February 10th** from 02:00 to 04:00 CET.
- Some features may be temporarily unavailable
- Contact [support@example.com](mailto:support@example.com) with questions
Frontmatter Options
| Field | Required | Description |
|---|---|---|
title |
Yes | Notice heading displayed in bold |
type |
No | info (default), success, warning, or error |
visible_from |
No | ISO 8601 datetime. If omitted, visible immediately |
visible_until |
No | ISO 8601 datetime. If omitted, visible indefinitely |
Supported Markdown
- Bold:
**text**or__text__ - Italic:
*text*or_text_ Inline code:`code`- Links:
[text](url) - Lists: Lines starting with
-
WP-CLI
# Basic notice (visible for 7 days)
wp admin-notify create "New feature available"
# With type and custom duration
wp admin-notify create "Security patch applied" --type=success --days=3
# Warning with extended visibility
wp admin-notify create "Maintenance scheduled" --type=warning --days=14
# With body content
wp admin-notify create "Plugin updates" --body="Updated ACF to 6.3.1"
Notice History
View all notices at Tools → Update Notices. The page shows:
- Status: Active, Scheduled, Expired, or Dismissed
- Title: Click "Show details" to expand the full notice
- Type: info, success, warning, error
- Visible From/Until: Date range for the notice
Configuration
Define constants in wp-config.php to customize behavior:
// Custom notices directory (default: project root /notices/)
define('ADMIN_NOTIFIER_DIR', '/path/to/notices');
Architecture
The plugin follows modern PHP practices:
- DTOs for typed, immutable data transfer
- Services for business logic (parsing, filtering, dismissal)
- Handlers for WordPress hooks (no logic, just delegation)
- Renderers that prepare escaped data for templates
- Templates that only echo variables (no side effects)
src/
├── DTO/
│ ├── Notice.php
│ └── NoticeViewModel.php
├── Service/
│ ├── NoticeParser.php
│ ├── NoticeRepository.php
│ ├── NoticeFilter.php
│ ├── NoticeStatusResolver.php
│ ├── DismissalService.php
│ └── NoticeFileGenerator.php
├── Handler/
│ ├── AdminNoticeHandler.php
│ ├── AjaxDismissHandler.php
│ └── AdminPageHandler.php
├── CLI/
│ └── CreateNoticeCommand.php
├── Renderer/
│ ├── NoticeRenderer.php
│ └── AdminPageRenderer.php
└── Template/
├── notice.php
└── admin-page.php
Requirements
- PHP 8.1+
- WordPress 6.0+