• I get these:

    Warning: Illegal string offset ‘description’ in /path/to/my/worpress/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 310

    any idea?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

    Plugin Author Frank Goossens

    (@futtta)

    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!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    so

    if (!array_key_exists($_thisLyte[$key])) {

    should actually be

    if (!array_key_exists($key,$_thisLyte)) {

    sorry about that ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Warning: Illegal string offset’ is closed to new replies.