• Resolved noplanman

    (@noplanman)


    YouTube has dropped the dislikes from their API, so when fetching the stats, PHP8 can’t find $JSON_Data->items[0]->statistics->dislikeCount and cries out with:
    Undefined property: stdClass::$dislikeCount

    Due to this, all stats for all videos break.

    I’ve temporarily fixed it with this simple code change in youtube-showcase-professional/includes/youtube-functions.php:595
    $youtube_stats['video_dislike_count'] = $JSON_Data->items[0]->statistics->dislikeCount ?? 0;

    For older PHP versions below PHP7, it will require an isset instead.

    I’m using the Pro version 4.9.0 by the way.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP8 dislikes $dislikeCount’ is closed to new replies.