PluginProbe
Passster – Password Protect Pages and Content / 4.1.4
Passster – Password Protect Pages and Content v4.1.4
4.3.16 4.3.15 4.3.14 4.3.12 4.3.13 4.3.11 4.3.10 4.3.9 4.3.8 4.3.7 4.3.6 4.3.5 trunk 3.5.4 3.5.5.2 3.5.5.8 3.5.5.9 4.0 4.1.4 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.15 All 48 releases
content-protector / inc / freemius / includes / debug / class-fs-debug-bar-panel.php

class-fs-debug-bar-panel.php in Passster – Password Protect Pages and Content 4.1.4, at inc/freemius/includes/debug/class-fs-debug-bar-panel.php

65 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.1.7.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * Extends Debug Bar plugin by adding a panel to show all Freemius API requests.
15 *
16 * @author Vova Feldman (@svovaf)
17 * @since 1.1.7.3
18 *
19 * Class Freemius_Debug_Bar_Panel
20 */
21 class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel {
22 function init() {
23 $this->title( 'Freemius' );
24 }
25
26 static function requests_count() {
27 if ( class_exists( 'Freemius_Api_WordPress' ) ) {
28 $logger = Freemius_Api_WordPress::GetLogger();
29 } else {
30 $logger = array();
31 }
32
33 return number_format( count( $logger ) );
34 }
35
36 static function total_time() {
37 if ( class_exists( 'Freemius_Api_WordPress' ) ) {
38 $logger = Freemius_Api_WordPress::GetLogger();
39 } else {
40 $logger = array();
41 }
42
43 $total_time = .0;
44 foreach ( $logger as $l ) {
45 $total_time += $l['total'];
46 }
47
48 return number_format( 100 * $total_time, 2 ) . ' ' . fs_text_x_inline( 'ms', 'milliseconds' );
49 }
50
51 function render() {
52 ?>
53 <div id='debug-bar-php'>
54 <?php fs_require_template( '/debug/api-calls.php' ) ?>
55 <br>
56 <?php fs_require_template( '/debug/scheduled-crons.php' ) ?>
57 <br>
58 <?php fs_require_template( '/debug/plugins-themes-sync.php' ) ?>
59 <br>
60 <?php fs_require_template( '/debug/logger.php' ) ?>
61 </div>
62 <?php
63 }
64 }
65