WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
All time -> average daily views problem (31 posts)

  1. jenseo
    Member
    Posted 2 years ago #

    Hey there!
    This plugin works perfect for me on my site, I've been running it for almost a year now and I'm very happy with it, except for one thing!

    When I try to change the settings to display all time combined with average daily views, the message Sorry. No data so far. displays.

    It works like a charm with all time combined with total views. All other combinations seems to work as it should as well (Last 30 days + Average daily views etc...)

    The site in question is http://webbhjalp.se (in Swedish, top 6 popular posts on the right, at the moment last 30 days + average daily views.)

    Any idea what the problem might be?

    Thanks for a great plugin!

    // Jens.

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jens,

    Sorry for the long delay. I'll be taking a look a this and report back and/or push a plugin update if necessary as soon as I can. It's been a while since I last took a look at WPP's code so it might take sometime for me to fix whatever needs some fixing.

    Thanks for stopping by!

  3. jenseo
    Member
    Posted 2 years ago #

    Thanks Héctor for your reply!
    I'm looking forward to hear about the solution!

    Take care!
    // Jens.

  4. jenseo
    Member
    Posted 2 years ago #

    Hey again Héctor,
    I just updated to the latest version of your plugin, and unfortunately now the thumbnails wont show in bigger size than like 20pixels or something anymore. I had them customized to be bigger.

    See the sidebar of http://webbhjalp.se

    Thanks!

    // Jens.

  5. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jens,

    That's not a bug. A few days back, the WordPress Team warned me that my plugin (and others as well, I suspect) was causing security issues to many blogs around because of the TimThumb script. This is a third-party php script my plugin was using to create thumbnails, however it appears that someone found a flaw and exploited it which is why I had to remove it.

    My plugin now relies on WordPress' Post Thumbnail feature (a.k.a. Featured Image) to let the users select their own thumbnails. Bad news is you'll have to select a featured image for all your popular posts, but first you'll need to add this two lines of code to your theme's functions.php file:

    // Enable post thumbnails
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(width, height, true);

    ... where width and height are the dimensions of your thumbnails. For example:

    // Enable post thumbnails
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(80, 80, true);

    I know this is annoying, so my apologies for the troubles caused.

  6. jenseo
    Member
    Posted 2 years ago #

    Hey Héctor,
    that's no problem, I already use that function on all my blog posts. The problem is, the plugin seems to resize the images, they are not being displayed the size they actually are...

    // Jens.

  7. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Mmm I think I know what the problem is. Please open wordpress-popular-posts.php, find this code (around line 717):

    $thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, array($tbWidth), array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ."</a> <!-- $tbWidth $tbHeight-->";

    ... and change it for:

    $thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, 'thumbnail', array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ."</a>";

    Let me know if it fixes your thumbnail issue, please.

  8. jenseo
    Member
    Posted 2 years ago #

    Thanks, that did the trick! :)

  9. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Good, I'll be sure to include this patch on the next release. Thanks for pointing that out!

  10. jenseo
    Member
    Posted 2 years ago #

    No problem! Thanks for a great plugin and for your help!
    // Jens.

  11. jenseo
    Member
    Posted 2 years ago #

    (I'm not changing to resolved, since my original question isn't resolved yet)

  12. cookieandkate
    Member
    Posted 2 years ago #

    Hi, I tried to add a link underneath my thumbnail list, only to find that my thumbnails shrunk from 108 pixel squares to 15 pixel squares after I updated my plugin settings.

    Then I implemented both code changes suggested above. I specified 108x108 pixels for my thumbnail image in my functions.php. While that did make the image bigger than 15x15 pixels like it was before, the images resized to 135x135 pixels, which is the size specified for thumbnails in my media settings. I don't want to change that size under media settings because 135x135 is the correct size for other thumbnails on my site.

    Had I known that trying to tweak the plugin this morning would cause so much trouble, I wouldn't have messed with it at all. Now it looks all wrong and I have spent over thirty minutes trying to fix it. :(

    If you don't have a solution, do you know when you will have an update for the plugin? I absolutely loved the way it looked before and would hate to remove it altogether for now.

    Thank you,
    Kate

  13. jenseo
    Member
    Posted 2 years ago #

    Hey Kate,
    you should be able to add a custom sized thumbnail to your functions.php file, and then specify it in the plugin.

    Add this to your functions.php file:

    add_image_size( 'popular-thumbnail', 108, 108, true );

    And then change this in your plugin file:

    $thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, 'thumbnail', array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ."</a>";

    To this:

    $thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, 'popular-thumbnail', array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ."</a>";

  14. cookieandkate
    Member
    Posted 2 years ago #

    Thank you so much for your help, Jens! I implemented your changes and they almost work just right, except that my images are no longer cropped into a square. So my horizontal images are 108 pixels high by 72 pixels wide, and my vertical images are the opposite! It's producing a collage-like effect in my sidebar: http://cookieandkate.com. Do you happen to know how to fix that?

  15. jenseo
    Member
    Posted 2 years ago #

    Just out of curiosity, what happens if you upload a new picture? It might be that you need to re-upload your pictures, since this only will apply to new pictures, not the ones already uploaded.

    There's a plugin that does this automatically, so you don't need to manually upload all pictures again, but first, try it by uploading a new picture to one of your popular posts.

    http://wordpress.org/extend/plugins/regenerate-thumbnails/

    // Jens.

  16. cookieandkate
    Member
    Posted 2 years ago #

    Thank you, Jens! I just re-uploaded each of the six featured images, cleared my cache, and it worked. I doubt that an older post will appear in the popular posts section, but I'll keep an eye out for it and re-upload the featured image for those posts if necessary. Thank you so much for helping me resolve this issue!

  17. jenseo
    Member
    Posted 2 years ago #

    No problem, glad I could help!
    Take care!
    // Jens.

  18. drwilson89
    Member
    Posted 2 years ago #

    This is very encouraging. I just logged back on to this thread after receiving a notice to check the thread.

    I found the code that Hector named, selected it and replaced it.

    He wrote: Please open wordpress-popular-posts.php, find this code (around line 717):

    $thumb = "ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, array($tbWidth), array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ." <!-- $tbWidth $tbHeight-->";

    ... and change it for:

    $thumb = "ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, 'thumbnail', array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ."";

    I did that, however, there are still no thumbnails visible.

    One of the entries above said to be sure to enable thumbnails. I checked and my theme is Twenty Ten, which has this line near the top:
    // This theme uses post thumbnails
    add_theme_support( 'post-thumbnails' );

    Do I need to add a size line of code as well? (You said for example,// Enable post thumbnails
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(80, 80, true);

    Now I am going to check this which was suggested by Jens:
    http://wordpress.org/extend/plugins/regenerate-thumbnails/

    It is a bit late so maybe I'll sleep on it. Maybe things will be different tomorrow.

    Cheers// Ralph

  19. drwilson89
    Member
    Posted 2 years ago #

    One final question: What size were the thumbnails prior to the deletion of Tim Thumb?

    I found those to be good. If I do a custom size, I'd like to have it be what you used to have, because it left room for enough text (though I'd like an option for more text if possible).

    Thanks!

  20. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Default size was 15x15 if I remember correctly.

  21. drwilson89
    Member
    Posted 2 years ago #

    Thanks, Hector. As I noted above, I changed the code:

    I found the code that Hector named, selected it and replaced it as I described above:

    He wrote: Please open wordpress-popular-posts.php, find this code (around line 717):

    $thumb = "ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, array($tbWidth), array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ." <!-- $tbWidth $tbHeight-->";

    ... and change it for:

    $thumb = "ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, 'thumbnail', array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ."";

    I did that, however, there are still no thumbnails visible.

    I just downloaded and used the Regenerate Thumbnails plug-in that had been mentioned above, and I then uploaded one of the posts, and still no thumbnails appear.

    Should I make other changes?
    Thank you for your managing this big event.
    //Ralph

  22. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hey Ralph,

    You gotta add each thumbnail using the Featured Image functionality on each post listed as popular by my plugin. Otherwise, WPP will keep displaying the default thumbnail image.

  23. drwilson89
    Member
    Posted 2 years ago #

    Thanks for the rapid feedback. I will have time in a short while to check and see if I can find a designated image link on all my posts. I looked earlier and could not find that control (I had seen it earlier on postings).

    My question is that WPP is not displaying any thumbnail image.

    Here is the site: http://naturalconnectionshealthcare.com/blog/

    I looked in the Media folder and perhaps I do not have permission to even see where the thumbnails are located. They are being generated because that media list is constructed of thumbnails.

    I will delete the image on one of my postings and then reinstall and maybe that will do the trick. Gotta eat dinner first. This is like a video game, invigorating. Thanks for the wisdom, Héctor!

  24. drwilson89
    Member
    Posted 2 years ago #

    No luck. I deleted the image on the Play As Medicine entry. Then uploaded it again, designated it as the featured image, then clicked save and it showed where it was supposed to show.

    But on the Popular Posts menu it does not show up.

    Sigh. Ready for new ideas.

  25. drwilson89
    Member
    Posted 2 years ago #

    I checked Properties on the blog posting's thumbnail "ghost" and it had this identifier for the non-visible thumbnail:
    http://naturalconnectionshealthcare.com/blog/wp-content/plugins/wordpress-popular-posts/scripts/timthumb.php?src=http://naturalconnectionshealthcare.com/blog/wp-content/uploads/2010/11/play_cover-150x150.jpg&h=50&w=50&zc=1

    Does that help you think about what might be amiss in generating and attaching thumbnails?
    Thanks

  26. drwilson89
    Member
    Posted 2 years ago #

    Oh... I just read the text and it says timthumb.php

    So an exorcism is in order. Right? How do I clean up the landscape?

  27. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    I already replied to this in another thread, however just in case someone else read this thread: the issue described by drwilson is resolved with WPP v2.1.6.

  28. drwilson89
    Member
    Posted 2 years ago #

    For the sake of completion and to compliment Héctor:

    The Exorcism is complete. No more "ghost" thumbnails; TimThumb has disappeared and my blog is now alive and functioning perfectly now that I updated with WPP v2.1.6.

    Best of the Fall and Year-End to all.

  29. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi jenseo,

    A short update on the original issue posted here (avg. views not displaying data). Today I finally sat down in front of my computer, found out why that setting wasn't working and fixed it. I will continue to test the patch in the next couple of days to make sure everything works as expected and then push a plugin update. Shouldn't take too long.

  30. gaming zone
    Member
    Posted 2 years ago #

    hi everyone

    this post is related to my issue

    i add more then one pic in post and when i share post on facebook via sharethis buttons,i only see 1 pic in thumbnail....mostly 1st pic of the post..its happend with my 2 sites

    my other site showing all pics in thumbnail

    plz its serious issue for me...i hope someone help me

    Site link: fbgamingzoon.com

    Thankyou

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic