Fatal Error report
-
I hope you folks don’t mind me sending a bug report my AI suggested I notify you about. I think I’ve corrected what I was experiencing this morning, but in case this helps you at all:
Plugin: Shortcodes Ultimate
Plugin Version: (check in WP Admin → Plugins)
WordPress Version: 7.0.2
PHP Version: 8.3.6
Multisite: NoError Message:
Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /srv/www/wordpress/wp-content/plugins/shortcodes-ultimate/inc/core/tools.php:94 PHP Warning: Undefined variable $myObj in /srv/www/wordpress/wp-content/plugins/arena-liveblog-and-chat-tool/shortcode/init.php on line 228Location:
/srv/www/wordpress/wp-content/plugins/shortcodes-ultimate/inc/core/tools.phpon line 94Stack Trace Snippet:
#0 /srv/www/wordpress/wp-content/plugins/shortcodes-ultimate/includes/shortcodes/custom-gallery.php(145): su_image_resize() #1 /srv/www/wordpress/wp-includes/shortcodes.php(434): su_shortcode_custom_gallery() #2 /srv/www/wordpress/wp-includes/shortcodes.php(273): preg_replace_callback() #3 /srv/www/wordpress/wp-content/plugins/wordpress-seo/src/builders/indexable-link-builder.php(140): apply_filters() #4 phar:///usr/local/bin/wp/vendor/wp-cli/entity-command/src/Post_Command.php(366): wp_update_post()Trigger Scenario:
- A post contains a Shortcodes Ultimate gallery shortcode (
[su_gallery]) - Post is updated via WP-CLI:
wp post update <id> --post_author=<new_id> wp_update_post()firessave_postaction- Yoast SEO’s
Indexable_Post_Watcherhooks in and rebuilds indexable links - This triggers
do_shortcode()on the post content - Gallery shortcode calls
su_image_resize()which returns aWP_Error - Code at line 94 attempts to access the result as an array → Fatal Error
Expected Behavior:
su_image_resize()should either return a valid array or the caller should check forWP_Errorbefore treating the result as an array.Impact: Any post update operation fails with a fatal error when the post contains gallery shortcodes. This affects bulk operations, imports, migrations, and automated post saves.
Additional Note: There’s also an undefined variable warning in the Arena Liveblog plugin at
/arena-liveblog-and-chat-tool/shortcode/init.php:228(Undefined variable $myObj), though this is non-blocking compared to the Shortcodes Ultimate fatal error.Recommendation: Add error handling in
inc/core/tools.php:94to verify the result is not aWP_Errorinstance before accessing it as an array. - A post contains a Shortcodes Ultimate gallery shortcode (
You must be logged in to reply to this topic.