Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/litespee.../tpl/toolbox
File: report.tpl.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* LiteSpeed Cache Report Interface
[2] Fix | Delete
*
[3] Fix | Delete
* Renders the report interface for LiteSpeed Cache, allowing users to generate and send environment reports to LiteSpeed Support.
[4] Fix | Delete
*
[5] Fix | Delete
* @package LiteSpeed
[6] Fix | Delete
* @since 1.0.0
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
namespace LiteSpeed;
[10] Fix | Delete
[11] Fix | Delete
defined( 'WPINC' ) || exit;
[12] Fix | Delete
[13] Fix | Delete
$_report = Report::cls();
[14] Fix | Delete
$report = $_report->generate_environment_report();
[15] Fix | Delete
[16] Fix | Delete
$env_ref = Report::get_summary();
[17] Fix | Delete
[18] Fix | Delete
// Detect passwordless plugin
[19] Fix | Delete
$dologin_link = '';
[20] Fix | Delete
$has_pswdless_plugin = false;
[21] Fix | Delete
if ( function_exists( 'dologin_gen_link' ) ) {
[22] Fix | Delete
$has_pswdless_plugin = true;
[23] Fix | Delete
if ( ! empty( $_GET['dologin_gen_link'] ) && ! empty( $_GET['litespeed_purge_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['litespeed_purge_nonce'] ) ), 'litespeed_purge_action' ) ) {
[24] Fix | Delete
unset( $_GET['dologin_gen_link'] );
[25] Fix | Delete
$dologin_link = dologin_gen_link( 'Litespeed Report' );
[26] Fix | Delete
?>
[27] Fix | Delete
<script>
[28] Fix | Delete
window.history.pushState('remove_gen_link', document.title, window.location.href.replace('&dologin_gen_link=1', ''));
[29] Fix | Delete
</script>
[30] Fix | Delete
<?php
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
$install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array( 'plugin' => 'dologin' ) );
[35] Fix | Delete
[36] Fix | Delete
$btn_title = esc_html__( 'Send to LiteSpeed', 'litespeed-cache' );
[37] Fix | Delete
if ( ! empty( $env_ref['num'] ) ) {
[38] Fix | Delete
$btn_title = esc_html__( 'Regenerate and Send a New Report', 'litespeed-cache' );
[39] Fix | Delete
}
[40] Fix | Delete
?>
[41] Fix | Delete
[42] Fix | Delete
<?php if ( ! $has_pswdless_plugin ) : ?>
[43] Fix | Delete
<div class="litespeed-callout notice notice-warning inline">
[44] Fix | Delete
<h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4>
[45] Fix | Delete
<p>
[46] Fix | Delete
<?php printf( esc_html__( 'To generate a passwordless link for LiteSpeed Support Team access, you must install %s.', 'litespeed-cache' ), '<a href="https://wordpress.org/plugins/dologin/" target="_blank">DoLogin Security</a>' ); ?>
[47] Fix | Delete
</p>
[48] Fix | Delete
<p>
[49] Fix | Delete
<a href="<?php echo esc_url( $install_link ); ?>" class="button litespeed-btn litespeed-right20"><?php esc_html_e( 'Install DoLogin Security', 'litespeed-cache' ); ?></a>
[50] Fix | Delete
<a href="<?php echo esc_url( admin_url( 'plugin-install.php?s=dologin+security&tab=search&type=term' ) ); ?>" target="_blank"><?php esc_html_e( 'Go to plugins list', 'litespeed-cache' ); ?></a>
[51] Fix | Delete
</p>
[52] Fix | Delete
</div>
[53] Fix | Delete
<?php endif; ?>
[54] Fix | Delete
[55] Fix | Delete
<h3 class="litespeed-title">
[56] Fix | Delete
<?php esc_html_e( 'LiteSpeed Report', 'litespeed-cache' ); ?>
[57] Fix | Delete
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab' ); ?>
[58] Fix | Delete
</h3>
[59] Fix | Delete
[60] Fix | Delete
<p><?php esc_html_e( 'Last Report Number', 'litespeed-cache' ); ?>: <b><?php echo ! empty( $env_ref['num'] ) ? '<span id="report_span" style="cursor: pointer;" onClick="litespeed_copy_to_clipboard(\'report_span\', this)" aria-label="' . esc_attr__( 'Click to copy', 'litespeed-cache' ) . '" data-balloon-pos="down" class="litespeed-wrap">' . esc_html( $env_ref['num'] ) . '</span>' : '-'; ?></b></p>
[61] Fix | Delete
<p><?php esc_html_e( 'Last Report Date', 'litespeed-cache' ); ?>: <b><?php echo ! empty( $env_ref['dateline'] ) ? esc_html( gmdate( 'm/d/Y H:i:s', $env_ref['dateline'] ) ) : '-'; ?></b></p>
[62] Fix | Delete
[63] Fix | Delete
<p class="litespeed-desc">
[64] Fix | Delete
<?php esc_html_e( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache' ); ?>
[65] Fix | Delete
<br />
[66] Fix | Delete
<?php esc_html_e( 'If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache' ); ?>
[67] Fix | Delete
</p>
[68] Fix | Delete
[69] Fix | Delete
<?php $this->form_action( Router::ACTION_REPORT, Report::TYPE_SEND_REPORT ); ?>
[70] Fix | Delete
<table class="wp-list-table striped litespeed-table">
[71] Fix | Delete
<tbody>
[72] Fix | Delete
<tr>
[73] Fix | Delete
<th><?php esc_html_e( 'System Information', 'litespeed-cache' ); ?></th>
[74] Fix | Delete
<td>
[75] Fix | Delete
<textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo esc_textarea( $report ); ?></textarea>
[76] Fix | Delete
</td>
[77] Fix | Delete
</tr>
[78] Fix | Delete
<tr>
[79] Fix | Delete
<th></th>
[80] Fix | Delete
<td>
[81] Fix | Delete
<?php
[82] Fix | Delete
$this->build_checkbox(
[83] Fix | Delete
'attach_php',
[84] Fix | Delete
sprintf(
[85] Fix | Delete
esc_html__( 'Attach PHP info to report. Check this box to insert relevant data from %s.', 'litespeed-cache' ),
[86] Fix | Delete
'<a href="https://www.php.net/manual/en/function.phpinfo.php" target="_blank">phpinfo()</a>'
[87] Fix | Delete
),
[88] Fix | Delete
false
[89] Fix | Delete
);
[90] Fix | Delete
?>
[91] Fix | Delete
</td>
[92] Fix | Delete
</tr>
[93] Fix | Delete
<tr>
[94] Fix | Delete
<th><?php esc_html_e( 'Passwordless Link', 'litespeed-cache' ); ?></th>
[95] Fix | Delete
<td>
[96] Fix | Delete
<input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo esc_attr( $dologin_link ); ?>" style="width:500px;" />
[97] Fix | Delete
<?php if ( $has_pswdless_plugin ) : ?>
[98] Fix | Delete
<a href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin.php?page=litespeed-toolbox&dologin_gen_link=1' ), 'litespeed_purge_action', 'litespeed_purge_nonce' ) ); ?>" class="button button-secondary"><?php esc_html_e( 'Generate Link for Current User', 'litespeed-cache' ); ?></a>
[99] Fix | Delete
<?php else : ?>
[100] Fix | Delete
<button type="button" class="button button-secondary" disabled><?php esc_html_e( 'Generate Link for Current User', 'litespeed-cache' ); ?></button>
[101] Fix | Delete
<?php endif; ?>
[102] Fix | Delete
<div class="litespeed-desc">
[103] Fix | Delete
<?php esc_html_e( 'To grant wp-admin access to the LiteSpeed Support Team, please generate a passwordless link for the current logged-in user to be sent with the report.', 'litespeed-cache' ); ?>
[104] Fix | Delete
<?php if ( $dologin_link ) : ?>
[105] Fix | Delete
<br /><strong>🚨 <?php esc_html_e( 'Please do NOT share the above passwordless link with anyone.', 'litespeed-cache' ); ?></strong>
[106] Fix | Delete
<strong>
[107] Fix | Delete
<?php
[108] Fix | Delete
printf(
[109] Fix | Delete
/* translators: %s: Link tags */
[110] Fix | Delete
esc_html__( 'Generated links may be managed under %sSettings%s.', 'litespeed-cache' ),
[111] Fix | Delete
'<a href="' . esc_url( menu_page_url( 'dologin', false ) ) . '#pswdless">',
[112] Fix | Delete
'</a>' );
[113] Fix | Delete
?>
[114] Fix | Delete
</strong>
[115] Fix | Delete
<?php endif; ?>
[116] Fix | Delete
</div>
[117] Fix | Delete
</td>
[118] Fix | Delete
</tr>
[119] Fix | Delete
<tr>
[120] Fix | Delete
<th><?php esc_html_e( 'Notes', 'litespeed-cache' ); ?></th>
[121] Fix | Delete
<td>
[122] Fix | Delete
<textarea name="notes" rows="10" cols="100"></textarea>
[123] Fix | Delete
<div class="litespeed-desc">
[124] Fix | Delete
<?php esc_html_e( 'Optional', 'litespeed-cache' ); ?>:
[125] Fix | Delete
<?php esc_html_e( 'provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache' ); ?>
[126] Fix | Delete
</div>
[127] Fix | Delete
</td>
[128] Fix | Delete
</tr>
[129] Fix | Delete
</tbody>
[130] Fix | Delete
</table>
[131] Fix | Delete
[132] Fix | Delete
<div class="litespeed-top20"></div>
[133] Fix | Delete
<button class="button button-primary" type="submit"><?php echo esc_html( $btn_title ); ?></button>
[134] Fix | Delete
<button class="button button-primary litespeed-float-submit" type="submit"><?php echo esc_html( $btn_title ); ?></button>
[135] Fix | Delete
[136] Fix | Delete
<p class="litespeed-top30 litespeed-left10 litespeed-desc">
[137] Fix | Delete
<?php esc_html_e( 'Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache' ); ?>
[138] Fix | Delete
</p>
[139] Fix | Delete
</form>
[140] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function