Skip to main content

One post tagged with "Slider Revolution"

View all tags

URL Rewrites Miss JSON Images? Escape Forms Are the Reason

Β· 8 min read

During the final verification pass of a CDN migration for a client site, the homepage slider's large images and a 47MB background video were still serving from the origin domain, hogging a 5Mbps shared uplink β€” while the noscript fallback inside the very same element already pointed at the CDN domain. Half the element migrated, half didn't.

TL;DR​

  1. URLs don't only live in src="...". Slider plugins store image paths inside inline JSON ("src":"..." β€” colon form), often further escaped into https:\/\/ byte streams. An attribute-grammar rewrite surface (src=/srcset=/href= with a whitespace-required prefix) misses all of these, and a plain str_replace misses the escaped forms too.
  2. Close it with a storage-side three-form replace: inspect the stored form first, then replace plain, single-escaped, and double-escaped variants separately. We closed 204 occurrences across the three slides/slides7 tables of Slider Revolution. PHP serialized fields must go through the serialization engine; JSON fields can be replaced byte-for-byte.
  3. Then run a two-hop save fixpoint: two consecutive editor saves that leave the stored byte stream unchanged prove the save path writes back no old domain.