Support » Plugin: WordPress Popular Posts » Views not stored in database

  • Resolved Damienov


    On a localhost install of newest WP 4.8.2 and newest version of wp most popular plugin.

    Logging data on post view does not seem to store anything on both the database table. tracking.js is properly loaded on single post and no js errors found.

    Tried adding the tables entry manually, it shows the entry but view count does not update on page view.

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


    Hey there!

    I develop WPP on localhost and it works normally, so it’s definitely something on your end. However, with so little info from you it’s a bit difficult to tell what’s going on so let’s try this:

    1. Go to Settings > WordPress Popular Posts.
    2. Add &tab=debug to the URL in the address bar.
    3. Copy the info from the Debug screen and share it here.

    here ya go

    PHP version: 7.1.7
    PHP extensions: Core, bcmath, calendar, ctype, date, filter, hash, iconv, json, mcrypt, SPL, pcre, readline, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, xml, wddx, xmlreader, xmlwriter, apache2handler, openssl, curl, fileinfo, gd, gettext, mbstring, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, ftp
    Database version: 10.1.25-MariaDB
    InnoDB availability: DEFAULT
    WordPress version: 4.8.2
    Multisite: No
    Active plugins: Flexible Posts Widget 3.5.0, Pods - Custom Content Types and Fields 2.6.11, WordPress Popular Posts 4.0.9
    Plugin Author Hector Cabrera



    Everything seems in order to me. So, next:

    • Is Data Sampling enabled?
    • Install and configure Log Viewer and look for PHP warnings / errors.
    • Disable all the other plugins and check if WPP is able to update the views count of your posts & pages.
    • Check your site using a different browser and see if WPP registers your visits.
    • You removed the information about the theme. Is this a theme you’re developing?
    • Visit a post or a page with the console open and take a screen capture so I can check the output.
    Plugin Author Hector Cabrera


    Ah, another one: switch to a different theme (Twenty Seventeen, for example) and visit a post or a page. Was WPP able to log your visit?

    Found the culprit!

    it seems uBlock Origin is the culprit, it blocks the script named tracking.js.

    Perhaps change the js file name to wpp.js?

    Plugin Author Hector Cabrera


    It’s worth a shot. Please rename the file to wpp.js (find it here: wp-content/plugins/wordpress-popular-posts/public/js/) and update the filename in wp-content/plugins/wordpress-popular-posts/public/class-wordpress-popular-posts-public.php as well. Do a hard-refresh (ctrl+F5 / cmd+F5) or clear your browser’s cache and check again.

    Let me know if with that uBlock stops blocking the script. If so, I’ll include this change into the next release.

    no go unfortunately, uBlock Origins will still block the renamed js tracking code.

    edit: my bad renaming the file works as intended, have to do a full browser cache cleanup

    • This reply was modified 7 months, 3 weeks ago by  Damienov.
    Plugin Author Hector Cabrera


    I’m out of ideas, then.

    You can try asking the developer of uBlock Origins why his extension is blocking WPP’s tracking script. He may be able to pinpoint the cause and if it’s something I can fix then I’ll gladly do so. Until then, you either disable uBlock while you develop your project or use a different browser without uBlock installed on it.

    Edit: thanks for the update! That’s good news! Alright then, I’ll do a couple of tests to make sure everything works correctly and push an update with this change.

    It works just by renaming, I just need to fully clear my browser cache, hard refresh didn’t do it for me.

    Thank you for the quick response Hector!

    CSS/JS files named tracking, ad, adsense, etc. uBlock origin and other adblock plugins will always block them. Better is to rename tracking.js file to something else in the next release…

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Views not stored in database’ is closed to new replies.