
After you have set JavaScript and CSS settings according to my recommendations from the first optimization post, now is the time to look at some other settings. So, here are the settings for AJAX, cache and static image generatior.
AJAX
Version 1.4.6 of the plugin added few extra security validation of the data received, but there are few more things you might wanna try. WordPress provides additional nonce security protection that can be used with this plugin.
First tip: enable nonce protection.
If you notice some problems with AJAX calls security, please report it, and I will work on improving it further.
Static Images
When plugins need to show static ratings in the widget or for the average values, it doesn’t use active rating blocks, because there is no need for user interaction, they just need to see the rating. At first, static results were generated using 2 nested DIVS, but that was known to make problems with some themes, and always required some CSS tweaking. So I created rating image generator that renders an image representing the rating. Generator even supports fully transparent PNG’s. So, when static block is displayed, user is served with actual image.
Second tip: use graphics generator for static images.
But, generator works based on the number of parameters send as the part of the URL, and anyone can form the URL and request image from your website. And you and you should prevent this from happening, and images will be served only for request coming from your website pages. This will not affect RSS feed ratings requests if you integrate rating block into RSS feed items.
Third tip: prevent outside access to graphics generator.
Cache
Right now cache is used only for static generated images, but it will be used for charts too. If you enable cache, images will be stored in the plugins folder in wp-content (not plugins folder). This way, rating image will be generated once, and served from this location, and save the processing time. Cache can be cleared using Tools cleanup option, or you can set auto cleanup. Typical rating block with fully transparent PNG’s takes 2-3 KB’s so it will not going to take too much space.
Fourth tip: enable cache support to speed up serving of static images.
That’s it for now, more tips will follow.
loading...






Comment Link
Thanks for a great plugin
How do I get the rating stars and rating text to be on the same line? And I can’t figure out how to move the rating up in the title div of each post.
loading...
Comment Link
Modify template to change the elements order. Other thing can be done using theme custom functions. All this is already discussed many times before.
loading...
Comment Link
Hi,
I used the new awesome thumbs up/down feature to fix my one line problem. But I have searched on title here and on other forums and can’t find out how to implement the rating in the title of the post and not in the content of the post.
Could you give me a hint to where I should look?
Thanks again
loading...
Comment Link
You can use theme functions. Tomorrow I will release new version with updated info files on thumbs functions.
loading...
Comment Link
Perfect, thanks!!
loading...