WordPress.org

Forums

WP-PostRatings
[resolved] Specify image dimensions Image Size (4 posts)

  1. Julian Magnone
    Member
    Posted 9 months ago #

    Hi,

    I am running GT Metrix and Google Page Speed tools to check the website performance and one of the recommendations I receive is "Specify image dimensions". Checking the images generated in the WP blog I could see that the recommendations are for the images displayed for WP PostRatings.

    "The following image(s) are missing width and/or height attributes."
    /wp-content/plugins/wp-postratings/images/stars/rating_half.png (Dimensions: 16 x 16) (5 uses)
    "Specifying a width and height for all images allows for faster rendering by eliminating the need for unnecessary reflows and repaints."
    This is marked as high priority in these tools.

    Is there any workaround to set the rating image height and width?

    Thanks,

    Julian

    https://wordpress.org/plugins/wp-postratings/

  2. Lester Chan
    Member
    Plugin Author

    Posted 9 months ago #

    Technically you need to modify the plugin wp-postratings.php.

    Find: class="post-ratings-image"
    Replace with: class="post-ratings-image" width="16" height="16"

  3. weezinged
    Member
    Posted 5 months ago #

    There are about 30 entries of 'class="post-ratings-image"'. Do I have to replace it for all of them?

    Thanks.

  4. Lester Chan
    Member
    Plugin Author

    Posted 5 months ago #

    Yes

Reply

You must log in to post.

About this Plugin

About this Topic