Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/content-.../inc/freemius/template.../debug
File: api-calls.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @package Freemius
[2] Fix | Delete
* @copyright Copyright (c) 2015, Freemius, Inc.
[3] Fix | Delete
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
[4] Fix | Delete
* @since 1.1.7.3
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[8] Fix | Delete
exit;
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
if ( class_exists( 'Freemius_Api_WordPress' ) ) {
[12] Fix | Delete
$logger = Freemius_Api_WordPress::GetLogger();
[13] Fix | Delete
} else {
[14] Fix | Delete
$logger = array();
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
$counters = array(
[18] Fix | Delete
'GET' => 0,
[19] Fix | Delete
'POST' => 0,
[20] Fix | Delete
'PUT' => 0,
[21] Fix | Delete
'DELETE' => 0
[22] Fix | Delete
);
[23] Fix | Delete
[24] Fix | Delete
$show_body = false;
[25] Fix | Delete
foreach ( $logger as $log ) {
[26] Fix | Delete
$counters[ $log['method'] ] ++;
[27] Fix | Delete
[28] Fix | Delete
if ( ! is_null( $log['body'] ) ) {
[29] Fix | Delete
$show_body = true;
[30] Fix | Delete
}
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
$pretty_print = $show_body && defined( 'JSON_PRETTY_PRINT' ) && version_compare( phpversion(), '5.3', '>=' );
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* This template is used for debugging, therefore, when possible
[37] Fix | Delete
* we'd like to prettify the output of a JSON encoded variable.
[38] Fix | Delete
* This will only be executed when $pretty_print is `true`, and
[39] Fix | Delete
* the var is `true` only for PHP 5.3 and higher. Due to the
[40] Fix | Delete
* limitations of the current Theme Check, it throws an error
[41] Fix | Delete
* that using the "options" parameter (the 2nd param) is not
[42] Fix | Delete
* supported in PHP 5.2 and lower. Thus, we added this alias
[43] Fix | Delete
* variable to work around that false-positive.
[44] Fix | Delete
*
[45] Fix | Delete
* @author Vova Feldman (@svovaf)
[46] Fix | Delete
* @since 1.2.2.7
[47] Fix | Delete
*/
[48] Fix | Delete
$encode = 'json_encode';
[49] Fix | Delete
[50] Fix | Delete
$root_path_len = strlen( ABSPATH );
[51] Fix | Delete
[52] Fix | Delete
$ms_text = fs_text_x_inline( 'ms', 'milliseconds' );
[53] Fix | Delete
?>
[54] Fix | Delete
<h1><?php fs_echo_inline( 'API' ) ?></h1>
[55] Fix | Delete
[56] Fix | Delete
<h2><span>Total Time:</span><?php echo Freemius_Debug_Bar_Panel::total_time() ?></h2>
[57] Fix | Delete
[58] Fix | Delete
<h2><span>Total Requests:</span><?php echo Freemius_Debug_Bar_Panel::requests_count() ?></h2>
[59] Fix | Delete
<?php foreach ( $counters as $method => $count ) : ?>
[60] Fix | Delete
<h2><span><?php echo $method ?>:</span><?php echo number_format( $count ) ?></h2>
[61] Fix | Delete
<?php endforeach ?>
[62] Fix | Delete
<table class="widefat">
[63] Fix | Delete
<thead>
[64] Fix | Delete
<tr>
[65] Fix | Delete
<th>#</th>
[66] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Method' ) ?></th>
[67] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Code' ) ?></th>
[68] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Length' ) ?></th>
[69] Fix | Delete
<th><?php fs_esc_html_echo_x_inline( 'Path', 'as file/folder path' ) ?></th>
[70] Fix | Delete
<?php if ( $show_body ) : ?>
[71] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Body' ) ?></th>
[72] Fix | Delete
<?php endif ?>
[73] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Result' ) ?></th>
[74] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Start' ) ?></th>
[75] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'End' ) ?></th>
[76] Fix | Delete
</tr>
[77] Fix | Delete
</thead>
[78] Fix | Delete
<tbody>
[79] Fix | Delete
<?php foreach ( $logger as $log ) : ?>
[80] Fix | Delete
<tr>
[81] Fix | Delete
<td><?php echo $log['id'] ?>.</td>
[82] Fix | Delete
<td><?php echo $log['method'] ?></td>
[83] Fix | Delete
<td><?php echo $log['code'] ?></td>
[84] Fix | Delete
<td><?php echo number_format( 100 * $log['total'], 2 ) . ' ' . $ms_text ?></td>
[85] Fix | Delete
<td>
[86] Fix | Delete
<?php
[87] Fix | Delete
printf( '<a href="#" onclick="jQuery(this).parent().find(\'table\').toggle(); return false;">%s</a>',
[88] Fix | Delete
$log['path']
[89] Fix | Delete
);
[90] Fix | Delete
?>
[91] Fix | Delete
<table class="widefat" style="display: none">
[92] Fix | Delete
<tbody>
[93] Fix | Delete
<?php for ( $i = 0, $bt = $log['backtrace'], $len = count( $bt ); $i < $len; $i ++ ) : ?>
[94] Fix | Delete
<tr>
[95] Fix | Delete
<td><?php echo( $len - $i ) ?></td>
[96] Fix | Delete
<td><?php if ( isset( $bt[ $i ]['function'] ) ) {
[97] Fix | Delete
echo ( isset( $bt[ $i ]['class'] ) ? $bt[ $i ]['class'] . $bt[ $i ]['type'] : '' ) . $bt[ $i ]['function'];
[98] Fix | Delete
} ?></td>
[99] Fix | Delete
<td><?php if ( isset( $bt[ $i ]['file'] ) ) {
[100] Fix | Delete
echo substr( $bt[ $i ]['file'], $root_path_len ) . ':' . $bt[ $i ]['line'];
[101] Fix | Delete
} ?></td>
[102] Fix | Delete
</tr>
[103] Fix | Delete
<?php endfor ?>
[104] Fix | Delete
</tbody>
[105] Fix | Delete
</table>
[106] Fix | Delete
</td>
[107] Fix | Delete
<?php if ( $show_body ) : ?>
[108] Fix | Delete
<td>
[109] Fix | Delete
<?php if ( 'GET' !== $log['method'] ) : ?>
[110] Fix | Delete
<?php
[111] Fix | Delete
$body = $log['body'];
[112] Fix | Delete
printf(
[113] Fix | Delete
'<a href="#" onclick="jQuery(this).parent().find(\'pre\').toggle(); return false;">%s</a>',
[114] Fix | Delete
substr( $body, 0, 32 ) . ( 32 < strlen( $body ) ? '...' : '' )
[115] Fix | Delete
);
[116] Fix | Delete
if ( $pretty_print ) {
[117] Fix | Delete
$body = $encode( json_decode( $log['body'] ), JSON_PRETTY_PRINT );
[118] Fix | Delete
}
[119] Fix | Delete
?>
[120] Fix | Delete
<pre style="display: none"><code><?php echo esc_html( $body ) ?></code></pre>
[121] Fix | Delete
<?php endif ?>
[122] Fix | Delete
</td>
[123] Fix | Delete
<?php endif ?>
[124] Fix | Delete
<td>
[125] Fix | Delete
<?php
[126] Fix | Delete
$result = $log['result'];
[127] Fix | Delete
[128] Fix | Delete
$is_not_empty_result = ( is_string( $result ) && ! empty( $result ) );
[129] Fix | Delete
[130] Fix | Delete
if ( $is_not_empty_result ) {
[131] Fix | Delete
printf(
[132] Fix | Delete
'<a href="#" onclick="jQuery(this).parent().find(\'pre\').toggle(); return false;">%s</a>',
[133] Fix | Delete
substr( $result, 0, 32 ) . ( 32 < strlen( $result ) ? '...' : '' )
[134] Fix | Delete
);
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
if ( $is_not_empty_result && $pretty_print ) {
[138] Fix | Delete
$decoded = json_decode( $result );
[139] Fix | Delete
if ( ! is_null( $decoded ) ) {
[140] Fix | Delete
$result = $encode( $decoded, JSON_PRETTY_PRINT );
[141] Fix | Delete
}
[142] Fix | Delete
} else {
[143] Fix | Delete
$result = is_string( $result ) ? $result : json_encode( $result );
[144] Fix | Delete
}
[145] Fix | Delete
?>
[146] Fix | Delete
<pre<?php if ( $is_not_empty_result ) : ?> style="display: none"<?php endif ?>><code><?php echo esc_html( $result ) ?></code></pre>
[147] Fix | Delete
</td>
[148] Fix | Delete
<td><?php echo number_format( 100 * ( $log['start'] - WP_FS__SCRIPT_START_TIME ), 2 ) . ' ' . $ms_text ?></td>
[149] Fix | Delete
<td><?php echo number_format( 100 * ( $log['end'] - WP_FS__SCRIPT_START_TIME ), 2 ) . ' ' . $ms_text ?></td>
[150] Fix | Delete
</tr>
[151] Fix | Delete
<?php endforeach ?>
[152] Fix | Delete
</tbody>
[153] Fix | Delete
</table>
[154] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function