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

  1. Doremdou
    Posted 3 years 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 :)


    PS: sorry for my bad english ;o


  2. Doremdou
    Posted 3 years ago #

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

  3. Sho-Down
    Posted 3 years ago #

    Curious about this as well, hope someone knows.

  4. Doremdou
    Posted 3 years 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.' ......>'

    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
    Posted 3 years 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
    Posted 3 years ago #

    is correct

  7. Doremdou
    Posted 2 years ago #


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

    thank you!

  8. Lester Chan
    Plugin Author

    Posted 2 years 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
    Posted 2 years 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 :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.