Same here– WordPress database error Duplicate key name ‘path_image_size’ for query ALTER TABLE prefix_ewwwio_images ADD INDEX path_image_size (path(255), image_size) made by do_action(‘admin_init’), call_user_func_array, ewww_image_optimizer_admin_init, ewww_image_optimizer_init, ewww_image_optimizer_install_table, dbDelta
It’s something to do with the way wordpress generates the delta during an upgrade I haven’t worked out a way around it yet, but it’s on my radar. At any rate, it only happens once, and isn’t a fatal error (or wasn’t in any of my testing).
If you change line 596 of common.php from:
INDEX path_image_size (path(255), image_size)
to
KEY path_image_size (path(255),image_size)
dbDelta() then finds the index properly (at least here).
Note that both changes on that line are important: the space after the comma AND KEY vs INDEX.
@zytzagoo, thank you for pointing that out. I’ll give it a try later today and include it in the next release. I wasn’t too keen on folks getting that warning on every single upgrade from here on out, so I’m glad there is a solution available.
That did the trick, the fix will be included in the next release.