• The total views count doesn’t updates, it’s always 1 views, while the today’s views updates instantly.

    I would like to both getting updated at same time.

    Plugin version: 2.5.6.

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

    (@ajay)

    Site URL? What setting do you have for tracker type?

    Thread Starter felzend

    (@felzend)

    There are screenshots below showing my settings.

    View post on imgur.com

    View post on imgur.com

    View post on imgur.com

    View post on imgur.com

    The following screenshot shows the current problem. My “Today’s views” updates normally, but my “Total Views” does not. A simple case is the one below, which shows my “Total Views” (1) always one and my “Today’s views” (22) updates normally.

    View post on imgur.com

    Plugin Author Ajay

    (@ajay)

    Two things to try:

    1. Change to Query based in the tracker type
    2. Check your table wp_top_ten in the database using phpMyAdmin to see that there are three columns and that you have a primary key

    I’ll still need the URL to test if the Total views tracking is giving an error, but I suspect it is.

    Thread Starter felzend

    (@felzend)

    Hello, sorry for all the time passed.

    I discovered that problem is because the plugin seems to be counting each view on the “total views” as one row, instead of using one row per post, like you can see on the following screenshot: https://i.imgur.com/POpanDR.png.

    This issue was causing slow query on the WordPress, so I put an index on the table and it’s very better now.

    But well, for solve this problem (since I wish to see both Total Views and Today Views on the Admin Panel and Today Views works okay) I modified the action that calls the function that runs the query to return the number of views, doing like this.

    remove_action( 'manage_posts_custom_column', 'tptn_value', 10, 2 );
            add_action( 'manage_posts_custom_column', [$this, 'tptn_value'], 10, 2);

    And for Total Count, I changed my query for this one.

    That’s not the correct way, but since the plugin is counting one view per row on “total_views” table, I needed to do this.

    SELECT postnumber, SUM(cntaccess) as sum FROM {$table_name} WHERE postnumber = %d AND blog_id = %d GROUP BY postnumber

    Plugin Author Ajay

    (@ajay)

    This could be a problem with the PRIMARY key. Can you check if this is missing in the table? and if so needs to be added. There is a button under tools that does this

    You can also use the button to “merge duplicate IDs”

    https://ps.w.org/top-10/assets/screenshot-9.png?rev=1820156

    Same thing is happening with my site. The total count has been working, but suddenly stopped a couple days ago. Daily counts are still registering. If I switch to Query Based type, will I lose the count that I already have? Any other suggestions?

    Thanks!

    Plugin Author Ajay

    (@ajay)

    @k-byte, you won’t lose counts if switching.

    Ajay (@ajay)
    1 month, 2 weeks ago
    This could be a problem with the PRIMARY key. Can you check if this is missing in the table? and if so needs to be added. There is a button under tools that does this

    You can also use the button to “merge duplicate IDs”

    https://ps.w.org/top-10/assets/screenshot-9.png?rev=1820156

    I have this problem, too. I tried the above and it did not fix the problem. The website is https://www.hopeprescott.com. Can you suggest a next step? I took the %totalcount% out of view so not to confuse visitors.

    • This reply was modified 6 years, 6 months ago by wdennis.
    Plugin Author Ajay

    (@ajay)

    Can you please try the below.

    First backup your database.

    Export the data from the tables wp_top_ten and wp_top_ten_daily using phpmyadmin or similar.

    Then deactivate and uninstall the plugin. Remember to select the options under General to delete everything. This should also delete both tables.

    Then do a fresh install of the plugin. Post this import the data back into the tables.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Total views doesn’t updates’ is closed to new replies.