• Resolved Stringman

    (@banjohead)


    All of the slides have disappeared after changing the domain name on my site. Changing the domain name back to the original makes the slides come back, but I can’t get them to work with the new domain name, even after running a find/replace on the database to fix any broken links referencing the old domain. Any suggestions? Thanks so much! -Dave

    https://www.ads-software.com/extend/plugins/total-slider/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Van Patten Media

    (@vanpattenmedia)

    Hi banjohead,

    I’ve attempted to reproduce this myself — by moving a site to a new domain, updating the home and siteurl wp_options, and then seeing what happened to my slides.

    Do your slides still show up in the Slider admin interface, where you edit them, or when they ‘disappear’ are they gone from both the frontend and backend?

    My slides still show up — the only thing that breaks and requires a find/replace to update the paths is the background images. However, if I simply find/replace the old URL for the new URL on the total_slider_[slidegroup] wp_option, though, I’ll likely break the formatting of the PHP serialised data.

    Permit me to dive into a little technical detail here:

    The slide itself is a PHP array, which has been serialize()d. If ou look at the raw database, you might notice how the serialisation stores different variables — they have a single character prefix (‘s’ for string, ‘i’ for integer, ‘a’ for array, etc.). In the case of strings, you’ll see a number after that character prefix, s:82. That number is the string length.

    If you do a find replace on the background URL string, the length of the string is likely to change. However, if you fail to also update the string length in that prefix at the same time, the whole serialised string will be corrupt, and PHP will refuse to unserialise it.

    If I’m guessing the issue correctly, you should be able to fix this by looking through each of your total_slider_[slidegroup] wp_options, and recalculating the length of any strings that you changed, fixing those string length prefixes.

    For example, let’s say this was the original background entry in the wp_option:

    s:65:"https://www.old-domain.com/wp-content/uploads/2012/07/picture.jpg"

    If you swap www.old-domain.com for www.shiny-new-domain.com, it’ll look like this:

    s:65:"https://www.shiny-new-domain.com/wp-content/uploads/2012/07/picture.jpg"

    However, the string is no longer 65 characters long. We must recalculate its length, 71 characters, and update the prefix:

    s:71:"https://www.shiny-new-domain.com/wp-content/uploads/2012/07/picture.jpg"

    Does that make sense?

    Let me know how you get on with this. If you need any support with making these database changes, I’m sure we can help.

    This highlights an important issue with migrating sites, which is something I can look into making better in future Total Slider versions, so thanks!

    Peter Upfold
    Total Slider Developer

    Thread Starter Stringman

    (@banjohead)

    Hello, Peter. Thank you so much for your quick support response. Your explanation for what is wrong coincides perfectly with the problem I have seen. The string-length mismatch after running find/replace appears to be the problem. The slides themselves still show in their respective slide groups in the slide manager, but with no images. I am going to see if I can work around this using the method of recalculating the string lengths and updating the wp_option entries. I will let you know how it goes. Thanks,

    -Dave

    Plugin Author Van Patten Media

    (@vanpattenmedia)

    Dave,

    As I mentioned on the relevant GitHub issue, we are looking into moving away from saving literal URLs for background images. The goal is in future to use the attachment’s post_ID — the frontend would then look up the background image’s URL from the ID at display time, which would eliminate the need to manually do this fiddly find/replace on site migration.

    This should either arrive in version 1.1, which I’m working on now, or in version 1.2.

    I hope it’s OK to mark this as ‘resolved’ at this point (do re-open it if not). We have a short-term workaround for now, and we will soon resolve this fully for site migration scenarios.

    Peter Upfold
    Total Slider Developer

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Total Slider] Slides Not Visible after Domain Change’ is closed to new replies.