Skip to content

Commit f207f2c

Browse files
Changes
Moved the fix to ESI class(better fit the purpose) Fix wording
1 parent 9ef816f commit f207f2c

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/core.cls.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ public function init()
183183
$this->cls('Admin');
184184
}
185185

186-
// Show add/save widget form data
187-
if ($this->cls('Router')->esi_enabled()) {
188-
add_action('in_widget_form', array($this->cls('Admin_Display'), 'show_widget_edit'), 100, 3);
189-
add_filter('widget_update_callback', __NAMESPACE__ . '\Admin_Settings::validate_widget_save', 10, 4);
190-
}
191-
192186
if (defined('LITESPEED_DISABLE_ALL')) {
193187
Debug2::debug('[Core] Bypassed due to debug disable all setting');
194188
return;

src/esi.cls.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,19 @@ class ESI extends Root
4545
*/
4646
public function init()
4747
{
48+
$esi_enabled = $this->cls('Router')->esi_enabled();
49+
50+
if ($esi_enabled) {
51+
// Show add/save widget form data
52+
add_action('in_widget_form', array($this->cls('Admin_Display'), 'show_widget_edit'), 100, 3);
53+
add_filter('widget_update_callback', __NAMESPACE__ . '\Admin_Settings::validate_widget_save', 10, 4);
54+
}
55+
4856
/**
4957
* Bypass ESI related funcs if disabled ESI to fix potential DIVI compatibility issue
5058
* @since 2.9.7.2
5159
*/
52-
if (Router::is_ajax() || !$this->cls('Router')->esi_enabled()) {
60+
if (Router::is_ajax() || !$esi_enabled) {
5361
return;
5462
}
5563

tpl/esi_widget_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<p class="install-help">
7373
<?php echo __( 'Recommended value: 28800 seconds (8 hours).', 'litespeed-cache' ) ; ?>
7474
<?php echo __( 'A TTL of 0 indicates do not cache.', 'litespeed-cache' ) ; ?>
75-
<?php echo __('Minimum value is 30.', 'litespeed-cache'); ?>
75+
<?php echo __('Otherwise, minimum value is 30.', 'litespeed-cache'); ?>
7676
</p>
7777
</div>
7878

0 commit comments

Comments
 (0)