Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
Moved the fix to ESI class(better fit the purpose)
Fix wording
  • Loading branch information
timotei-litespeed committed Nov 7, 2024
1 parent 9ef816f commit a404c64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/core.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,6 @@ public function init()
$this->cls('Admin');
}

// Show add/save widget form data
if ($this->cls('Router')->esi_enabled()) {
add_action('in_widget_form', array($this->cls('Admin_Display'), 'show_widget_edit'), 100, 3);
add_filter('widget_update_callback', __NAMESPACE__ . '\Admin_Settings::validate_widget_save', 10, 4);
}

if (defined('LITESPEED_DISABLE_ALL')) {
Debug2::debug('[Core] Bypassed due to debug disable all setting');
return;
Expand Down
10 changes: 9 additions & 1 deletion src/esi.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ class ESI extends Root
*/
public function init()
{
$esi_enabled = $this->cls('Router')->esi_enabled();

if ($esi_enabled) {
// Show add/save widget form data
add_action('in_widget_form', array($this->cls('Admin_Display'), 'show_widget_edit'), 100, 3);
add_filter('widget_update_callback', __NAMESPACE__ . '\Admin_Settings::validate_widget_save', 10, 4);
}

/**
* Bypass ESI related funcs if disabled ESI to fix potential DIVI compatibility issue
* @since 2.9.7.2
*/
if (Router::is_ajax() || !$this->cls('Router')->esi_enabled()) {
if (Router::is_ajax() || !$esi_enabled) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion tpl/esi_widget_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<p class="install-help">
<?php echo __( 'Recommended value: 28800 seconds (8 hours).', 'litespeed-cache' ) ; ?>
<?php echo __( 'A TTL of 0 indicates do not cache.', 'litespeed-cache' ) ; ?>
<?php echo __('Minimum value is 30.', 'litespeed-cache'); ?>
<?php echo __('Otherwise minimum value is 30.', 'litespeed-cache'); ?>
</p>
</div>

Expand Down

0 comments on commit a404c64

Please sign in to comment.