Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/litespee.../tpl/toolbox
File: edit_htaccess.tpl.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* LiteSpeed Cache View .htaccess
[2] Fix | Delete
*
[3] Fix | Delete
* Renders the .htaccess view interface for LiteSpeed Cache, displaying the contents and paths of frontend and backend .htaccess files.
[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
$content = null;
[14] Fix | Delete
try {
[15] Fix | Delete
$content = Htaccess::cls()->htaccess_read();
[16] Fix | Delete
} catch ( \Exception $e ) {
[17] Fix | Delete
?>
[18] Fix | Delete
<div class="notice notice-error is-dismissible">
[19] Fix | Delete
<p><?php echo wp_kses_post( $e->getMessage() ); ?></p>
[20] Fix | Delete
</div>
[21] Fix | Delete
<?php
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
$htaccess_path = Htaccess::get_frontend_htaccess();
[25] Fix | Delete
[26] Fix | Delete
// Check for `ExpiresDefault` in .htaccess when LiteSpeed is enabled
[27] Fix | Delete
if ( defined( 'LITESPEED_ON' ) && $content && stripos( $content, "\nExpiresDefault" ) !== false ) {
[28] Fix | Delete
$is_dismissed = GUI::get_option( self::DB_DISMISS_MSG );
[29] Fix | Delete
if ( self::RULECONFLICT_DISMISSED !== $is_dismissed ) {
[30] Fix | Delete
if ( self::RULECONFLICT_ON !== $is_dismissed ) {
[31] Fix | Delete
GUI::update_option( self::DB_DISMISS_MSG, self::RULECONFLICT_ON );
[32] Fix | Delete
}
[33] Fix | Delete
require_once LSCWP_DIR . 'tpl/inc/show_rule_conflict.php';
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
?>
[37] Fix | Delete
[38] Fix | Delete
<h3 class="litespeed-title">
[39] Fix | Delete
<?php esc_html_e( 'LiteSpeed Cache View .htaccess', 'litespeed-cache' ); ?>
[40] Fix | Delete
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#view-htaccess-tab' ); ?>
[41] Fix | Delete
</h3>
[42] Fix | Delete
[43] Fix | Delete
<h3 class="litespeed-title-short">
[44] Fix | Delete
<?php esc_html_e( '.htaccess Path', 'litespeed-cache' ); ?>
[45] Fix | Delete
</h3>
[46] Fix | Delete
[47] Fix | Delete
<table class="wp-list-table striped litespeed-table">
[48] Fix | Delete
<tbody>
[49] Fix | Delete
<tr>
[50] Fix | Delete
<th>
[51] Fix | Delete
<?php esc_html_e( 'Frontend .htaccess Path', 'litespeed-cache' ); ?>
[52] Fix | Delete
</th>
[53] Fix | Delete
<td>
[54] Fix | Delete
<code><?php echo esc_html( $htaccess_path ); ?></code>
[55] Fix | Delete
<div class="litespeed-desc">
[56] Fix | Delete
<?php esc_html_e( 'Default path is', 'litespeed-cache' ); ?>: <code><?php echo esc_html( Htaccess::get_frontend_htaccess( true ) ); ?></code>
[57] Fix | Delete
<br />
[58] Fix | Delete
<font class="litespeed-success">
[59] Fix | Delete
<?php esc_html_e( 'API', 'litespeed-cache' ); ?>:
[60] Fix | Delete
<?php printf( esc_html__( 'PHP Constant %s is supported.', 'litespeed-cache' ), '<code>LITESPEED_CFG_HTACCESS</code>' ); ?>
[61] Fix | Delete
<?php printf( esc_html__( 'You can use this code %1$s in %2$s to specify the htaccess file path.', 'litespeed-cache' ), '<code>defined("LITESPEED_CFG_HTACCESS") || define("LITESPEED_CFG_HTACCESS", "your path on server");</code>', '<code>wp-config.php</code>' ); ?>
[62] Fix | Delete
</font>
[63] Fix | Delete
</div>
[64] Fix | Delete
</td>
[65] Fix | Delete
</tr>
[66] Fix | Delete
[67] Fix | Delete
<tr>
[68] Fix | Delete
<th>
[69] Fix | Delete
<?php esc_html_e( 'Backend .htaccess Path', 'litespeed-cache' ); ?>
[70] Fix | Delete
</th>
[71] Fix | Delete
<td>
[72] Fix | Delete
<code><?php echo esc_html( Htaccess::get_backend_htaccess() ); ?></code>
[73] Fix | Delete
<div class="litespeed-desc">
[74] Fix | Delete
<?php esc_html_e( 'Default path is', 'litespeed-cache' ); ?>: <code><?php echo esc_html( Htaccess::get_backend_htaccess( true ) ); ?></code>
[75] Fix | Delete
<br />
[76] Fix | Delete
<font class="litespeed-success">
[77] Fix | Delete
<?php esc_html_e( 'API', 'litespeed-cache' ); ?>:
[78] Fix | Delete
<?php printf( esc_html__( 'PHP Constant %s is supported.', 'litespeed-cache' ), '<code>LITESPEED_CFG_HTACCESS_BACKEND</code>' ); ?>
[79] Fix | Delete
<?php printf( esc_html__( 'You can use this code %1$s in %2$s to specify the htaccess file path.', 'litespeed-cache' ), '<code>defined("LITESPEED_CFG_HTACCESS_BACKEND") || define("LITESPEED_CFG_HTACCESS_BACKEND", "your path on server");</code>', '<code>wp-config.php</code>' ); ?>
[80] Fix | Delete
</font>
[81] Fix | Delete
</div>
[82] Fix | Delete
</td>
[83] Fix | Delete
</tr>
[84] Fix | Delete
</tbody>
[85] Fix | Delete
</table>
[86] Fix | Delete
[87] Fix | Delete
<?php if ( null !== $content ) : ?>
[88] Fix | Delete
<h3 class="litespeed-title">
[89] Fix | Delete
<?php printf( esc_html__( 'Current %s Contents', 'litespeed-cache' ), '.htaccess' ); ?>
[90] Fix | Delete
</h3>
[91] Fix | Delete
[92] Fix | Delete
<h4><?php echo esc_html( $htaccess_path ); ?></h4>
[93] Fix | Delete
[94] Fix | Delete
<textarea readonly wrap="off" rows="50" class="large-text"><?php echo esc_textarea( $content ); ?></textarea>
[95] Fix | Delete
<?php endif; ?>
[96] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function