• Resolved guess4me

    (@guess4me)


    Hello Support Team,

    I am experiencing an issue with plugin and have started receiving the following error messages in debug.log:

    Request URI: /wp-admin/admin-ajax.php?action=wp_ewwwio_scan_async&nonce=4ff63042ce&lock_key
    PHP Fatal error:
    Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/ewww-image-optimizer/common.php:8416
    Stack trace:
    #0 /wp-content/plugins/ewww-image-optimizer/bulk.php(1185): ewww_image_optimizer_remove_duplicate_records()
    #1 /wp-content/plugins/ewww-image-optimizer/aux-optimize.php(1625): ewww_image_optimizer_optimized_list()
    #2 /wp-content/plugins/ewww-image-optimizer/aux-optimize.php(1874): ewww_image_optimizer_image_scan()
    #3 /wp-content/plugins/ewww-image-optimizer/classes/class-async-scan.php(39): ewww_image_optimizer_aux_images_script()
    #4 /wp-content/plugins/ewww-image-optimizer/classes/class-async-request.php(157): EWWW\Async_Scan->handle()
    #5 /wp-includes/class-wp-hook.php(324): EWWW\Async_Request->maybe_handle()
    #6 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #7 /wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 /wp-admin/admin-ajax.php(207): do_action()
    #9 {main}
    thrown in /wp-content/plugins/ewww-image-optimizer/common.php on line 8416

    Upon further investigation using xdebug, I noticed $duplicate variable does not contain an 'id' field, which seems to be causing the error.

    Screenshot with xdebug data: https://prnt.sc/pOo26h2fknQj

    • This topic was modified 1 year, 2 months ago by guess4me.
    • This topic was modified 1 year, 2 months ago by guess4me.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter guess4me

    (@guess4me)

    I’ve attached screenshot with additional info (previous step in stacktrace): https://prnt.sc/FXwYiptXECKO. www_image_optimizer_remove_duplicate_records expects arrays with 'id' field but plain id list is passed to the function.

    • This reply was modified 1 year, 2 months ago by guess4me.
    Plugin Support adamewww

    (@adamewww)

    Hi @guess4me

    We greatly appreciate the detailed information. We’re currently looking into it as we had just made a fix to this specific section only a couple months back. Can you verify you are using the latest version of the plugin?

    Thread Starter guess4me

    (@guess4me)

    @adamewww Thank you, I’ve checked – I use 8.0.0 version. Can you send me example of code changes atleast in the screenshot if there any?

    Plugin Support adamewww

    (@adamewww)

    Got it, thanks for checking and for all the info!

    We had a look at it and updated it so that $duplicate[id] isn’t checked, as it shouldn’t be, but instead just $duplicate as well as putting in a better check to make sure we’re dealing with arrays. You can get the updated version here or wait for the next release: https://docs.ewww.io/article/73-update-from-github

    Plugin Support adamewww

    (@adamewww)

    I haven’t heard anything back about this in a while so I’m going to resolve this thread. If you have further questions, please feel free to open a new one!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Server Error: Cannot Access Offset of Type String on String in common.php’ is closed to new replies.