• Resolved Charlie Laubin

    (@charlie45100)


    Hello,

    Since running the site on PHP 8.x, we are getting recurring PHP warnings with WP YouTube Lyte:

    PHP Warning: Undefined array key "title" in wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 536

    The warning is triggered on every page load that contains a YouTube Lyte embed.
    With PHP versions prior to 8, this access was silent, but PHP 8+ now raises a warning when trying to read a non-existent array key.

    It appears the code accesses $video['title'] without checking if the key exists.
    A simple guard would prevent the warning, for example:

    $title = $video['title'] ?? '';

    or using an isset() check.

    This issue is not breaking the frontend, but it:

    • clutters PHP error logs,
    • can cause issues when WP_DEBUG is enabled,
    • and affects PHP 8+ compatibility.

    Thanks in advance for looking into this, and thank you for maintaining the plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.