lscache_wp
lscache_wp copied to clipboard
ESI breaks enabled breaks widget updating in recent wodpress 5.5
I'm using the latest version of litespeed report number OSTZJQHS
When the ESI is enabled wp-customize-widgets class catches the changes to the following options in addition to widget_text
- litespeed.optimize.timestamp_purge_css
- litespeed.admin_display.messages
The print_r at line 2079L of $this->_captured_option shows the following array:
(
[litespeed.optimize.timestamp_purge_css] => 1598735444
[litespeed.admin_display.messages] => Array
(
[0] => <div class="notice notice-success is-dismissible"><p>Purged all caches successfully.</p></div>
[1] => <div class="notice notice-success is-dismissible"><p>Purged all caches successfully.</p></div>
[2] => <div class="notice notice-success is-dismissible"><p>Purged all caches successfully.</p></div>
)
[widget_text] => Array
(
...
[_multiwidget] => 1
)
)
At this point wordpress expects that only one option is captured.
This results in a response with an error message "widget_setting_too_many_options":
{"success":false,"data":"widget_setting_too_many_options"}
After having a closer look the only way for wordpress not to capture this option change is by making the option name start with "transient"
See is_option_capture_ignored
protected function is_option_capture_ignored( $option_name ) {
return ( 0 === strpos( $option_name, '_transient_' ) );
}
To fix this temporarily i've added additional test to check if option name starts with 'litespeed and this fixed the issue.