• Hi all,

    Cloudflare WordPress Plugin version 3.1.0 changelog:

    Disabled showing WordPress Admin Bar and Edit Post Link to avoid caching problems for users using HTML Caching.

    We’ve disable these two sections in your blog regarding of people who are using Cache Everything Page Rule to make their site even faster.

    This page rule enables Cloudflare to cache the HTML of your website. It’s much much faster compared to normal caching but there is a downside where the blog manually need to purge Cloudflare cache everytime a page is edited.

    We recommend users with Cache Everything page rule to use Automatic Cache Purge feature of the plugin which purges Cloudflare cache without user intervention.

    Disabling Admin Bar and Edit Post Link would allows users guaranteeing to see the blog content without admin features.

    For users who would like to re-enable Admin Bar and Edit Post Link can do the following.

    Prerequisite: Access to your server is required.

    1) Open the file path_of_wordpress/wp-content/plugins/cloudflare/cloudflare.loader.php
    3) Edit lines 27 and 28 by putting “//” (two slashes) in the beginning of the lines.

    https://github.com/cloudflare/Cloudflare-WordPress/blob/master/cloudflare.loader.php#L27-L28

    It should look like

    //add_filter('show_admin_bar', '__return_false');
    //add_filter('edit_post_link', '__return_null');

    In the next version we’ll target disabling these features only for the intended target.

    If you have any concerns or suggestions please leave a comment.

    Thanks.
    -furkan

Viewing 15 replies - 1 through 15 (of 23 total)
  • George

    (@quantum_leap)

    Disabling Admin Bar and Edit Post Link would allows users guaranteeing to see the blog content without admin features.

    I still don’t understand what does the admin bar have to do with the the caching mechanism and I think the above sentence was not written well.

    Thread Starter thellimist

    (@furkan811)

    Hi @quantum_leap,

    To clarify this case is only true for users who have Cache Everything page rule enabled.

    For the first visitor to visit the URL the origin server will serve that webpage. For the second visitor to visit the same URL, the content will be cached in Cloudflare servers and it’ll be served from there.

    If the first visitor is logged with an admin account, Cloudflare will cache the page served to that user. Following visitors will the cached content which has the admin bar.

    • This reply was modified 8 years, 4 months ago by thellimist.
    • This reply was modified 8 years, 4 months ago by thellimist.
    George

    (@quantum_leap)

    Ok I see. So the next plugin version will disable the admin bar only if there is Cache Everything page rule applied? I can see how it could be potentially dangerous. Couldn’t the plugin try and create a rule to exclude the admin when it is installed or warn the user if he/she hasn’t any rules available?

    Respectfully, guys… this is the 2nd breaking change released into the wild recently. The filters as written are giant bazookas that simply turned off the admin bar in its entirely, not just “for anonymous users” as the comment above them indicates.

    Was this just not tested thoroughly enough, or did someone actually think that this was acceptable behavior? One of the primary usability features of the admin bar is the ability to browse to a page of your website and “Edit Page” from there, you can’t simply REMOVE that for anyone who has the CloudFlare plugin installed. That NEEDS to be wrapped inside of some type of conditional logic.

    @dmchale,

    In this case it was a little both. The intended functionality is for this was for the hook to only fire if Automatic Full Cache Management was enabled. The reason we didn’t catch it during testing wasn’t because we thought it was acceptable behavior but because we didn’t realize it wasn’t acceptable behavior, if that makes sense.

    We’ll have a fix tomorrow. Again, sorry about the problems this has caused.

    Thanks,
    John

    Thread Starter thellimist

    (@furkan811)

    Hi all,

    We’ve released 3.1.1 fixing the issue. Admin bar is hidden behind Automatic Cache Purge functionality.

    Sorry for any trouble this may have caused.

    Thank you for all your feedback.

    thanks for your support.

    But still i don’t see admin bar and edit link on my website when the (Automatic Cache Purge functionality) is enabled.

    i have CloudFlare Version: 3.1.1

    and when i disable (Automatic Cache Management), the admin bar returns.

    • This reply was modified 8 years, 4 months ago by fidajan.

    I was surprised when the admin bar suddenly disappeared after I updated cloudflare. The admin bar is pretty important, especially for administrator, editors, and authors. And those users shouldn’t be served cached pages to begin with…

    I wouldn’t mind if the admin bar is disabled for subscribers, contributors, or any other roles, in fact, I’ve been looking into how to disable the admin bar for said users. But definitely not for users who have publishing rights.

    Thread Starter thellimist

    (@furkan811)

    Hi @fidajan,

    Automatic Cache Management Enabled disables admin bar.
    Automatic Cache Management Disabled brings back admin bar.

    Hi @silvalau,

    You are correct. There’s a complete solution for Enterprise users with “Bypass cache on Cookie”.

    Feel free to reach me if you have more questions or feedbacks.

    Thanks

    @silvalau

    You can accomplish that by using the show_admin_bar filter being used here, and wrapping it inside a Role check of the current user

    $user = wp_get_current_user(); 
    $hide_admin_bar_array = array ('subscriber', 'contributor' ); 
    if ( array_intersect( $hide_admin_bar_array, $user->roles ) ) {
      add_filter( 'show_admin_bar', '__return_false' );
    }
    

    Throw that code inside a function and attach it to the hook of your choice, and you should be good to go ??

    • This reply was modified 8 years, 4 months ago by Dave McHale. Reason: code formatting
    • This reply was modified 8 years, 4 months ago by Dave McHale.
    • This reply was modified 8 years, 4 months ago by Dave McHale.

    @dmchale thanks, that worked like a charm

    @silvalau anytime, happy to help! (and sorry for the threadjack, OP)

    Does this mean that prior to this; if an admin was the first to visit a page whilst using the admin bar, then that page would subsequently show the admin bar to a non admin user because it was cached??? This sounds a pretty serious loophole to me – although I presume they would be denied entry to the links because not logged in as admin? @furkan811

    The above drove me crazy for 2 hours last night after the bar and edit disappeared so I ended up rolling back to 3.06. Note to self – read release notes first.

    Thread Starter thellimist

    (@furkan811)

    Hi @jonave,

    This sounds a pretty serious loophole to me

    This is a feature which is not enabled by default. It is not a loophole. It’s just the pros and cons of the feature. I use Cache Everything page rule on my personal static websites since it takes %99.99 of the traffic from my personal server to Cloudflare.

    I presume they would be denied entry to the links because not logged in as admin?

    Yes, they’d be denied.

    I ended up rolling back to 3.06

    You can update to 3.1.1 where admin_bar will only be disable if Automatic Cache Management enabled.

    thanks @furkan811 – that’s clearer now!

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Anouncement: Disabling Admin Bar’ is closed to new replies.