• 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter chief1983

    (@chief1983)

    It was reported by another user that the Shutterstock plugin appears a bit broken now in WP 5.8, so this bug might actually be resulting in this breakage. It was reported that the download tab is no longer available when the block is pulled up.

    With newer PHP this triggers a fatal error affecting all saves using the block editor. So be warned.

    Plugin Author Shutterstock Plugins

    (@shutterstockplugins)

    @chief1983 @knutsp We released 1.3.8 version and these problems should be fixed. Thank you for reporting.

    Thread Starter chief1983

    (@chief1983)

    We deployed this somewhat recently, but realized it caused a significant impact on website performance (LCP values went above 2.5 or 4s for most of our pages). It appears the attempt to split the required styles and scripts between the editor_style/script and style/script block types causes editor assets to be requested on non-editor pages, such as article viewing. This will have significant performance impacts for anyone using the plugin. We’re putting in a filter on our end in the meantime to pop those out of the queue when the editor is not running, but this is probably something that will need to be addressed differently for other users of the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP 5.8 explode() Warning in class.wp-dependencies.php’ is closed to new replies.