ImprovementYuzo Related Posts – View Counter

  • Author
    Posts
  • Simon Edge
    Participant

    Firstly, I cannot find a search facility on this support page, and its a pain to go through 47 pages trying to find a similar support thread to try answer my question – you really should have a search feature.

    With your related posts plugin, I like your ‘Views Counter’ because its immune to the effects of caching – the counter is incremented irrespective of whether you have a caching plugin installed – many view counter plugins don’t actually work with caching, so well done (this is something I’ve been investigating).

    BUT: You shouldn’t increment the view count (or at least have an option to disable) if you are logged in as Admin. As an Admin developing&testing one may refresh a page/post many times which will skew the popularity results. An option to disable the counter increment code execution per role wouldn’t be too much of a mission to implement.

    ALSO: Can view counts come into play when ordering related posts – as an option? Your Related Posts plugin includes this View Count feature – it seems ‘logical’ to be able to show the most popular related posts (views) as you are storing this data in the ‘…_yuzoviews’ table?

    • This topic was modified 1 week, 6 days ago by  Simon Edge.
    #5870
    Simon Edge
    Participant

    I’ll probably end up editing your plugin code to meet my requirements – so if you would like to include my changes in a future release of your plugin let me know.

    (my WP plugin is Slide Anything – https://wordpress.org/plugins/slide-anything/)

    #5872
    Simon Edge
    Participant

    Had to get a fix out quick (on a deadline) to prevent view count increments if not logged in, so added a quick change to ‘yuzo_related_post.php’, line 44 onwards:

    		// MODIFIED BY SLD (SIMON EDGE) - DO NOT INCREMENT THE PAGE VIEW COUNT IF YOU ARE LOGGED IN
    		if (!is_user_logged_in()) {
    		// END OF CODE ADDITION - SLD (SIMON EDGE)
    			if( isset($yuzo_options->disabled_counter) && $yuzo_options->disabled_counter ){
    				null;
    			}else{
    
    				// ajax nonce for count visits in cache plugin
    				if(  ((defined( 'WP_CACHE' ) && WP_CACHE) ||  defined('WPFC_MAIN_PATH') ) && !is_user_logged_in() ){
    					add_action( 'wp_enqueue_scripts',  array( &$this, 'wp_yuzo_postview_cache_count_enqueue') );
    					add_action( 'wp_ajax_nopriv_yuzo-plus-views', array( &$this, 'hits_ajax' ) );
    					add_action( 'wp_ajax_yuzo-plus-views', array( &$this, 'hits_ajax' ) );
    				}else{
    					// count normal
    					add_action('wp_head',array( &$this,'hits'), 12 );
    				}
    			}
    		// MODIFIED BY SLD (SIMON EDGE) - DO NOT INCREMENT THE PAGE VIEW COUNT IF YOU ARE LOGGED IN
    		}
    		// END OF CODE ADDITION - SLD (SIMON EDGE)

    Modified version no of this file to ‘9.99.99’ to prevent update plugin notifications. Would be good if you implemented this change in a future release, then I can ‘de-branch’ 😉

    #5873
    Simon Edge
    Participant

    Sorry to keep bugging you…
    I’m assuming your view count is not ‘crawler/bot’ proof?
    (am looking at a clients site – they are using your plugin – and some of of the post view counts are in the 10s of thousands, which doesn’t tally with reality and Google Analytics)

    Maybe have a look at:
    https://github.com/JayBizzle/Crawler-Detect
    Looks pretty good and simple to implement – will prevent crawlers/bots incrementing the count.

    • This reply was modified 1 week, 6 days ago by  Simon Edge.
    #5874
    iLen
    Keymaster

    Hi,
    Firstly, I cannot find a search facility on this support page, and its a pain to go through 47 pages trying to find a similar support thread to try answer my question – you really should have a search feature.
    Soon I will release version 6.0 of the plugin will be totally different, there I think to redesign the support forum

    You shouldn’t increment the view count (or at least have an option to disable) if you are logged in as Admin. As an Admin developing&testing one may refresh a page/post many times which will skew the popularity results. An option to disable the counter increment code execution per role wouldn’t be too much of a mission to implement.
    You have this perspective because when you start testing the plugin you want to see the counter increase to work, anyway only the Pro version can disable the counter for administrators. http://prntscr.com/m3kimd

    Can view counts come into play when ordering related posts – as an option? Your Related Posts plugin includes this View Count feature – it seems ‘logical’ to be able to show the most popular related posts (views) as you are storing this data in the ‘…_yuzoviews’ table?
    Pro version

    I’m assuming your view count is not ‘crawler/bot’ proof?
    (am looking at a clients site – they are using your plugin – and some of of the post view counts are in the 10s of thousands, which doesn’t tally with reality and Google Analytics)

    I implemented it in another plugin, but in this I will do it too.


    As I said before, version 6.0 is coming, it’s new, completely another interface with the possibility of creating multiple related posts and not just one like the current version.

    • This reply was modified 1 week, 4 days ago by  iLen. Reason: update text
    #5881
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.