Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 798 forks source link

Super Cache: Predictive search images are not using the CDN URL #34134

Open gugasbubas opened 1 year ago

gugasbubas commented 1 year ago

Impacted plugin

Super Cache

Quick summary

I use a CDN on my website (https://www.underthecover.pt/) and all of the images are provided by the CDN service (I use WP Super Cache to implement it), but when typing a product name on the search bar, all of the image products of the predictive search are sourced directly from the root “wp-content/uploads” instead of the CDN, which is overloading the server. I have questioned the developers of my current theme (Savoy on ThemeForest) and they replied the following:

"The image URLs in the search-suggestions data are generated with the standard "wp_get_attachment_image_src()" WP function, however the data is generated via an Ajax call so that could be why the "WP Super Cache" plugin isn't changing them.

I'm not exactly sure how the WP Super Cache plugin is changing the image URLs, so it would be best to contact their support in this case and explain what I wrote above, then get back to me if there's something I can do to help solve this."

Steps to reproduce

  1. Start at https://www.underthecover.pt/
  2. Click the search icon on the top bar (only on desktop)
  3. Begin to type a product name
  4. See the origin path of the predictive search product image

A clear and concise description of what you expected to happen.

The images of the products that show up on the predictive search should be sourced from the CDN, not from the root “wp-content/uploads”

What actually happened

Product's predictive search images are sourced directly from “wp-content/uploads” instead of the CDN URL

Impact

All

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

donnchawp commented 12 months ago

Thanks for your report. The CDN functionality uses the output buffer from the plugin to replace the path of static files. We will need to add a filter on wp_get_attachment_image_src to modify the paths returned by that function.

gugasbubas commented 8 months ago

Hi, I'm sorry for the newbie question, but does this mean that this will be fixed on a future update or should I do something about it myself? Thank you.