WP Manifestindependent plugin directory
manifest / admin / admin-notice-manager

Admin Notice Manager

A plugin to manage admin notices.

by Jahid Hossain · github.com/jahidhasan018/admin-notice-manager · website

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/jahidhasan018/admin-notice-manager/archive/refs/heads/main.zip

Manage WordPress admin notices safely from a dedicated admin page. This plugin stores notices in a custom database table and displays them across the WordPress admin.

Features

  • Add and delete admin notices from a simple settings page
  • Custom DB table ({prefix}anm_notices) for robust storage
  • Secure add/delete actions with capability and nonce checks
  • Proper WordPress admin notice styles: info, success, warning, error
  • Full i18n-ready strings using text domain admin-notice-manager
  • Uninstall cleanup drops the custom table and removes related options

Requirements

  • WordPress 5.5+
  • PHP 7.4+

Installation

  1. Copy the plugin folder admin-notice-manager into wp-content/plugins/.
  2. In WordPress admin, go to PluginsActivate “Admin Notice Manager”.
  3. Activation will create the custom table using dbDelta.

Usage

  1. Open Admin Notice Manager from the left admin menu.
  2. Enter a message and select a type:
    • Notice (treated as info)
    • Info
    • Success
    • Warning
    • Error
  3. Click Save Notice.
  4. The notice will:
    • Render at the top of admin screens with the appropriate styling.
    • Appear under the “Saved” list with a Delete button.

How It Works

  • Storage: includes/class-anm-db.php defines a DB layer. Table schema:
    • id BIGINT UNSIGNED AUTO_INCREMENT
    • message TEXT
    • type VARCHAR(20)
    • created_at DATETIME
  • Admin page: includes/class-anm-admin.php renders the form and the saved list.
  • Actions:
    • Add (admin-post.php?action=anm_save_notice) sanitizes input and inserts into the table.
    • Delete (admin-post.php?action=anm_delete_notice) removes by id.
  • Display: Hook admin_notices reads from the table and outputs notices with WP classes.

Security

  • All modifying actions are protected by capability checks (manage_options) and nonces.
  • All input is sanitized (sanitize_text_field + wp_unslash).
  • All output is escaped (esc_html, esc_attr).

Uninstall

  • Removing the plugin via WordPress admin triggers uninstall.php which drops the custom table and deletes related options.

Development Notes

  • Activation Hook: anm_activate() creates the table via dbDelta.
  • Text Domain: admin-notice-manager loaded on plugins_loaded.

License

GPL v2 or later.