Comments (17)
@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.
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
from htmly.
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.
@bttrx yes we should replace the old key to the new one, every post edit.
from htmly.
This commit 23c4427 should fix it.
from htmly.
I upgraded my HTMLy instance to version 2.8.6 today and views counter works as expected.
from htmly.
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.
@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.
from htmly.
@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.
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.
I updated and edited an earlier post's slug, the views are still correct. I'll keep an eye on it.
from htmly.
@thopanX just releasing new version to change the counter id from filename path to post/page.
from htmly.
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.
@thopanX I don't think nearly 1k views is the source problems, lets hope by changing the id will resolve this issue.
from htmly.
Yeah, fingers crossed.
from htmly.
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)
- RSS import failed HOT 3
- How to customize <title></title> HOT 12
- php-Warning in admin/updates HOT 2
- Can't edit or delete posts HOT 8
- Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string HOT 3
- Known issue: Does not support underscore character in username HOT 1
- Version 2.9.0 - i18n error HOT 11
- Looking to override some css HOT 7
- Feature request: TOC support HOT 5
- Feature request: Adding Mastodon to Social Media links, adding user verification HOT 2
- Installing Issue on armbian, lighty, HOT 5
- Question: HTMLy says server is offline for updates HOT 4
- Teaser break handling (<!--more-->) HOT 4
- Function of "Meta description character" in config HOT 2
- show More than post HOT 2
- I have added a translation into Croatian HOT 4
- New install of HTMLY as of 3/15/2024 HOT 3
- Is it possible to center an image / text ? HOT 2
- How to remove the search box ? HOT 2
- I can't install /ly/ not found HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htmly.