Freemius_Debug_Bar_Panel

Extends Debug Bar plugin by adding a panel to show all Freemius API requests.

Defined (1)

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

/freemius/includes/debug/class-fs-debug-bar-panel.php  
  1. class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel { 
  2. function init() { 
  3. $this->title( 'Freemius' ); 
  4.  
  5. static function requests_count() { 
  6. if ( class_exists( 'Freemius_Api' ) ) { 
  7. $logger = Freemius_Api::GetLogger(); 
  8. } else { 
  9. $logger = array(); 
  10.  
  11. return number_format( count( $logger ) ); 
  12.  
  13. static function total_time() { 
  14. if ( class_exists( 'Freemius_Api' ) ) { 
  15. $logger = Freemius_Api::GetLogger(); 
  16. } else { 
  17. $logger = array(); 
  18.  
  19. $total_time = .0; 
  20. foreach ( $logger as $l ) { 
  21. $total_time += $l['total']; 
  22.  
  23. return number_format( 100 * $total_time, 2 ) . ' ' . __fs( 'ms' ); 
  24.  
  25. function render() { 
  26. ?> 
  27. <div id='debug-bar-php'> 
  28. <?php fs_require_template( '/debug/api-calls.php' ) ?> 
  29. <br> 
  30. <?php fs_require_template( '/debug/scheduled-crons.php' ) ?> 
  31. <br> 
  32. <?php fs_require_template( '/debug/plugins-themes-sync.php' ) ?> 
  33. <br> 
  34. <?php fs_require_template( '/debug/logger.php' ) ?> 
  35. </div> 
  36. <?php