Just posting a quick fix in case others bump into this or we need to fix a site again 🙂
We had a strange case of the below code showing up on a front end page of a WPENGINE site…
/wp-content/mu-plugins/wpengine-common/plugin.php on line 264
I tried using Perm-Reload-Apply but that did nothing. The strange part is that it is this section of code related to CDN – and on this site we are not using a CDN. The below snippet is lines 252-272 of that plugin.php
file
/** | |
* This handles CDN replacement for srcset images. | |
* | |
* @since 2.2.10 | |
* @filter wp_calculate_image_srcset | |
* @param array $sources The image metadata as returned by 'wp_get_attachment_metadata()'. | |
*/ | |
public function wpe_cdn_srcset( $sources ) { | |
if ( defined( 'WPE_SRCSET_CDN_DISABLED' ) && true === WPE_SRCSET_CDN_DISABLED ) { | |
return $sources; | |
} | |
foreach ( $sources as $source ) { | |
// The actual CDN replacement. | |
if ( $new_path = $this->wpe_cdn_replace( $sources[ $source['value'] ]['url'] ) ) { | |
$sources[ $source['value'] ]['url'] = $new_path; | |
} | |
} | |
return $sources; | |
} |
You can try adding this to wp-config.php
– it may hide it.
define( 'WP_DEBUG', false);
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
The Fix
Just add this code to your wp-config.php file..
# Disable the WPE SRCSET CDN to fix a bug
define('WPE_SRCSET_CDN_DISABLED', true);
Hopefully they will solve this conflict soon but in the meantime the above seems to work.