automattic / jetpack-heartbeat
v2.0.1
2024-05-30 21:25 UTC
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
使用 A8C MC Stats 包每天向 WP.com 发送一批统计数据。
这些是 Automattic 的内部使用统计数据,对网站所有者不可见。
用法
1. 确保Heartbeat已初始化
Automattic\Jetpack\Heartbeat::init();
2. 将您的统计信息添加到heartbeat
添加过滤器回调
add_filter( 'jetpack_heartbeat_stats_array', 'my_callback' );
在回调函数中,将您想要的统计信息添加到数组中,使用新的键 => 值对,其中
- 键是统计分组名称
- 值是统计名称。
function my_callback( $stats ) { $stats['my-plugin'] = 'active'; return $stats; }
这将增加 'my-plugin/active' 统计数据的统计。
就这样!
现在您的统计信息将被添加到每天增加一批的统计信息中。
在您的WordPress插件中使用此包
如果您计划在WordPress插件中使用此包,我们建议您使用 Jetpack Autoloader 作为您的自动加载器。这将允许与其他使用此包的插件实现最大兼容性。
安全
需要报告安全漏洞?请访问 https://automattic.com/security/ 或直接访问我们的安全漏洞赏金网站 https://hackerone.com/automattic。
许可证
jetpack-heartbeat 在 GNU通用公共许可证v2(或更高版本) 下授权。