Closed SGr33n closed 6 years ago
I am hesitant to change this because the default behaviour is use_ajax = 1 https://github.com/lesterchan/wp-postviews/blob/master/wp-postviews.php#L957, so if this is released, the default behaviour will change for uses who are not using cache. when the page refresh, there will not be a +1 increment immediately as the ajax happens after the page is loaded.
Not sure what is the best way of doing it. Maybe have a filter to overwrite it for developers while keeping the existing behaviour will be a better way.
Hi, a filter could be ok, but think about it. I consider that today websites, without JavaScript, would not work at all, and the possibility that a user doesn't have Ajax working is pretty low, so having Ajax as default could be a better choice. Then, working asynchronously, the impact on the performance is also better.
Yea I understand that AJAX is better but the thing is it would change the behaviour of the plugin that has not been change for years. A good example is they will get lesser views because if search engine bots crawl on the site, the AJAX request will not be sent.
I see you made it, good ;)
As discussed on the support forum, there are caching methods that doesn't require WP_CACHE to be true. Think of Nginx FastCGI cache, or to Redis. To understand the importance for your plugin to be compatible with Nginx just think at the wordpress.org server, that is right Nginx. This will enable the Ajax options for everyone, even if WP_CACHE is false, that is not so bad.
Thanks!