WP 5.8 explode() Warning in class.wp-dependencies.php
-
We upgraded to WP 5.8.2 yesterday on all our sites, and now all are reporting the following warning to our Sentry logs:
NOTICE: PHP message: PHP Warning: explode() expects parameter 2 to be string, array given in /var/www/html/public/wp/wp-includes/class.wp-dependencies.php on line 166
The URL in the report was the post editor, so I confirmed in dev that simply opening up a new post editor is enough to trigger the warning.
The stack trace in Sentry had no mention of third party code, so I added some debugging code to see what the value was causing a problem. The print_r() of the value in question was:
Array ( [0] => shutterstock-block-block-editor [1] => shutterstock-block-block-editor-shutterstock-ui-css )
At that point I determined that disabling Shutterstock in the dev environment did stop the warning, however this is an important plugin for our editors and therefore not an option we can use right now. I’m aware that testing up to 5.8.x hasn’t been verified yet, however hopefully this report gets this plugin one step closer to that point.
After further investigation with another of our devs, we identified the cause in shutterstock/public/class-shutterstock-public.php, lines 140-143 in v1.3.7. The args to the register_block_type() is an array of arrays, multiple scripts and styles being added to the block type in question. This is apparently not a supported feature yet per https://github.com/WordPress/gutenberg/issues/14598. I hope all this helps identify a solution.
- The topic ‘WP 5.8 explode() Warning in class.wp-dependencies.php’ is closed to new replies.