• Resolved Pat K

    (@blackcapdesign)


    On 3 separate and unrelated sites, conditional logic has simply stopped working when determining whether or not the visitor is logged in. I have tested this extensively using both the Roles tab > User Login State > Show only for Logged-in Users AND using the new Widget Options Snippets for conditional logic. Examples:
    is_user_logged_in()
    and
    (is_page(‘foo’) || is_page(‘bar’)) && (is_user_logged_in())

    Neither the Roles tab NOR conditional logic are working. What’s really odd is that I only noticed this after updating all plugins to the latest version (WordPress was already at version 7.0) and rolling back the updates made no difference – the problem persists.

    All 3 of these sites are working in conjunction with WP Simple Membership – in case it makes a difference. I’m using Widget Options to control the visibility of a menu in the right sidebar on “Member” pages. I has been working perfectly until a few days ago.

    I haven’t yet tested this on a fresh install of WordPress but will do so if time permits.

    Has anyone else noticed a problem with this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mej de Castro

    (@mej)

    Hi @blackcapdesign

    Thanks for reaching out to us.

    Do you have any caching plugin on the site or on server? This kind of issue mostly happens when there is a caching on the site because cached logged-out version of the page is what’s being served to logged-in users.

    Kind Regards,
    Mej, Widget Options Team

    Thread Starter Pat K

    (@blackcapdesign)

    Thanks for following up. I do have caching installed but I did extensive testing that included disabling caching and clearing the cache – it made no difference. Caching has been in place for ages and this problem is recent, so it looks to me like something else is going on. Oh well, I guess I’ll have to find a workaround other than using is_user_logged_in conditional logic.

    Plugin Author Mej de Castro

    (@mej)

    Hi Pat,

    Thanks for the additional information and for confirming you already ruled out page caching.

    Since both the built in “User Login State” condition and is_user_logged_in() are affected, it suggests the issue may not be specific to Widget Options. Our login visibility conditions rely on WordPress’ is_user_logged_in() function, so if that function is returning an unexpected result, Widget Options will behave the same way.

    All three affected sites are using WP Simple Membership. Just to help narrow this down, would you mind checking the following?

    • Does the issue still occur if WP Simple Membership is temporarily deactivated?
    • If you create a completely new widget using only the “User Login State” option, without any conditional logic, does it still appear incorrectly?
    • Does the issue happen with a default WordPress theme, such as Twenty Twenty-Six?

    If you’re comfortable doing so, a minimal test site with only Widget Options and WP Simple Membership installed would also help determine whether this is a compatibility issue between the two plugins.

    We’ll be happy to investigate further once we have a bit more information.

    Thank you,
    Mej

    Thread Starter Pat K

    (@blackcapdesign)

    Thanks for following up. It took me a while get around to cloning one of the affected sites and running tests. It turns out that the Widget Options plugin isn’t the source of the problem. Shortly before I noticed the conditional logic problem, I switched CAPTCHA filters and moved all 3 affected sites to Cloudflare Turnstile CAPTCHA and installed & configured Simple CAPTCHA with Cloudflare Turnstile. As soon as I disabled this new plugin – all of the original functionality (all is_user_logged_in() conditional logic) started working again.

    Thread Starter Pat K

    (@blackcapdesign)

    I forgot to include the link to the Cloudflare Turnstile related support thread in case this happens to someone else: https://wordpress.org/support/topic/breaks-is_user_logged_in-conditional-logic/#post-18967488

    Plugin Author Mej de Castro

    (@mej)

    Hi @blackcapdesign,

    Thanks for the update, and for letting us know that Widget Options isn’t the source of the issue.

    I’m glad you were able to narrow it down. If you have any other questions or need assistance in the future, please don’t hesitate to reach out.

    Have a great day!

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.