@nichson I found another place where there is a malicious code. Check in the wp_options table, the row with the option_name: ad_code.
Bro, I read your post at https://wordpress.org/support/topic/woocommerce-variation-images-not-changing/ and I saw that you have installed a plugin with possible Malware, be very careful. The plugin is Monitization Version: 1.0 Author: Igor Glavatskiy and generate SPAM popups on your site.