Title: Does not Count for some posts!
Last modified: August 21, 2016

---

# Does not Count for some posts!

 *  Resolved [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/)
 * 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](http://www.navahang.com/playlists/darkoob-band-album-leyva/),
   and for very similar post like this [Link](http://www.navahang.com/playlists/sina-sarlak-album-key-miresad-baran/)
   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/](http://wordpress.org/plugins/top-10/)

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

1 [2](https://wordpress.org/support/topic/does-not-count-for-some-posts/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/does-not-count-for-some-posts/page/2/?output_format=md)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325472)
 * 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?
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325474)
 * Thank you for reply!
 * I do not have any category excluded!
 * These are links from other categories:
    [Link1](http://www.navahang.com/e/ebi/ebi-liel-kolet-i-can-hear-christmas/)
   | [Link2](http://www.navahang.com/g/golshifteh-farahani/steve-shehan-oracle-ft-golshifteh-farahani/)
   | [Link3](http://www.navahang.com/music-video/baran-100-baar/) – 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](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325486)
 * 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?
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325487)
 * 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](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325527)
 * 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?
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325528)
 * Thanks for reply!
 * You can download my error_log file from this [Link](http://www.4shared.com/file/x8ynJYqR/error_log.html)
   and see if you can help me.
 * Regards
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325529)
 * 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.
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325530)
 * I uploaded to my server now you can download it:
    [Link](http://navahang.net/navahang-remote/error/error_log.zip)
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325542)
 * I can’t see anything in the error logs. Were you able to test with disabling 
   W3 Total Cache?
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325543)
 * 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](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325548)
 * I mean if you deactive W3 Total Cache plugin temporarily to test.
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325550)
 * Yes, I tried deactivating W3 Total Cache also, but still doesn’t work!
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325551)
 * 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 -->")';
       	}
       ```
   
 *  Thread Starter [Siavash](https://wordpress.org/support/users/navahang/)
 * (@navahang)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325552)
 * I have edited the lines and now does not work at all!
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/#post-4325554)
 * I created a gist with the code for the entire file.
 * [https://gist.github.com/ajaydsouza/79132481ca8e6fca0620](https://gist.github.com/ajaydsouza/79132481ca8e6fca0620)
 * Can you please give this a try.

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

1 [2](https://wordpress.org/support/topic/does-not-count-for-some-posts/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/does-not-count-for-some-posts/page/2/?output_format=md)

The topic ‘Does not Count for some posts!’ is closed to new replies.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

 * 21 replies
 * 3 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/does-not-count-for-some-posts/page/2/#post-4325572)
 * Status: resolved