Support » Plugin: WP-PostRatings » ReferenceError: ratingsL10n is not defined

  • Resolved Hell_Lord

    (@hell_lord)


    I was having these two problems with the plugin on my website ratings_off is not defined | current_rating is not defined.

    They were solved by adding this line to the header of the site theme <script type=”text/javascript” src=”http://www.jogossexo.net/wp-content/plugins/wp-postratings/postratings-js.js”></script> but now it is giving this error ratingsL10n is not defined

    Any chance anyone know what this is about? Since I unfortunately could not resolve this error =/

    By the way, sorry for my english, I’m using google translator because the English is not my native language.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Lester Chan

    (@gamerz)

    I did this and still did not solve the problem

    EDIT

    Had not tested before posting this, thanks for the help 🙂

    Plugin Author Lester Chan

    (@gamerz)

    @ Hell_Lord: what is your site URL?

    The error ratingsL10n is not defined means that <?php wp_footer(); ?> is not in your theme footer.php. If you are sure that it is there, that means that you might be using a caching plugin and the plugin is serving a stale page which is generated before WP-PostRatings is activated.

    The site with the problem is http://www.jogossexo.net/

    The link to download my footer.php ~~> https://mega.co.nz/#!OYp1HChY!Ky3562qTolQui533luN4XUgaTFY3UNclWArdOYLG7oQ

    My intention was to make the post ratings plugin work, with what you said before is now working, however the console still shows the error ratingsL10n is not defined.

    Plugin Author Lester Chan

    (@gamerz)

    I checked your footer.php, the code is there and when to your site and the JS is there. I can’t really check more in dept because your site is NSFW and I am work.

    Plugin Author Lester Chan

    (@gamerz)

    I know the problem. Are you including <script type="text/javascript" src="http://www.jogossexo.net/wp-content/plugins/wp-postratings/postratings-js.js"></script> in the header? because it not suppose to be there

    Well, i did o_O

    Should i remove it?

    Plugin Author Lester Chan

    (@gamerz)

    Yes!

    The console is no longer showing the error, thank you for the help Lester :3

    So I had the same error and I was wondering why, because I haven’t included any files manually, just installed the plugin into an almost fresh installation. I was using W3 Total Cache too, which was running before. I always emptied that cache after changing some wp-ratings options but the error still occurred. Nearby the mouseover and mouseout – functions did not work, mouseout caused broken images instead of the stars. I digged into the source code to find the bug and I found out, that the parseInt() – calls to all ratingsL10n – properties were not called, so ratingsL10n.custom was treated as string and the ratings_off– function tried to load custom images instead of the stars I choose.

    tl;dr
    Long story short – W3 Total Cache default options caused the problem finally. I had the JS minify option “embed type” set to “Default (blocking)” and this caused the error. Changing this option to “Non-blocking using JS” and clearing all caches made it work as it should :).
    I hope this helps someone else, it took me some hours to find that out …

    Plugin Author Lester Chan

    (@gamerz)

    Thanks alex1982 for the share!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘ReferenceError: ratingsL10n is not defined’ is closed to new replies.