CDN – WC variable product image – image url is not cdn url
-
Hi WP Fastest Cache members, I hope somebody will be able to help me.
I use WP Fastest Cache + KeyCDN + woocommerce.
I have problem with Woocommerce variable products(single products are fine) on my website, the main photo(url is server’s url, not CDN) of the product page is not loaded from CDN, It is escaped/sanitized in woocommerce variable.php below. All other pictures are correct with CDN url on that page.
You can see the link provided that this is generated there in HTML source code.
And the url of the image in the variable form(variable is options for product – colors, sizes) is escaped like this https:\/\/www.wildindo.com\/wp-content\/uploads\/2018\/06\/RattanNomiBlack3-e1539761963824.jpgIs it the replace function for cache taht does not find this link?(But i see the example there) Or where else I can look to fix this?
Does anybody else have the same issue?
Can somebody help me to guide what else and where else i can look?
Thank you in advance for any leads.
public function cdn_rewrite($content){ if($this->cdn){ error_log("BEFORE REPLACE"); error_log($content); $content = preg_replace_callback("/(srcset|src|href|data-cvpsrc|data-cvpset|data-thumb|data-bg-url|data-large_image|data-lazyload|data-source-url|data-srcsmall|data-srclarge|data-srcfull|data-slide-img|data-lazy-original)\s{0,2}\=[\'\"]([^\'\"]+)[\'\"]/i", array($this, 'cdn_replace_urls'), $content); error_log("AFTER REPLACE"); error_log($content); //url() $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content); //{"concatemoji":"http:\/\/your_url.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.7"} $content = preg_replace_callback("/\{\"concatemoji\"\:\"[^\"]+\"\}/i", array($this, 'cdn_replace_urls'), $content); //<script>var loaderRandomImages=["https:\/\/www.site.com\/wp-content\/uploads\/2016\/12\/image.jpg"];</script> $content = preg_replace_callback("/[\"\']([^\'\"]+)[\"\']\s*\:\s*[\"\']https?\:\\\\\/\\\\\/[^\"\']+[\"\']/i", array($this, 'cdn_replace_urls'), $content); // <script> // jsFileLocation:"//domain.com/wp-content/plugins/revslider/public/assets/js/" // </script> $content = preg_replace_callback("/(jsFileLocation)\s*\:[\"\']([^\"\']+)[\"\']/i", array($this, 'cdn_replace_urls'), $content); } return $content; }
The page I need help with: [log in to see the link]
- The topic ‘CDN – WC variable product image – image url is not cdn url’ is closed to new replies.