Hello there @bob33,
Can you provide an URL, so we can check the issue you are having?
Kind regards,
Stoyan
Thread Starter
Bob33
(@bob33)
Hi Stoyan – thanks for your reply – can you give me an email address to send that? That (breaking) functionality is currently turned off, so we’ll to coordinate a time for you to take a look.
Hey there @bob33,
You can send me a mail at (stoyan.b.georgiev[@]siteground.com)
Kind Regards,
Stoyan
Thread Starter
Bob33
(@bob33)
A note for others who may be having the same issue with the use of relative URLs for background images in their style sheets (and possibly other scenarios), the solution offered (by email) was to change the relative URLs to absolute URLs.
I have asked whether the developers see the issue with relative URLs as a problem that may be fixed at some point, but am still waiting for a reply.
Given that other plugins (e.g. Autoptimize) don’t have a problem dealing with relative URLs, I was slightly surprised at the solution offered with no mention of whether it was something they were looking into.
Stoyan – still waiting to hear back and looks like Stanimir may have mistakenly marked this as resolved before you had a chance to reply.
Will keep this thread active until the issue is clarified so that any others who encounter this problem will know what their options are.
Thanks for your help on this so far.
Hey @bob33
Our plugin works with relative and absolute paths.
We will check the issue in more detail soon and will leave a reply in the thread.
Regards,
Stanimir
Thread Starter
Bob33
(@bob33)
Thanks Stanimir
To be clear though, it’s still not working on the site in question which is using relative paths for some background images.
Look forward to seeing your update in this thread when the fix has been completed.
In the meantime, if you could resist the urge to mark the thread ‘resolved’, that would provide others facing the same issues with an accurate assessment of progress.
Many thanks.
Hey @bob33
I’ve checked your case in more details and here are my thoughts:
1. When we combine the CSS, we check for full URLs and if we find such, we leave them as is.
2. When the path to the image is not aa absolute, we do a search-replace, to generate the proper relative path. We do this because we store the combined CSS in the uploads folder.
3. Since your URL is not absolute, we add the path to the theme.
If you use a relative URL like the following the CSS combinations will work:
../uploads/etc/image.png
I’m marking this as resolved since there is nothing we can do for such relative paths.
Regards,
Stanimir
Thread Starter
Bob33
(@bob33)
Hi Stanimir
Thanks for your detailed reply.
I must be missing something as I’m not really understanding the rationale behind the treatment of the relative paths in question.
If I use a relative path as (I think) you’re suggesting above it won’t work. It produces the same kind broken path as the Combine CSS: /wp-content/themes/uploads/image.jpg
As far as I am aware, the relative path format I’m using is pretty standard for background images in WordPress – background: url(/wp-content/uploads/image.jpg) no-repeat; but again, I may be missing something.
I see someone else raised the same issue a year ago https://wordpress.org/support/topic/combine-css-bug-with-path-absolute-urls/
Not to worry, it was a bit of a trial to see if I could use SG Optimizer for some of the things Autoptmize is doing (it is able to combine the stylesheets with these background img paths no problem) for simplicity sake.
Thanks for your work on this plugin.