• Resolved nanickore

    (@nanickore)


    Hi!

    The plugin has been working perfectly for almost a year on my website, but suddenly it won’t catch the posts data anymore. I’ve already tried to reinstall it but the error persists. Why is it not cathing the post data?

    Here’s my website. The plugin should be displayed at the right sidebar, right after “Mais Lidas”.

    https://universodavitoria.com.br/

    Thanks a lot for the help!

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

    (@hcabrera)

    Hi there!

    Just checked one of your posts and it seems that WPP was unable to insert its tracking script into theme’s <header> section, needed to track visits. Do you have a caching plugin installed on your site? If so, flushing its cache once should fix the issue. Otherwise please check this FAQ.

    Thread Starter nanickore

    (@nanickore)

    Hector, could you please check out now? I’ve deactivated all cache plugins but the error persists. Ps.: on the sidebar, it is showing a list of the most visited posts, but it’s from a different plugin that I’m using as a substitute. But I still prefer yours since it displays the posts count per day, week and month. Thanks for the help!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi!

    I’m a bit busy at the moment, I’ll stop by in a couple of hours and poat back my findings here ??

    Plugin Author Hector Cabrera

    (@hcabrera)

    It seems that you’re either using a modified version of the WPP plugin, or that another plugin or your theme is messing around with WPP. I found this in the source code of your site:

    <!-- WordPress Popular Posts v3.3.4 -->
    <script type="text/javascript"> execOnReady(function(){
    
        var sampling_active = 0;
        var sampling_rate   = 100;
        var do_request = false;
    
        if ( !sampling_active ) {
            do_request = true;
        } else {
            var num = Math.floor(Math.random() * sampling_rate) + 1;
            do_request = ( 1 === num );
        }
    
        if ( do_request ) {
    
            /* Create XMLHttpRequest object and set variables */
            var xhr = ( window.XMLHttpRequest )
              ? new XMLHttpRequest()
              : new ActiveXObject( "Microsoft.XMLHTTP" ),
            url = 'https://universodavitoria.com.br/wp-admin/admin-ajax.php',
            params = 'action=update_views_ajax&token=47032ab801&wpp_id=3264';
            /* Set request method and target URL */
            xhr.open( "POST", url, true );
            /* Set request header */
            xhr.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
            /* Hook into onreadystatechange */
            xhr.onreadystatechange = function() {
                if ( 4 === xhr.readyState && 200 === xhr.status ) {
                    if ( window.console && window.console.log ) {
                        window.console.log( xhr.responseText );
                    }
                }
            };
            /* Send request */
            xhr.send( params );
    
        }
    
    }); </script>
    <!-- End WordPress Popular Posts v3.3.4 -->

    The execOnReady function at the beginning of the script isn’t part of the plugin. And it appears not to be working either anyways since WPP’s script is not being executed at all. Remove that and WPP will be able to track your posts and pages without problem.

    Modifying plugin’s code directly isn’t recommended either. Future upgrades will overwrite whatever changes made to it.

    Thread Starter nanickore

    (@nanickore)

    But where is that code located? I’ve searched for it on wordpress-popular-posts.php but could not find it.

    Plugin Author Hector Cabrera

    (@hcabrera)

    You can find it inside the wordpress-popular-posts.php file, in the print_ajax() method starting line 1349 (WPP version 3.3.4).

    hi all, i have the same problem, i clear my website hosting cache as well as the WPP cache yet i keep getting the “No data so far” message.

    on my local server (using xampp) it is working fine, but when i have uploaded it to my godaddy account problem started.

    i am using WPML plugin on both local and liveenvirinment, as i wrote – on the local env its running just fine.
    i have disabled WPML but that also didnt help

    • This reply was modified 8 years, 2 months ago by yos.c.bd.
    Thread Starter nanickore

    (@nanickore)

    Hector, I’ve deleted that part of the code but the error persists :/

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    Just checked your site again and WPP’s tracking script is still missing. Did you clear your “website hosting cache” already?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘“Sorry, no data so far” error persisting’ is closed to new replies.