This is caused by trying to access string as if were an array. Newer versions of PHP will give warnings when you do this because it’s not best coding practice from a security standpoint. Unfortunately, this is going to require a rewrite and I am not sure if the developer wants to mess with it. Sadly this is the only plugin that correctly lazy loads youtube videos so there isn’t any other options.
sorry guys, had not seen the original post. I’ll look into this one of these days (or weeks) 🙂
I’m getting the same error on a client’s site running PHP 7.
As a side note, I love both Youtube Lyte and Autoptimize. Thanks for your great plugins, Frank!
hmmm, lyte is in desperate need of some tlc 😉
OK, can you on (or around) line 502 change
}
return $_thisLyte;
}
in
}
foreach (array("title","thumbUrl","HQthumbUrl","dateField","duration","description","captions_data","captions_timestamp") as $key) {
if (!array_key_exists($_thisLyte[$key])) {
$_thisLyte[$key]="";
}
}
return $_thisLyte;
}
so adding the foreach-block?
so
if (!array_key_exists($_thisLyte[$key])) {
should actually be
if (!array_key_exists($key,$_thisLyte)) {
sorry about that 🙂