Update rating.class.php

Made it such that it will be compatible with plugins too.