Jetpack_Sync_Module_Stats

The WordPress Core Jetpack Sync Module Stats class.

Defined (1)

The class is defined in the following location(s).

/sync/class.jetpack-sync-module-stats.php  
  1. class Jetpack_Sync_Module_Stats extends Jetpack_Sync_Module { 
  2.  
  3. function name() { 
  4. return 'stats'; 
  5.  
  6. function init_listeners( $callback ) { 
  7. add_action( 'jetpack_heartbeat', array( $this, 'sync_site_stats' ), 20 ); 
  8. add_action( 'jetpack_sync_heartbeat_stats', $callback ); 
  9. /** 
  10. * This namespaces the action that we sync. 
  11. * So that we can differentiate it from future actions. 
  12. */ 
  13. public function sync_site_stats() { 
  14. do_action( 'jetpack_sync_heartbeat_stats' ); 
  15.  
  16. public function init_before_send() { 
  17. add_filter( 'jetpack_sync_before_send_jetpack_sync_heartbeat_stats', array( $this, 'add_stats' ) ); 
  18.  
  19. public function add_stats() { 
  20. return array( Jetpack::get_stat_data( false, false ) );