entry-views icon indicating copy to clipboard operation
entry-views copied to clipboard

Validate Before Incrementing Views

Open maimairel opened this issue 10 years ago • 6 comments

Hi,

Great plugin, it is simple and doesn't try to do anything like the other ones available in the plugin repo. However, it is missing the functionality to prevent logged in users in incrementing the views, and if you refresh a page multiple times it always adds the views count.

Do you have any plans to add this feature? By adding this validation the plugin will be perfect!

Thanks!

maimairel avatar Jul 09 '15 18:07 maimairel

Are you asking for the feature to disable the plugin from counting views of logged in users? I suppose I could add in a hook to conditionally disable it.

A bit confused because of the term "validation" used.

justintadlock avatar Jul 09 '15 19:07 justintadlock

Yes, that's what I mean. Validation is to validate before incrementing the view whether the user is logged in and whether the last time a user visits the page is not shorter than a specified time (via a cookie maybe).

maimairel avatar Jul 09 '15 19:07 maimairel

I probably won't build the feature directly in the plugin, but I can probably build in a hook like so:

if ( apply_filters( 'entry_views_do_count_update', true ) ) // Only run if TRUE

That would allow developers to selectively disable it. That way, there's far more potential for when you can enable/disable the view count to update.

justintadlock avatar Jul 09 '15 19:07 justintadlock

Hi,

That would be great :) Looking forward for the plugin update!

maimairel avatar Jul 09 '15 20:07 maimairel

Hello,

How about this issue?

Also, this plugin generates a deprecated notice on WordPress 4.3 by calling $this->WP_Widget in the constructor.

Thank you :)

maimairel avatar Aug 18 '15 21:08 maimairel

I'll probably add the new feature in at some point in the near-ish future. Honestly, this plugin is low on my priority list at the moment.

justintadlock avatar Aug 18 '15 22:08 justintadlock