Skip Navigation

[Resolved] CSS file error when forcing site to SSL

This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.13 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by jamesH-18 8 years ago.

Assisted by: Nigel.

Author
Posts
#433200

I am testing SSL on a staging server, not my live development site. I have implemented site wide SSL. I updated the database. Find and replace HTTP -> HTTPS.
Site works fine except for Layouts CSS. I'm assuming I changed the link in the DB for for the css file. Where do I go to fix that?

#433458

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Is the file you are referring to ddl-front-end.css, or another?

I read back through the source code for Layouts to see how that CSS file is enqueued, and the URL is generated using plugins_url(), which is SSL-sensitive and the recommended way for plugins to generate URLs to their files.

If you view source and see what is printed for the stylesheet link, it is printing a URL with "http" while all the others are "https", is that right?

#433669
Screen Shot 2016-09-07 at 9.58.32 AM.png

Nigel, thanks for the help. I'm not sure what file we are dealing with.
Using the layouts CSS tool here. I just assumed that was appended to some css file somewhere.
After changing all links to https: when I open the tool the css field is blank.

#434393

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

When you say you did a find and replace for http -> https in the database, how did you do that?

You must be extremely cautious when doing that because often content is stored in the database as serialized strings—as well as the string itself it stores information about the length of the string, and so if you replace 'http' with 'https' you will have altered the lengths of these serialized string entries and effectively broken them.

Maybe you already know that and used an appropriate tool, such as https://wordpress.org/plugins/better-search-replace/

But if not you should revert to a backup from before you performed the search and replace and then try again with an appropriate tool.

#434528

Nigel, thanks for the feedback. Here's what I did. I have a development site so it was not tragic. I used a temporary SSL cert to test to see where I may have issues. I did a find and replace for all the urls to https like I said, I had to do that on the temp site because I did not have a true ssl manager. That is when I noticed the issue with toolset and notified you. Here's what I did after:

1. I purchased an SSL cert for my main domain. Set it up and set it to secure every page.
2. I did a find and replace for the domain name in the url's but NOT for http -> https. The ssl manager handles that.
3. I reset permalinks in WP, etc....Nothing major. Nothing that I have not done several times during development.
Here's the issues I still have, I don't imagine if I did anything too wrong as far as procedure.
1. The layouts CSS field: Empty no css code: I had a backup. I put the css code in and everything is fine save for a few things here and there. I think this started to happen after the most recent toolset update. Ive done this in the past and everything seemed to work.
2. NONE of the views filters worked. I had to go in an reset all the filters.

So, do you thing that "messing up" the serialization caused these issues with toolset? If so I will use the plugin you suggested on a backup and see what that does.

#434545

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I'm still not sure how you did the search and replace.

With a SQL query directly in the database?

The only time that it is ever safe to do that is when you are replacing one string with another that is identical in length, e.g. a 10-letter string for another 10-letter string, because otherwise you will break the serialization of any entry where the string occurs.

The results are unpredictable, and so could very well be responsible for the problems.

#438077

Still no real answer to what actually happened. I might be good to know if updating the DB directly might affect certain things. But I was able to get everything up and running again.
Thanks for the help.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.