I have noticed a few issues with the SiteOrigin CSS plugin.
1. When I use the Visual Editor and then switch back to the normal CSS view, most, if not all, of my commented code is getting removed. This causes a real problem as I have many comments to help organize things. My comments typically look like this:
/* THIS IS COMMENTED CODE */
A few are left but most get removed.
2. After I save the CSS and then scroll down to add code to the bottom of the CSS editing window, the cursor jumps to the top of the code window which causes me to have to scroll all the way back down to add/edit the code where I want it. Perhaps this is intentional and not a bug but I find it irritating since I don’t usually add new code to the top of the window.
Please help. Thank you.
Hi Jeff,
1. I was having a hard time trying to replicate this reliability. Would it be possible for you to send me something that you know reliably gets removed? That would greatly help us in resolving this issue.
It looks like Custom CSS won’t touch CSS if it’s above a selector so maybe that’s a possible workaround for the time being.
2. I can’t seem to replicate this one. :( To clarify, does this happen in other browsers?
For the cursor defaulting to the top of the window causing the scroll jumping, I don’t see the jumping effect in Firefox. But in both Chrome and Firefox, after saving the CSS or clicking the Custom CSS link in the left sidebar and then clicking in the editor window, the cursor still defaults to the beginning of the code at the top so I still have to manually scroll and click a second time to place the cursor where I want it for editing.
Here is CSS code that contains commented code that is being stripped out.
This is the CSS before using the Visual Editor:
This is the same CSS after clicking on the Visual Editor icon then switching back to the normal editor. Note that the commented code is missing:
Hi Jeff,
I’m unable to replicate this issue. :(
To clarify, do you have the latest version of SiteOrigin CSS installed – 1.0.7?
To avoid any potential interference, Can you try disabling all non-SiteOrigin plugins and see if this fixes the issue? You’ll need to clear all your caches after disabling your plugins.
Yes, I’m using 1.0.7. I disabled all other plugins, cleared the cache and tested your plugin and still get the same issue. I also switched to the Twenty Fifteen theme and tested the same CSS code to see if perhaps my theme was causing a conflict and I still get the same issue using a different theme also. I have also tested in both Chrome and Firefox and see the same thing in both. I’m not sure what else could be causing this unless there is something specific to my server that is an issue.
Hi Jeff,
Would it be possible for you to create a temporary admin account for us so we can log in and take a look?
This is a private message.
This is a private message.
The account is created.
Hi Jeff,
:(
I was able to do this without losing the comments. Could you try on a different computer with, ideally, a freshly installed browser (ie. no browser’s installed).
I have just tried on 3 different computers (one PC and 2 Macs) using 3 different browsers (Chrome, Firefox and Safari) with the same results. I want to clarify that not every single comment is removed, but most of them are.
For example, the first comment is never removed:
But this comments down a little from that one is removed:
There are certain other comments that stay consistently for some reason further down in the code.
When testing using your temporary login, please double check and let me know if you are seeing all of my comments staying intact or only the ones I’ve been ending up with after most of the comments are stripped.
Could it be that there may some hidden characters (such as delimiters) that your plugin is seeing and is stripping which may be affecting the comments?
Sorry, I meant to add this is the last reply…
But this comment down a little from that one is removed:
Hi Jeff,
Not too sure what’s going on but based on what you just said, what happens if you try:
Notice the space.
The issue still happens even after adding the extra space after the word FORMATTING.
OK, I have narrowed the issue down to something interesting that I can reproduce consistently. My issue is related to the @media CSS rule. It seems that when this rule appears in my code, CSS comments on those code snippets are stripped out along with comments on other random snippets that don’t use the @media rule.
Here’s an example of what I mean. The first snippet below doesn’t use the @media rule. The second one does:
If I click on the visual editor button and then come back, you’ll see that the comment on the second snippet is stripped:
In this case, the comment on the first snippet wasn’t affected but, for some reason, as long as the @media rule is present in my editor, the comments are consistently removed from snippets using the @media rule and randomly from other snippets that don’t use it.
Here is a screen capture showing what I see happen when the @media rule is present in my CSS. Also note that the selector drop down on the visual editor screen doesn’t show the elements in the drop down but as one long line.:
Here is another screen capture without the @media rule included. You’ll see that all of my comments remain intact. Note that the visual editor drop down behaves normally in this case:
I’m not sure why some snippets that don’t use the @media rule are affected by this issue but after much testing, this is clearly what is causing the issues for me.
This is a private message.
Hi Jeff,
Thank you! I’ve corrected the formatting and logged this issue. It should hopefully be fixed soon.
Thanks! So you were able to reproduce this specific issue then?
Hi Jeff,
Yes, although I’m still unable to replicate it with the initial CSS provided.
That's really odd. I've also been able to replicate the issue by copying my custom CSS (containing @media code) over to a completely different WordPress install running your plugin. In any case, I'm glad we were able to identify the issue.
Hi Jeff,
You misunderstood me. I was able to replicate it with the latest CSS but not with the original CSS that you posted here.
The reason why the very first code in this post wasn’t giving you issues by itself is because the code that I posted here to show that comments were missing didn’t have any @media rules in it. I had only posted a portion of my full custom CSS which did have @media rules in it further down in the code. My apologies for not posting the full code the first time. Lesson learned. Thanks for your patience. :-)
I see that version 1.0.8 was released today (8-15-16). Is this release intended to fix the @media issue? If so, I just did some tests and see that the issue is still happening for me.
I did just try to post my full custom CSS here for you but the forum won’t allow me to paste it here due to its length. If you have another method that I could send my custom CSS to you for testing, please let me know. Thanks!
Hi Jeff,
No, that version was set for release today and it was too late to include the fix for this in it – sorry mate. :(
While that’s not 100% necessary, you could send me a link to as hastebin or a Pastebin.
This is a private message.
Hi Jeff,
Awesome – thanks mate! :)