• Resolved uniqcode

    (@uniqcode)


    Thankyou for an excellent and useful plugin.

    I have found that the Alert Button does not work. This appears to be due to a bug in functions.php.

    In the function get_alertbutton(), an inline stylesheet is generated as follows:

    
        <style>
            .zhours_alertbutton {
                color: <?= $color; ?>;
                background-color: <?= $bg_color; ?>;
            <?php
             if ($hide && get_current_status()) {
             ?>
                display: none;
            <?php } ?>
                display: none;
                padding: <?= $size; ?>px;
                font-size: <?= $size; ?>px;
                line-height: 1;
            }
        </style>
    

    Note that display:none is always specified. It is specified twice if the if ($hide && get_current_status()) condition is met.
    I believe the second display:none is erroneous and should be removed, so that the button is only hidden when the condition is met. I have done this on my local install and it works.

    There again, I’m not sure why the plugin generates the button in a hidden state in that case, when it could just not bother to generate it at all… I can’t think of any situation where I might want the Alert Button to start in a hidden state and then appear sometime after the page has loaded.

    I also suggest removing the line-height. It seems unnecessary, and plugins should only set absolutely necessary CSS in inline/enbedded styles, to avoid trampling over the theme’s CSS and requiring the addition of !important overrides to restore it.

    Thanks again.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bizswoop

    (@bizswoop)

    Great to hear you enjoy the plugin.

    Thank you for the feedback and flagging this to us. We really appreciate the detailed overview, specific code snippets and potential issues you raise. This is extremely helpful for us to evaluate and review. We have added this item to our issue queue to review based upon the information you shared here. We are always looking to improve the plugin and code refactoring efforts as our development efforts continue.

    We’ll leave this support forum post open until we’ve evaluated fully and follow-up with comments and any code optimization plans for an upcoming release.

    Plugin Author bizswoop

    (@bizswoop)

    In our latest version 4.0.5 we have reviewed and optimized the code based upon your feedback. Addressing the display:none and line-height items to avoid or reduce any theme conflicts.

    Again, thanks for raising the support forum post, we appreciate the feedback.

    Thread Starter uniqcode

    (@uniqcode)

    Hi,
    Sorry but it’s still broken, just for a different reason ??
    You now have the alertbutton div wrapped in an incorrect conditional.
    This patch removes it to fix the problem:

    
    --- a/functions.php
    +++ b/functions.php
    @@ -126,11 +126,10 @@ function get_alertbutton() {
                 font-size: <?= $size; ?>px;
             }
         </style>
    -    <?php if ($hide && get_current_status()) : ?>
             <div class="zhours_alertbutton">
                 <?= $text; ?>
             </div>
    -    <?php endif;
    +<?php
     }
    
     function is_enable_cache_clearing() {
    

    Also, I note that your changelog since 4.0 has been repeating everything from the previous version, which makes it hard for people to know what has changed between versions. And for the 4.0.5 release, it is actually just the 4.0.4 changelog again including the version number…

    Plugin Author bizswoop

    (@bizswoop)

    Thanks Ben for the additional code audit review. Our Development and QA team will evaluate.

    As for the change log, we normally post the same change log with updates as part of hot fixes that occur before the majority of users upgrade to the latest version, especially given the promotion to 4.0.

    However, 4.0.5 was going to be the first change log only based upon the update, but we accidentally checked into SVN the draft change log. We pushed an update now to the change log to avoid any confusion on version upgrade to 4.0.5 and calling out the sub menu change.

    Thanks for catching that for us ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BugFix: Alert Button is always hidden’ is closed to new replies.