justintadlock / entry-views

A WordPress plugin for tracking the number of views a post gets.
23 stars 7 forks source link

Validate Before Incrementing Views #4

Open maimairel opened 9 years ago

maimairel commented 9 years ago

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!

justintadlock commented 9 years ago

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.

maimairel commented 9 years ago

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).

justintadlock commented 9 years ago

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.

maimairel commented 9 years ago

Hi,

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

maimairel commented 9 years ago

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 :)

justintadlock commented 9 years ago

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.