PHPackages                             automattic/jetpack-menu-badges - 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. automattic/jetpack-menu-badges

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

automattic/jetpack-menu-badges
==============================

Central registry and renderer for Jetpack admin-menu notification-count badges.

v0.1.0(1mo ago)04683GPL-2.0-or-laterPHP &gt;=7.2

Since Jul 9Compare

[ Source](https://github.com/Automattic/jetpack-menu-badges)[ Packagist](https://packagist.org/packages/automattic/jetpack-menu-badges)[ RSS](/packages/automattic-jetpack-menu-badges/feed)WikiDiscussions Synced 1w ago

READMEChangelogDependencies (3)Versions (3)Used By (3)

Menu Badges
===========

[](#menu-badges)

Central registry and renderer for Jetpack admin-menu notification-count badges.

Products report a count against a Jetpack menu item to the `Notification_Counts`registry; `Menu_Renderer` (wired by `Menu_Badges::init()`) is the sole writer of those badges into the wp-admin `$menu`/`$submenu` globals, and it also feeds the top-level total into the WP.com admin-menu REST response. This replaces every feature poking at `$menu`/`$submenu` on its own.

Usage
-----

[](#usage)

Wire the renderer (idempotent — call it from every consumer that registers a count), then register your count:

```
\Automattic\Jetpack\Menu_Badges\Menu_Badges::init();

\Automattic\Jetpack\Menu_Badges\Notification_Counts::register(
	'jetpack-forms', // Unique id for your entry.
	array(
		'menu_slug' => 'jetpack-forms-responses', // Submenu item slug to badge; null for top-level total only.
		'count'     => 3,                          // Magnitude for 'count' entries.
		'type'      => 'count',                    // 'count' (uses `count`) or 'attention' (contributes 1).
	)
);
```

Guard the `register()` call on the same capability as the menu item it badges (e.g. `current_user_can( 'manage_options' )`), so the top-level total never includes counts the current user can't act on.

To live-update a badge after a client-side change, without a page reload:

```
window.jetpackMenuBadges.setCount( 'jetpack-forms-responses', 2 );
```

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

menu-badges is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

### Embed Badge

![Health badge](/badges/automattic-jetpack-menu-badges/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-menu-badges/health.svg)](https://phpackages.com/packages/automattic-jetpack-menu-badges)
```

###  Alternatives

[automattic/jetpack

Jetpack supercharges your self‑hosted WordPress site with the awesome cloud power of WordPress.com

3623.2k](/packages/automattic-jetpack)

PHPackages © 2026

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