Title: Server Error: Cannot Access Offset of Type String on String in common.php
Last modified: January 29, 2025

---

# Server Error: Cannot Access Offset of Type String on String in common.php

 *  Resolved [guess4me](https://wordpress.org/support/users/guess4me/)
 * (@guess4me)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/)
 * 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](https://prnt.sc/pOo26h2fknQj)
    -  This topic was modified 1 year, 4 months ago by [guess4me](https://wordpress.org/support/users/guess4me/).
    -  This topic was modified 1 year, 4 months ago by [guess4me](https://wordpress.org/support/users/guess4me/).

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

 *  Thread Starter [guess4me](https://wordpress.org/support/users/guess4me/)
 * (@guess4me)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/#post-18275201)
 * I’ve attached screenshot with additional info (previous step in stacktrace): 
   [https://prnt.sc/FXwYiptXECKO](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, 4 months ago by [guess4me](https://wordpress.org/support/users/guess4me/).
 *  Plugin Support [adamewww](https://wordpress.org/support/users/adamewww/)
 * (@adamewww)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/#post-18275632)
 * Hi [@guess4me](https://wordpress.org/support/users/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](https://wordpress.org/support/users/guess4me/)
 * (@guess4me)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/#post-18275893)
 * [@adamewww](https://wordpress.org/support/users/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](https://wordpress.org/support/users/adamewww/)
 * (@adamewww)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/#post-18277647)
 * 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](https://docs.ewww.io/article/73-update-from-github)
 *  Plugin Support [adamewww](https://wordpress.org/support/users/adamewww/)
 * (@adamewww)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/#post-18370911)
 * 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.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [adamewww](https://wordpress.org/support/users/adamewww/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/server-error-cannot-access-offset-of-type-string-on-string-in-common-php/#post-18370911)
 * Status: resolved