automattic / jetpack-heartbeat
This adds a cronjob that sends a batch of internal automattic stats to wp.com once a day
Installs: 657 500
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Type:jetpack-library
Requires
- php: >=7.0
- automattic/jetpack-connection: ^2.9.0
Requires (Dev)
- automattic/jetpack-changelogger: ^4.2.4
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
- dev-trunk / 2.0.x-dev
- v2.0.1
- v2.0.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.15
- v1.3.14
- v1.3.13
- v1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- 1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- dev-fix/slack-workflow-branch-detection
- dev-fix/release-branch-typo
- dev-update/generate-branch-plugin
- dev-release-v1.3.3
- dev-release-v1.3.2
- dev-release-v1.3.1
- dev-feature/reorg
- dev-release-v1.3.0
- dev-release-v1.2.2
- dev-release-v1.2.1
- dev-release-v1.2.0
- dev-release-v1.1.0
- dev-release-v1.0.0
This package is auto-updated.
Last update: 2024-05-30 21:26:10 UTC
README
Sends a daily batch of stats to WP.com using the A8C MC Stats package.
These are internal usage stats for Automattic, not visible to site owners.
Usage
1. Make sure Heartbeat is initialized:
Automattic\Jetpack\Heartbeat::init();
2. Add your stats to the heartbeat
Add a filter callback:
add_filter( 'jetpack_heartbeat_stats_array', 'my_callback' );
In your callback, add the stats you want to the array with new key => value pairs where:
- key is the stat group name
- value is the stat name.
function my_callback( $stats ) { $stats['my-plugin'] = 'active'; return $stats; }
This will bump the stats for the 'my-plugin/active' stat.
And that's all!
Now your stats will be added to the batch of stats that are bumped once a day.
Using this package in your WordPress plugin
If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
Security
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
License
jetpack-heartbeat is licensed under GNU General Public License v2 (or later)