• Resolved damianodipietro

    (@damianodipietro)


    Hi,
    First of all, thanks for your plugin and for any future reply.
    I use your plugin on my website with rmp_max_rating limited to 4 (it has never been changed).
    I saw this fatal error opening some rare articles:

    PHP Fatal error: Uncaught ValueError: array_fill(): Argument #2 ($count) must be greater than or equal to 0 in /var/www/html/wp-content/plugins/rate-my-post/public/class-rate-my-post-public.php:1846

    After futher investigation, I found that it was caused by:

    $icons_empty = $max_rating - $icons_highlighted - $icons_half_highlighted;

    On one article, $max_rating was 4 and $icons_highlighted (that is floor($average_rating)) was 4.6, but the problem is the same on the other ones.

    For example, in one article the postmetas are:
    rmp_vote_count = 5
    rmp_rating_val_sum = 23
    rmp_avg_rating = 4.6

    And these are the analytics.

    In another one, the postmetas are:
    rmp_vote_count = 1
    rmp_rating_val_sum = 10
    rmp_avg_rating = 10

    And these are the analytics.

    I could recalculate the metas using the analytics data, but I don’t know how this could have happened.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Collins Agbonghama

    (@collizo4sky)

    No idea why this happened.

    Were you able to fix the issue by recalculation?

    Thread Starter damianodipietro

    (@damianodipietro)

    “Yes”, the script takes the analytics related to an article, counts them and calculate the new sum, but It’s not possible to verify that the votes are real because:
    1. I’m from Italy and I can’t enable IP tracking (so every user is -1);
    2. I thought to check the timestamp and ignore the votes with identical time, but as you can see in the examples on my first post, sometimes the vote is different so I can’t assume that same timestamp equals to “duplicated” vote.

    Alessandro

    (@alessandrocarrera)

    Follow.

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    @damianodipietro Open a ticket via https://feedbackwp.com/support/ with a link to a page where the fatal error happens so I can take a closer look.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.