• Resolved NirodhaSoftware

    (@nirodhasoftware)


    This plugin would be perfect if it had an ability to close the banner. Please consider adding to future releases.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author rpetersen29

    (@rpetersen29)

    Hi @nirodhasoftware
    Thanks for the request. I have considered this in the past but it is a little more involved than one may think. Beyond the non-trivial CSS positioning and the javascript needed for closing the banner, many users need custom CSS in order to get the banner to fit with their theme. This custom CSS would need to be altered or disabled on a case-by-case basis. Since everyone’s theme is different this would prove very challenging for a large set of themes. Additionally I would need to implement some type of data storage in users’ browsers (most likely cookie storage) to ensure that the banner doesn’t show up again while the user is browsing the site. Cookie storage involves some GDPR issues, https://gdpr.eu/cookies/, which I don’t necessarily feel comfortable forcing upon users of this plugin. So given all of those factors I have never pursued this feature request.

    I have, however, given the necessary tools in the plugin to do this yourself if you were so inclined. You can place the HTML for a close button in the Simple Banner Text and then give it some custom CSS and Javascript in the Website Custom CSS and Website Custom Javascript sections. If you don’t have the pro features you can also download another custom CSS/JS plugin to implement that. As an alternative solution, there is also the ability disable the banner on specific pages so the banner is only seen where it’s most needed.

    If i get enough feedback about adding a close button in the future I may reconsider my stance, however with as of now 30,000+ active downloads I have only received this request a handful of times.

    Hi @rpetersen29

    I would also need the close button to display some corona lockdown infos… Maybe I’ll do it myself with some JS, but I do not have much time now. So consider this a +1 ??

    Anyway, related to:

    Additionally I would need to implement some type of data storage in users’ browsers (most likely cookie storage) to ensure that the banner doesn’t show up again while the user is browsing the site. Cookie storage involves some GDPR issues, https://gdpr.eu/cookies/, which I don’t necessarily feel comfortable forcing upon users of this plugin.

    For storing info in the browser it would be better to use local storage (or session storage) and handle it only with JS/CSS. In my opinion there is no need to send cookies to the server (which would also make Caching very hard).

    Plugin Author rpetersen29

    (@rpetersen29)

    @nachtigall These are good suggestions, i’ll start development of a close button feature. Glad you’ve found an alternative in the interim.

    Plugin Author rpetersen29

    (@rpetersen29)

    @nachtigall @nirodhasoftware
    Version 2.9.0 now has a close button feature. Future updates will allow some more customization of the button and an updated UI as the current structure is a bit overloaded.

    Wow, that’s fast. We will re-consider for the next time. However, since according to the FAQ this was done using a cookie, this is a showstopper for us: We use varnish (provided by our web hoster) in front of our wordpress for Caching. And whenever a Cookie (that is not Google Analytics or other well-known cookie) then the Caching will fail (“MISS”).

    So like I wrote before, for us it would be better if the browser’s localstorage would be used for this. https://medium.com/swlh/cookies-vs-localstorage-whats-the-difference-d99f0eb09b44 and by default the banner is hidden and only shown via JS when a certain localstorage setting (like “SimpleBanner_userClickedClose”) is not present.

    Anyway, thanks for the plugin. It is good to have choice. You might want to add also an FAQ item “Does this banner plugin offer a close button?” (Answer: YES) as I have seen this question pop up in other plugins’ support threads too and not many seem to offer it.

    Plugin Author rpetersen29

    (@rpetersen29)

    The speed of my development was partly in thanks to cookies so i could have an expiration system without having to roll my own, a feature only provided with cookies. I’ll add the option for localstorage or switch over completely in future updates. You appear to have a decent amount of knowledge about JS, so you probably know that the close button requires a button element and a click listener. That is all pretty simple, everything that involves updating a plugin to incorporate those features is what took the most amount of time. This is the main reason I delayed developing this feature until now because the bones of creating your own close button is available in Simple Banner right now.

    To expand on using a cookie, i’m not exactly sure how you’ve set up and i’m only reading the docs, https://varnish-cache.org/docs/3.0/tutorial/cookies.html, but if it just MISSES the cache and doesn’t delete it then the banner should work as intended. All cookie reading and banner manipulation is done first on the wordpress server and secondly on the javascript client as a failsafe. I imagine this is how your substitute Bulletin does it since it also uses cookies for the dismissal of the banner. You could read through their code to see that or just see that dismissing the banner on https://demo.bulletin.rocks/ sets a bulletinwp-dismiss-expiry cookie.

    yeah, don’t worry, I’ve found a solution by now. I surely could have done it myself with some JS but am short of time at the moment.

    Just for the record: We have no control over the varnish instance, it is provided by our hoster GANDI and has this setup, see here: https://docs.gandi.net/en/simple_hosting/common_operations/varnish_cache.html#cookies

    I know some other hosters use something similar, e.g. https://pantheon.io/docs/caching-advanced-topics

    But I understand that this is maybe not the usual setup.

    Plugin Author rpetersen29

    (@rpetersen29)

    Yeah so with that setup the simple banner cookie will be fine. The stripper looks for specific cookies which is why the Bulletin plugin’s cookies also work with your setup. Thanks for the info that was very interesting to look through.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Closed button?’ is closed to new replies.