-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi, we use cloudfront CDN with WP rocket and this doesn't seem to support it.
the CDN replaces the image URLS to be something like cdn.domain.com however when enabled the images don't load at all, i think its because your image calls don't use the standard WP calls.
We have a work around - however would love if you could make this fix native so we can continue to get pain free updates
`
// If URL begins with 'https://cdn.' then convert it to 'https://'
if ( !strncmp( $img_url, 'https://cdn.', 12 ) ) :
$img_url = str_replace( 'https://cdn.', 'https://', $img_url );
elseif ( !strncmp( $img_url, 'http://cdn.', 11 ) ) :
$img_url = str_replace( 'http://cdn.', 'http://', $img_url );
endif;
/* Check if WP Rocket’s function exist to avoid conflicts. */
if ( function_exists( 'get_rocket_cdn_url' ) ) :
$image = get_rocket_cdn_url( arpw_resize( $img_url, $args['thumbnail_width'], $args['thumbnail_height'], true ));
else : /* Fallback in case WP Rocket is not active. */
$image = arpw_resize( $img_url, $args['thumbnail_width'], $args['thumbnail_height'], true );
endif;`
Metadata
Metadata
Assignees
Labels
No labels