-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin Bar prevents Logged-In User caching from working #690
Comments
@renzms The way to disable the Admin Bar in WordPress is by calling See: https://github.com/websharks/comet-cache-pro/blob/160227/src/includes/classes/Plugin.php#L536 The current behavior is controlled only by a filter and not by a configurable plugin option that is exposed by the UI for the Comet Cache plugin. That's what we need next here. |
(edited and moved to PR here) |
Noting that the existing code that disables the admin bar only checks if As a result, the Admin Bar is not disabled right now when you enable Logged-In User Caching: if ($this->options['when_logged_in'] === '1' && $this->applyWpFilters(GLOBAL_NS.'_when_logged_in_no_admin_bar', true)) {
show_admin_bar(false); // Prevent admin bar from being cached.
} The available options now are So unless I'm mistaken, we need to update the existing code to include a check for if (($this->options['when_logged_in'] === '1' || $this->options['when_logged_in'] === 'postload') && $this->applyWpFilters(GLOBAL_NS.'_when_logged_in_no_admin_bar', true)) {
show_admin_bar(false); // Prevent admin bar from being cached.
} @jaswsinc If you could verify the above to confirm that I'm not missing anything, that would be great. |
Yes, I can confirm that is a bug. I'd change it to look for any non-empty value like this: if ($this->options['when_logged_in'] && $this->applyWpFilters(GLOBAL_NS.'_when_logged_in_no_admin_bar', true)) {
show_admin_bar(false); // Prevent admin bar from being cached.
} |
This is not used and not necessary. See wpsharks/comet-cache#690
Disabled is the recommended setting, so we should default to disabled. See wpsharks/comet-cache#690
Next Release Changelog:
|
Noting that the default behavior of this new option was changed during the RC period for this release. The default is now to leave the Admin Bar untouched, i.e., not disable the Admin Bar by default when Logged-In Users caching is enabled. See wpsharks/comet-cache-pro@e099423. @raamdev writes in #769 (comment):
Updated screenshot of the option panel (includes new copy and a bit more description): |
Comet Cache v160521 has been released and includes changes from this GitHub Issue. See the v160521 announcement for further details.This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#690). |
When Logged-In User caching is enabled in Comet Cache Pro, all pages on the site for a logged-in user are not cached by default, because by default WordPress has the WordPress Admin (aka the Toolbar) bar enabled for user for logged-in users, and the Admin Bar that adds a
wpnonce
to the page source on the front-end, which then disables Comet Cache caching.If Comet Cache disables the Admin Bar on the front-end of the site (when Logged-In User caching is enabled), this issue goes away.
So, when Logged-In User caching is enabled, Comet Cache should disable the WordPress Admin Bar for logged-in users (on the front-end of the site). There should also be an option in the Logged-In Users panel that allows site owners to override this (i.e., turn back on the Admin Bar when Logged-In User caching is enabled, in case they want to do that because maybe they're going to allow Nonce caching using
COMET_CACHE_CACHE_NONCE_VALUES_WHEN_LOGGED_IN
; see this article).The text was updated successfully, but these errors were encountered: