WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
Notice: Undefined index: rate in ... wp-postratings.php (8 posts)

  1. Marko-M
    Member
    Posted 3 years ago #

    Hi everyone. When debugging is turned on on WordPress site, the "Notice: Undefined index: rate in ... wp-postratings.php" is always shown at the top of the page? Is there a way to get rid of it?

    Thanks very much :)

  2. Marko-M
    Member
    Posted 3 years ago #

    I've found out why, there is a bunch of notices when PHP error reporting is set to show all errors. This is because of poor programming practice of wp postratings author to acces GET variables without checking are they even set using isset(). Kind of sloppy.

  3. Lester Chan
    Member
    Plugin Author

    Posted 3 years ago #

    This plugin is coded quite sometime back and I usually don't code with notices on (I know it is bad practice and sloppy!). But this is not really critical when you compare this to additional features or bug fixes.

  4. Marko-M
    Member
    Posted 3 years ago #

    Sure Lester, thanks for your work!

  5. Frederik77
    Member
    Posted 3 years ago #

    Yes, thanks for the plugins Lester Chan! I've found them very useful. I had the same issue as Marko, and it was fixed by adding a line to the wp-postratings php:

    if (isset($_GET['rate']) && isset($_GET['pid'])){

    ...before these lines...

    $rate = intval($_GET['rate']);
    $post_id = intval($_GET['pid']);

    (...and, of course, closing with } at the end of the function.)
    I guess you can use it if/when you update the plugin.

  6. Anna Lynge
    Member
    Posted 2 years ago #

    I am not sure that I actually understand the above explanation. Could anyone explain what to do in a more simpel way? I am not that experienced in WP. I have just downloaded WP estore and I keep on getting the "Notice: Undefined index:..." messages in the admin part of the plugin.

    Thanks ;o)

  7. Lester Chan
    Member
    Plugin Author

    Posted 2 years ago #

    It is my bad for all the notices, but you should not turn on notices in production. Google for "turn off notices php"

  8. Anna Lynge
    Member
    Posted 2 years ago #

    Don't really know what you are asking me to do, but solved the problem by inserting this: error_reporting (E_ALL ^ E_NOTICE); in wp_eStore1.php at the top. That worked. I found it on the net. ;o)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic