Edit File by line
/home/zeestwma/ajeebong.../wp-conte.../plugins/litespee.../tpl/dash
File: network_dash.tpl.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* LiteSpeed Cache Network Dashboard
[2] Fix | Delete
*
[3] Fix | Delete
* @package LiteSpeed
[4] Fix | Delete
* @since 1.0.0
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
namespace LiteSpeed;
[8] Fix | Delete
[9] Fix | Delete
defined( 'WPINC' ) || exit;
[10] Fix | Delete
[11] Fix | Delete
$cloud_summaries = array();
[12] Fix | Delete
$blogs = Activation::get_network_ids();
[13] Fix | Delete
foreach ( $blogs as $network_blog_id ) {
[14] Fix | Delete
switch_to_blog( $network_blog_id );
[15] Fix | Delete
$cloud_summaries[ home_url() ] = Cloud::get_summary();
[16] Fix | Delete
// May need restore_current_blog();
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
?>
[20] Fix | Delete
[21] Fix | Delete
<div class="litespeed-dashboard">
[22] Fix | Delete
<?php foreach ( $cloud_summaries as $home_url => $cloud_summary ) : ?>
[23] Fix | Delete
[24] Fix | Delete
<div class="litespeed-dashboard-header">
[25] Fix | Delete
<h3 class="litespeed-dashboard-title">
[26] Fix | Delete
<?php echo esc_html( sprintf( __( 'Usage Statistics: %s', 'litespeed-cache' ), $home_url ) ); ?>
[27] Fix | Delete
</h3>
[28] Fix | Delete
<hr>
[29] Fix | Delete
</div>
[30] Fix | Delete
[31] Fix | Delete
<div class="litespeed-dashboard-stats-wrapper">
[32] Fix | Delete
<?php
[33] Fix | Delete
$cat_list = array(
[34] Fix | Delete
'img_optm' => esc_html__( 'Image Optimization', 'litespeed-cache' ),
[35] Fix | Delete
'page_optm' => esc_html__( 'Page Optimization', 'litespeed-cache' ),
[36] Fix | Delete
'cdn' => esc_html__( 'CDN Bandwidth', 'litespeed-cache' ),
[37] Fix | Delete
'lqip' => esc_html__( 'Low Quality Image Placeholder', 'litespeed-cache' ),
[38] Fix | Delete
);
[39] Fix | Delete
[40] Fix | Delete
foreach ( $cat_list as $svc => $svc_title ) :
[41] Fix | Delete
$finished_percentage = 0;
[42] Fix | Delete
$total_used = '-';
[43] Fix | Delete
$used = '-';
[44] Fix | Delete
$quota = '-';
[45] Fix | Delete
$pag_used = '-';
[46] Fix | Delete
$pag_total = '-';
[47] Fix | Delete
$pag_width = 0;
[48] Fix | Delete
$pag_bal = 0;
[49] Fix | Delete
[50] Fix | Delete
if ( ! empty( $cloud_summary[ 'usage.' . $svc ] ) ) {
[51] Fix | Delete
$usage = $cloud_summary[ 'usage.' . $svc ];
[52] Fix | Delete
$finished_percentage = floor( $usage['used'] * 100 / $usage['quota'] );
[53] Fix | Delete
$used = $usage['used'];
[54] Fix | Delete
$quota = $usage['quota'];
[55] Fix | Delete
$pag_used = ! empty( $usage['pag_used'] ) ? $usage['pag_used'] : 0;
[56] Fix | Delete
$pag_bal = ! empty( $usage['pag_bal'] ) ? $usage['pag_bal'] : 0;
[57] Fix | Delete
$pag_total = $pag_used + $pag_bal;
[58] Fix | Delete
[59] Fix | Delete
if ( $pag_total ) {
[60] Fix | Delete
$pag_width = round( $pag_used / $pag_total * 100 ) . '%';
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
if ( 'cdn' === $svc ) {
[64] Fix | Delete
$used = Utility::real_size( $used * 1024 * 1024 );
[65] Fix | Delete
$quota = Utility::real_size( $quota * 1024 * 1024 );
[66] Fix | Delete
$pag_used = Utility::real_size( $pag_used * 1024 * 1024 );
[67] Fix | Delete
$pag_total = Utility::real_size( $pag_total * 1024 * 1024 );
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
if ( ! empty( $usage['total_used'] ) ) {
[71] Fix | Delete
$total_used = $usage['total_used'];
[72] Fix | Delete
}
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
$percentage_bg = 'success';
[76] Fix | Delete
if ( 95 < $finished_percentage ) {
[77] Fix | Delete
$percentage_bg = 'danger';
[78] Fix | Delete
} elseif ( 85 < $finished_percentage ) {
[79] Fix | Delete
$percentage_bg = 'warning';
[80] Fix | Delete
}
[81] Fix | Delete
?>
[82] Fix | Delete
[83] Fix | Delete
<div class="postbox litespeed-postbox">
[84] Fix | Delete
<div class="inside">
[85] Fix | Delete
<h3 class="litespeed-title"><?php echo esc_html( $svc_title ); ?></h3>
[86] Fix | Delete
[87] Fix | Delete
<div class="litespeed-flex-container">
[88] Fix | Delete
<div class="litespeed-icon-vertical-middle litespeed-pie-<?php echo esc_attr( $percentage_bg ); ?>">
[89] Fix | Delete
<?php echo wp_kses( GUI::pie( $finished_percentage, 60, false ), GUI::allowed_svg_tags() ); ?>
[90] Fix | Delete
</div>
[91] Fix | Delete
<div>
[92] Fix | Delete
<div class="litespeed-dashboard-stats">
[93] Fix | Delete
<h3><?php echo esc_html( 'img_optm' === $svc ? __( 'Fast Queue Usage', 'litespeed-cache' ) : __( 'Usage', 'litespeed-cache' ) ); ?></h3>
[94] Fix | Delete
<p>
[95] Fix | Delete
<strong><?php echo esc_html( $used ); ?></strong>
[96] Fix | Delete
<?php if ( $quota !== $used ) : ?>
[97] Fix | Delete
<span class="litespeed-desc"> / <?php echo esc_html( $quota ); ?></span>
[98] Fix | Delete
<?php endif; ?>
[99] Fix | Delete
</p>
[100] Fix | Delete
</div>
[101] Fix | Delete
</div>
[102] Fix | Delete
</div>
[103] Fix | Delete
[104] Fix | Delete
<?php if ( 0 < $pag_total ) : ?>
[105] Fix | Delete
<p class="litespeed-dashboard-stats-payg" data-balloon-pos="up" aria-label="<?php echo esc_attr__( 'Pay as You Go', 'litespeed-cache' ); ?>">
[106] Fix | Delete
<?php esc_html_e( 'PAYG Balance', 'litespeed-cache' ); ?>: <strong><?php echo esc_html( $pag_bal ); ?></strong>
[107] Fix | Delete
<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo esc_attr( sprintf( __( 'This Month Usage: %s', 'litespeed-cache' ), esc_html( $pag_used ) ) ); ?>">
[108] Fix | Delete
<span class="dashicons dashicons-info"></span>
[109] Fix | Delete
<span class="screen-reader-text"><?php esc_html_e( 'Pay as You Go Usage Statistics', 'litespeed-cache' ); ?></span>
[110] Fix | Delete
</button>
[111] Fix | Delete
</p>
[112] Fix | Delete
<?php endif; ?>
[113] Fix | Delete
[114] Fix | Delete
<?php if ( 'img_optm' === $svc ) : ?>
[115] Fix | Delete
<p class="litespeed-dashboard-stats-total">
[116] Fix | Delete
<?php esc_html_e( 'Total Usage', 'litespeed-cache' ); ?>: <strong><?php echo esc_html( $total_used ); ?> / ∞</strong>
[117] Fix | Delete
<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo esc_attr__( 'Total images optimized in this month', 'litespeed-cache' ); ?>">
[118] Fix | Delete
<span class="dashicons dashicons-info"></span>
[119] Fix | Delete
</button>
[120] Fix | Delete
</p>
[121] Fix | Delete
<div class="clear"></div>
[122] Fix | Delete
<?php endif; ?>
[123] Fix | Delete
</div>
[124] Fix | Delete
</div>
[125] Fix | Delete
[126] Fix | Delete
<?php endforeach; ?>
[127] Fix | Delete
</div>
[128] Fix | Delete
[129] Fix | Delete
<?php endforeach; ?>
[130] Fix | Delete
</div>
[131] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function