Subscribe via Feedburner Flickr Images Youtube Profile LinkedIn Profile
GD Affiliate Center

Optimization Guide #2

Thumbnail for Optimization Guide #2

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.

opt ajax Optimization Guide #2

AJAX Settings

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.

opt static Optimization Guide #2

Static Images Generator

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.

opt cache Optimization Guide #2

Cache

Fourth tip: enable cache support to speed up serving of static images.

That’s it for now, more tips will follow.

GD Star Rating
loading...

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
Optimization Guide #2, 7.6 out of 10 based on 41 ratings

5 Responses to “Optimization Guide #2”

  1. Lasse | July 13, 2009 at 7:31 AM

    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.

    GD Star Rating
    loading...
    • MillaN | July 13, 2009 at 12:30 PM

      Modify template to change the elements order. Other thing can be done using theme custom functions. All this is already discussed many times before.

      GD Star Rating
      loading...
      • Lasse | July 13, 2009 at 9:39 PM

        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

        GD Star Rating
        loading...
        • MillaN | July 13, 2009 at 10:21 PM

          You can use theme functions. Tomorrow I will release new version with updated info files on thumbs functions.

          GD Star Rating
          loading...
          • Lasse | July 13, 2009 at 10:42 PM

            Perfect, thanks!!

            GD Star Rating
            loading...

Comments are closed.

www.dev4Press.com

Dev4Press is a premium service dedicated to developing of high quality plugins and themes for WordPress, custom development and consulting. Follow this link to find out more...

Feedburner Feedburner updates

Sign up to receive all latest news about GD Star Rating directly to your email.
xScape Premium Themes