• Resolved mistersmoke

    (@mistersmoke)


    The popular posts plugin is working great on desktop. It’s displaying with thumbnails in a nice format, and seems to be tracking my views nicely.

    However, it won’t load at all on a mobile view. The “Popular Posts” heading is there, but underneath is just a continuously loading bar that never finishes. This happens on the home page and on any post page, but only on mobile. Any ideas what is causing this? I don’t have lazy load on.

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

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

    (@hcabrera)

    Hi @mistersmoke,

    The popular posts plugin is working great on desktop.

    (…) However, it won’t load at all on a mobile view.

    Actually, it’s broken for your site on desktop too:

    It’s most likely a compatibility issue with one of your other plugins.

    Could you please go to Settings > WordPress Popular Posts > Debug (link at the top center of the screen) and share the information listed there here? A screenshot or a simple copy&paste will do.

    Thread Starter mistersmoke

    (@mistersmoke)

    Ah, great. Here is a copy/paste of the debug screen:

    Plugin Configuration
    
    Performance Nag: Inactive
    
    Log Limit: No
    
    Log Views From: Visitors only
    
    Data Caching: Yes, 1 week
    
    Data Sampling: No
    
    External object cache: Yes
    
    WPP_CACHE_VIEWS: No
    
    System Info
    
    PHP version: 7.4.33
    
    PHP extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, litespeed, apcu, bcmath, dom, fileinfo, gd, imap, intl, json, exif, mysqlnd, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, soap, sockets, sodium, tidy, xmlreader, xmlrpc, xmlwriter, xsl, zip, ionCube Loader, Zend OPcache
    
    Database version: 10.5.20-MariaDB-cll-lve-log
    
    InnoDB availability: YES
    
    WordPress version: 6.2.2
    
    Multisite: No
    
    Active plugins: All in One SEO 4.4.0.1, BlossomThemes Toolkit 2.2.5, Chained Quiz 1.3.2.7, Google Analytics for WordPress by MonsterInsights 8.17, Recent Posts Widget Extended 2.0.2, UpdraftPlus - Backup/Restore 1.23.6, W3 Total Cache 2.3.3, WordPress Popular Posts 6.1.3
    
    Theme: Blossom Magazine (1.0.6) by Blossom Themes
    Plugin Author Hector Cabrera

    (@hcabrera)

    Thanks!

    Alright, so there’s an error message coming from a minified JS file created apparently by the W3 Total Cache plugin so let’s start there.

    Please try clearing W3 Total Cache’s cache and report back.

    Thread Starter mistersmoke

    (@mistersmoke)

    Thanks Hector.

    Caches purged. But the widget still appears to be stuck loading.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Alright, thanks for the update. Let’s try something else just to check whether the W3TC plugin is what’s causing this.

    #1 Add the following code snippet to your site (either via theme’s functions.php file or by using a plugin like Code Snippets):

    /**
     * Excludes WPP's script from W3TC's JS minification
     *
     * @param  bool    $do_tag_minification
     * @param  string  $script_tag
     * @param  string  $file
     * @return bool
     */
    add_filter( 'w3tc_minify_js_do_tag_minification', function($do_tag_minification, $script_tag, $file) {
    	$is_wpp_min_script = strpos($file, 'wpp.min.js');
    	$is_wpp_script = strpos($file, 'wpp.js');
    	
    	if ( false !== $is_wpp_min_script || false !== $is_wpp_script ) {
    		return false;
    	}
    
    	return $do_tag_minification;
    }, 10, 3 );

    #2 Flush W3TC’s cache the same way as before.

    If everything went well your popular posts list should load normally after this and you should also see WPP’s Js file being loaded on its own by your browser like so:

    Please report back your results.

    Thread Starter mistersmoke

    (@mistersmoke)

    Thanks Hector–let me know if you’re seeing differently, but that didn’t seem to fix the problem.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Thanks for the update, although I was pretty sure that’d fix it.

    Alright, let’s try something else:

    1. Go to Plugins > Plugin File Editor and select WordPress Popular Posts using the dropdown at the right of your screen.
    2. Click on assets/js/wpp.min.js to edit this file.
    3. Replace the contents of the .js file with this version (it’s the same code, except it’s less “uglified”).
    4. Scroll down and click on Update File to save changes.
    5. Clear W3TC’s cache once more and check again.

    Please report back your results.

    Thread Starter mistersmoke

    (@mistersmoke)

    Thanks Hector–that appears to be working now!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Terrific, thanks for reporting back!

    I can confirm that it’s working, just checked your site and everything’s well which is great news.

    I’ll push a new update with this change soon so thanks for helping test this out.

    • This reply was modified 2 years, 11 months ago by Hector Cabrera. Reason: Reworded things to make my comment less redundant
Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Popular posts widget not loading on mobile only’ is closed to new replies.