GithubHelp home page GithubHelp logo

Comments (17)

danpros avatar danpros commented on June 14, 2024 1

@thopanX that's great! I also checked that there were no problems, for example with PHP 8.3, so the latest release could be said to be very stable.

from htmly.

JPLeRouzic avatar JPLeRouzic commented on June 14, 2024

I proposed a correction that was never implemented.
On my website, this happens no more.
The problem is that there still are many bugs in HTMLy and it has evolved little in the last 10 years:
https://www.exakat.io/reports/8eYt0Nm0tLrz/?id=1977
image

from htmly.

bttrx avatar bttrx commented on June 14, 2024

I have found a bug in HTMLY, and that is whenever we edit a post and change any value, such as the tag, category, or date, after that all views are reset to -1.

This happens, because HTMLy's views counter depends on the filename of a post. Changing a post's tag, category, date, or slug, results in a different filename. Therefore your edited post is treated like a new one and has no views.

As a workaround you could edit this post's path in file views.json manually (using a simple text editor) after such change.

@danpros A proper solution would require HTMLy to update a post's path in views.json, whenever a post is saved after editing. Probably function edit_content() in system/admin/admin.php might be good candidate.

from htmly.

danpros avatar danpros commented on June 14, 2024

@bttrx yes we should replace the old key to the new one, every post edit.

from htmly.

danpros avatar danpros commented on June 14, 2024

This commit 23c4427 should fix it.

from htmly.

bttrx avatar bttrx commented on June 14, 2024

I upgraded my HTMLy instance to version 2.8.6 today and views counter works as expected.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

I've had a reset again yesterday. I didn't edit any slugs, categories or tags, just wrote a new post and manually entered the slug. It's the only thing I can think of which could be related.

2.9.0

from htmly.

danpros avatar danpros commented on June 14, 2024

@thopanX is it the whole views (any posts) or specific post? we need to rework the views it seems, like using route and not filename path as the ID.

Edit: or perhaps because of read and write the same times so it got corrupted. Try latest version, it has file lock when writing to a file, hope it can fix this issue, before we rework the views.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

from htmly.

danpros avatar danpros commented on June 14, 2024

@thopanX What about the contents of the views file? is the data about post visits still available? or all turn to -1? or worse, blank? it is possible that the file is corrupted and can't be read using json_decode.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

The views.json is there with entries for all my posts (from a swift glance). The numbers reflect the state after the reset. One post had over 1.500 views, but is at 53 now which can't be true. True in the sense that earlier views are not counted.
I'll try the latest version 2.9.1, thanks.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

I updated and edited an earlier post's slug, the views are still correct. I'll keep an eye on it.

from htmly.

danpros avatar danpros commented on June 14, 2024

@thopanX just releasing new version to change the counter id from filename path to post/page.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

Thanks, already updated. Alas, I've just found that the views have been reset again. I had checked on the views yesterday or the day before, when everything seemed fine.

One thing I remember: One of the blog posts had a view count close to 1,000, could that possibly trigger a reset?

from htmly.

danpros avatar danpros commented on June 14, 2024

@thopanX I don't think nearly 1k views is the source problems, lets hope by changing the id will resolve this issue.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

Yeah, fingers crossed.

from htmly.

thopanX avatar thopanX commented on June 14, 2024

I've added and edited slugs of two articles with no reset so far. Seems to be stable. Hopefully, we can put this issue to rest for good.

Thanks for your efforts!

from htmly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.