WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
[resolved] Page Speed Specify image dimensions (stars) (9 posts)

  1. Doremdou
    Member
    Posted 1 year ago #

    Hello, I am using Page Speed and it says that:

    Specify image dimensions
    The following image(s) are missing width and/or height attributes.

    ...plugins/wp-postratings/images/stars_crystal/rating_half.png (Dimensions: 20 x 20)
    ...plugins/wp-postratings/images/stars_crystal/rating_off.png (Dimensions: 20 x 20) (11 uses)
    ...plugins/wp-postratings/images/stars_crystal/rating_on.png (Dimensions: 20 x 20) (13 uses)

    I really need to change that as it says that this is a high priority (my score for this is 0...)

    I will never change my stars design so, where can I specify the height(20px) and width(20px) ?

    Thank you a lot by the way for this awesome plugin!
    keep up the good work :)

    Dorem

    PS: sorry for my bad english ;o

    http://wordpress.org/extend/plugins/wp-postratings/

  2. Doremdou
    Member
    Posted 1 year ago #

    Please can someone help me...?
    thanks :(

  3. Sho-Down
    Member
    Posted 1 year ago #

    Curious about this as well, hope someone knows.

  4. Doremdou
    Member
    Posted 12 months ago #

    Hi Sho-Down, I found something which seems to work:

    in wp-postratings.php:
    line 1403 (for example) find:

    echo '<img src="'.$postratings_url.' ......>'

    add:
    width="20" height="20"

    like this:
    echo '<img width="20" height="20" src="'.$postratings_url.' ......>'

    and do that for each line with echo '<img src="...

    hope it helps

  5. Doremdou
    Member
    Posted 12 months ago #

    Just one thing, I don't know anything about code, I found this which seems to work for my problem, but I am not sure that this modification is needed everywhere with img src, so.... if someone know where it is useless and where not, please tell me :)

  6. teresax
    Member
    Posted 11 months ago #

    is correct

  7. Doremdou
    Member
    Posted 3 months ago #

    Hello,

    after 10 month I am back... is there a better solution for this problem by chance? ^^

    thank you!

  8. Lester Chan
    Member
    Plugin Author

    Posted 2 months ago #

    The reason why I don't specify any size is I want to make it easier for user to choose the ratings style without needing to worry about the size.

    If you want, the easiest way will be via CSS

    .post-ratings IMG { width: 16px; height: 16px; }

  9. Doremdou
    Member
    Posted 2 months ago #

    Hello Lester Chan thank you for your answer :)
    Yes of course I understand,
    thank you I think it will be easier with this fix after plugin updates haha!

    Thanks again,
    keep up the good work :)
    Dorem

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.