Plugin Support
qtwrk
(@qtwrk)
please try downgrade to previous version https://ww.wp.xz.cn/plugins/litespeed-cache/advanced/
see how it goes , if it happens on new but not on old , then we can try to narrow down the changes between versions.
I tested several previous version and everything worked till 6.3.0.1. The issue starts at 6.4. Well, at the very as far as my search page is concerned.
Hello @tetrakern
We added some changes to admin bar in 6.4 and is in regard of ESI.
They are added in esi.cls.php
remove_action('wp_body_open', 'wp_admin_bar_render', 0);
add_action('wp_body_open', array($this, 'sub_admin_bar_block'), 0);
Aprox line: 368
I compared the versions and the only changes that might affect youa are those above.
Thanks. So yeah, this line here is the cause:
remove_action('wp_body_open', 'wp_admin_bar_render', 0); // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198
If I remove that (and luckily I do not use Elementor), the bar is back. I should note that I do indeed have the wp_footer hook everywhere in the theme, so it’s not that. I’m not messing with wp_admin_bar_render either.
Perhaps checking whether Elementor is actually running might at least mitigate this? If that information is available at this point. I mean, doesn’t get to the root of the issue, but it’s something.
@tetrakern how do you show admin bar? using what action?
I’m using whatever WordPress uses by default. I have not changed how it’s added. I just mentioned wp_footer because that is what the plugin apparently uses:
// Add admin_bar esi
if (Router::is_logged_in()) {
remove_action('wp_body_open', 'wp_admin_bar_render', 0); // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198
remove_action('wp_footer', 'wp_admin_bar_render', 1000);
add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000);
}
@tetrakern please create a ticket by sending mail to: support at litespeedtech.com and ask to be assigned to a developer.
I am not assuming you made any “wrong code”, I just want to debug the code and search for a better solution.
That remove_action is needed to prepare ESI functionality on Admin bar.
We will continue the discussion in that ticket
Please send this thread link too
Thank you!