Support » Plugin: Top 10 - Popular posts plugin for WordPress » Does not Count for some posts!

  • Resolved Navahang

    (@navahang)


    Hi,
    Thank you for great Plugin!

    I have notice the very unusual issue with the plugin!
    It does not count for the 90% of posts in one of the categories.

    For example it does count the visits for this post: Link , and for very similar post like this Link does nothing! both of this posts are in the same category. please note that I have no such an issue on other categories.

    Kind regards

    http://wordpress.org/plugins/top-10/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Ajay

    (@ajay)

    I don’t see anything wrong with the code. Do you have any of the category exclusions in place?

    What are the other categories that they do work on?

    Can you also try deselecting the option W3 Total Cache option?

    Navahang

    (@navahang)

    Thank you for reply!

    I do not have any category excluded!

    These are links from other categories:
    Link1 | Link2 | Link3

    Also I tried deselecting the W3 Total Cache option and it turns working after that only for logged in users, because W3 do not cache pages for logged in users, but after deselecting this option plugin does not work for rest of users (not logged in).

    Kind regards.

    Plugin Author Ajay

    (@ajay)

    To be honest, I’ve never seen a behaviour where only a certain category doesn’t track properly.

    Is there anything specific about this particular category?

    Navahang

    (@navahang)

    No, there is nothing specific about this particular category!
    I have checked the mySQl tables and I found out that there is no table for these post ids on top10-table! even I create the table manually for those posts, but still they don’t get updated!!!

    Plugin Author Ajay

    (@ajay)

    Navahang, there is little I will be able to do without access to the files to try and figure out what’s going wrong since this is really the first time that I’ve come across such a problem.

    Can you check your error_log file to see if there are any errors being generated by the plugin when you visit this category?

    Navahang

    (@navahang)

    Thanks for reply!

    You can download my error_log file from this Link and see if you can help me.

    Regards

    Plugin Author Ajay

    (@ajay)

    Hi, 4shared requires to have an account to download files so that link above doesn’t work for me.

    Can you check if there are any references to “tptn” or “top-10” or “addcount.js.php” in your error_log file?

    Also, I was also wondering if you can temporarily disable W3 Total Cache to see if the counting works. Just to test if its a problem with a clash between the plugins.

    Navahang

    (@navahang)

    I uploaded to my server now you can download it:
    Link

    Plugin Author Ajay

    (@ajay)

    I can’t see anything in the error logs. Were you able to test with disabling W3 Total Cache?

    Navahang

    (@navahang)

    I tried deselecting the W3 Total Cache option and it turns working after that only for logged in users, because W3 do not cache the pages for logged in users, but after deselecting this option plugin does not work for rest of users (not logged in).

    Plugin Author Ajay

    (@ajay)

    I mean if you deactive W3 Total Cache plugin temporarily to test.

    Navahang

    (@navahang)

    Yes, I tried deactivating W3 Total Cache also, but still doesn’t work!

    Plugin Author Ajay

    (@ajay)

    I’ve pretty much run out of most options.

    Please backup the files before you proceed.

    Can you try editting this piece of code in top-10-addcount.js.php ?
    I have just added some text which will be outputted on your page which we can see which part of the loop it is falling into.

    Change the following lines:

    if($id > 0) {
    	                $wpdb->query("INSERT INTO $table_name (postnumber, cntaccess) VALUES('$id', '1') ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ");
    	                $current_date = gmdate( 'Y-m-d', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );
    	                $wpdb->query("INSERT INTO $top_ten_daily (postnumber, cntaccess, dp_date) VALUES('$id', '1', '$current_date' ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ");
    echo 'document.write("<!-- In loop -->")';
    	        }
    echo 'document.write("<!-- Out loop -->")';
    	}

    Navahang

    (@navahang)

    I have edited the lines and now does not work at all!

    Plugin Author Ajay

    (@ajay)

    I created a gist with the code for the entire file.

    https://gist.github.com/ajaydsouza/79132481ca8e6fca0620

    Can you please give this a try.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Does not Count for some posts!’ is closed to new replies.