Visibility conditions limitations and logical quirks

As we have been doing more challenging and complex websites with Cwicly, we have been facing certain limitations in the visibility conditions.

The first issue is that except for very simple cases, just being able to switch between AND / OR is not sufficient.

Example:

Display CTA section if -

  1. Pages are - Home, About or Contact Us
    AND
  2. Coming soon / Maintenance is not enabled
    OR
  3. User is admin

There are many cases where a sequence of AND / OR logic is required. So far, due to the full-featuredness of Cwicly (and a bit of ingenuity) we have managed to find a way to workaround these limitations, but ins some cases it creates unwanted technical debt and/or hacks.

The second issue is that it is unclear whether or not the AND / OR switch applies to the “Hide from guests” and “Hide from logged in users” toggles.

In our tests it doesn’t appear to be as we attempted switch to OR but this didn’t logically make a difference. We attempted to mitigate this but using a function return visibility condition for the logged in / out part. This led us to the next issue.

The third issue is with regards to the OR condition. Logically, if you have an OR, it implies that the opposite of the first condition must be true in subsequent conditions.

Example:

Display post content block if -

  1. Post is not protected
    OR
  2. User is logged in (and implicitly resource is not protected)

Out initial tests indicate that this doesn’t yield the desired / expected results.

Here are the exact conditions:

We’ve put this as feedback to see if there are already solutions for any of these issues and to determine whether they are bugs or feature requests so appropriate steps can be taken.

Environment info

  • WordPress version: 6.3.1
  • Cwicly Plugin version: 1.3.0.2

I’ve experienced the same limitation as you described, @StrangeTech. My scenario was similar: I wanted to display information on page only if certain ACF field is checked and only if the user role was “student”, or if the user role was “teacher”. I used a custom function to achieve this, but it would be great to have the ability to create sets of conditions. Each set could hold more than one condition with an AND/OR relationship, and you could also define an AND/OR relationship between the sets."

@Louis, when you have a moment, we will really value your input on this, particularly issues 2 & 3.

As this topic has come up again, I am just highlighting this post again.

@Louis, when you have a moment, let me know your thoughts as I believe there is potential to make the visibility conditions even more powerful and flexible based on the points above.