• Resolved ktsiterip

    (@ktsiterip)


    Hi
    I updated to the new version (4.1.0) a couple of hours ago
    However now its not showing at all
    I’ve cleared cache (I use Comet Cache – which was working fine before)
    I also disabled Comet Cache but still not having any luck!
    Should I clear WordPress Popular Posts own cache (not sure if that would make any difference)
    Thank you – and also thanks for such a good plugin!

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 53 total)
  • Thread Starter ktsiterip

    (@ktsiterip)

    PS I also updated to WordPress 4.9.6 at the same time

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @ktsiterip,

    However now its not showing at all

    I need some more details. What thing isn’t showing at all? (I’d check by myself but I’m not near a computer right now, I’m replying from my smartphone since it’s late here and I’m already in bed).

    Should I clear WordPress Popular Posts own cache (not sure if that would make any difference)

    No, that shouldn’t be necessary. If you do, you’ll lose your popular posts data.

    Thread Starter ktsiterip

    (@ktsiterip)

    Hi Hector!
    Sorry, here are some more details (my apologies)
    I have the widget (“WordPress Popular Posts”) in the sidebar of my site. The title of the widget is showing, but not the popular posts
    In the stats section of the plugin, I can see its logging posts with counts but its not displaying them at the front end
    Thank you!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Thanks!

    Alright, got a few questions for you:

    • Does this happen on every browser or just in a specific one?
    • Are you seeing any JS errors in the Developer console of your browser?
    • Are you seeing any errors in your server’s log? (see Debugging in WordPress for more details).
    • Does it still happen if you switch to another theme?
    • Is the “Ajaxify widget” option enabled? (Settings > WordPress Popular Posts > Tools, under Data).
    Thread Starter ktsiterip

    (@ktsiterip)

    Hi Hector
    So:
    Does this happen on every browser or just in a specific one?In Chrome, Firefox no Popular Posts – but in Edge it does appear to show
    Are you seeing any JS errors in the Developer console of your browser? Possibly this: “[Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as ‘passive’ to make the page more responsive. See <URL>
    22[Violation] ‘setTimeout’ handler took <N>ms
    jquery-migrate.min.js?ver=1.4.1:2 JQMIGRATE: Migrate is installed, version 1.4.1
    2jquery.cycle.min.js?ver=1.11.8:1 [cycle2] –c2 init–
    rocket-loader.min.js:1 [Violation] ‘load’ handler took 654ms
    rocket-loader.min.js:1 [Violation] ‘load’ handler took 727ms
    [Violation] Forced reflow while executing JavaScript took 248ms
    [Violation] Forced reflow while executing JavaScript took 31ms
    Are you seeing any errors in your server’s log? (see Debugging in WordPress for more details). None I can see
    Does it still happen if you switch to another theme? No – with a random theme that I previewed (Biznez Lite) it was ok….
    Is the “Ajaxify widget” option enabled? (Settings > WordPress Popular Posts > Tools, under Data). Yes

    Other – when I rollback the plugin to v4.0.13, it appears correctly again

    Thank you again for all your help

    Plugin Author Hector Cabrera

    (@hcabrera)

    Ok, it sounds like something from your theme might be causing a conflict with the plugin (or else it wouldn’t have worked on Biznez Lite).

    I’ll be back in a few hours. In the meanwhile, feel free to keep using version 4.0.13. I’ll leave a comment here to let you know when I’m online so we can continue debugging this.

    Thread Starter ktsiterip

    (@ktsiterip)

    Brilliant – thank you very much!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Good day, @ktsiterip!

    Whenever you have the chance, please upgrade to 4.1 again so I can have a look.

    Thread Starter ktsiterip

    (@ktsiterip)

    Hi there! I have upgraded now
    Once I do, nothing is displayed below the title (“Popular Stories”) of the widget
    Once again, thank you for your help!

    • This reply was modified 7 years, 11 months ago by ktsiterip.
    Thread Starter ktsiterip

    (@ktsiterip)

    Hi Hector
    Going on the info in the error console, I think I have found the reason – its Cloudflare’s Rocket Loader
    I have turned it off and now Popular posts are showing
    It would be good though if there was a way to make v4.1 and Rocket Loader work together – v4.0.13 seemed to work fine with Rocket loader

    I’ve read this:
    https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-
    but I’m not sure how to implement it

    • This reply was modified 7 years, 11 months ago by ktsiterip.
    • This reply was modified 7 years, 11 months ago by ktsiterip.
    Plugin Author Hector Cabrera

    (@hcabrera)

    I’m not really familiar with Cloudfare’s Rocket loader but that’s odd.

    • Was Rocket Loader enabled before the update? Ignore this, after re-reading your previous comment I guess the answer is “yes, it was enabled”.
    • Was Rocket Loader enabled when you switched to the Biznez Lite theme while using version 4.1?

    Please enable Cloudfare’s Rocket Loader again so I can see what’s going on, @ktsiterip.

    • This reply was modified 7 years, 11 months ago by Hector Cabrera.
    • This reply was modified 7 years, 11 months ago by Hector Cabrera. Reason: Edited the last paragraph to explicitly ask the OP to enable Rocket Loader
    Thread Starter ktsiterip

    (@ktsiterip)

    Hi Hector!
    Was Rocket Loader enabled when you switched to the Biznez Lite theme while using version 4.1? Yes it was
    I’ve reenabled it now so you can see the non appearing popular posts

    Plugin Author Hector Cabrera

    (@hcabrera)

    Thanks!

    Alright, add this to your theme’s functions.php file:

    function wp676541_exclude_scripts_from_rocket_loader( $tag, $handle ) {
    
        if ( 'wpp-js' == $handle ) {
            return str_replace( ' src', ' data-cfasync="false" src', $tag );
        }
    
        return $tag;
    
    }
    add_filter( 'script_loader_tag', 'wp676541_exclude_scripts_from_rocket_loader', 10, 2 );

    Apparently, the problem is that WPP’s new Ajax script is being executed before wpp-4.1.0.min.js is loaded and executed by Cloudflare’s Rocket Loader: according to their documentation, RL runs scripts on window.load while WPP’s Ajax script runs on DOMContentLoaded (which happens earlier, when the browser has completely loaded and parsed the HTML document).

    When you disable the Rocket Loader feature, scripts are executed in their original order which is why WPP can load its posts. What puzzles me though is the fact that WPP 4.1 loads its posts just fine on the Biz Lite theme even if Rocket Loader is enabled, but it doesn’t in your current one.

    The above function should instruct Rocket Loader to ignore WPP’s script. Remember to clear Comet Cache’s cache afterwards so changes are applied to your site.

    Thread Starter ktsiterip

    (@ktsiterip)

    Hi Hector!
    Adding that code to the bottom of my functions.php causes the site to go blank
    Let me just check I have it correct

    /* POPULAR POSTS FIX WITH ROCKET LOADER */
    
    function wp676541_exclude_scripts_from_rocket_loader( $tag, $handle ) {
    
        if ( 'wpp-js' == $handle ) {
            return str_replace( ' src', ' data-cfasync="false" src', $tag );
        }
    
        return $tag;
    
    }
    add_filter( 'script_loader_tag', 'wp676541_exclude_scripts_from_rocket_loader', 10, 2 )
    Plugin Author Hector Cabrera

    (@hcabrera)

    You have a missing semicolon after add_filter 😛

    add_filter( 'script_loader_tag', 'wp676541_exclude_scripts_from_rocket_loader', 10, 2 );

Viewing 15 replies - 1 through 15 (of 53 total)

The topic ‘WordPress Popular Posts not showing’ is closed to new replies.