Strange SVG disappearance in code block on frontend

Cwicly Plugin version:


There is a really strange thing happening with SVG in code block: the generated code disappears on frontend every other save!

For instance, add any SVG to a code block, save, refresh frontend, the SVG is there.

Make ANY change in the editor, save, refresh frontend, SVG is not there anymore!

And it goes on like this forever, appearing and disappearing at every save action.

We have also experienced this. It is not specifically related to SVG.

It appears to be intermittent.

Each time you edit the page / template any code block will temporarily not display until you make a new edit and resave.

Hello @yankiara and @StrangeTech,

Thanks for the report.

I have been able to reproduce this for Code blocks that did not previously have any content when the editor was accessed.

We have a fix for this in the next update.

My apologies for the inconvenience.


1 Like

@Louis Tested and confirmed to work with 1.41:

Problem persists for me when editing a TEMPLATE containing a code block.

I confirm there is no issue with the post editor.

Interesting, it seems to be completely solved for me when editing a template.

Perhaps there are nuances to this that weren’t initially obvious.

Tried with <?php echo 'test' ?>, no problem.

Tried with this simple SVG and issue occurs every other save:

<svg viewBox="0 0 100 100">
<rect y="0" x="0" height="50" width="50"/>

Good catch @yankiara.

We have a couple of code blocks in different templates that have a mixture of CSS, Javascript and HTML markup and they all work fine now.

So as there is no SVG in ours, that appears to be the determining factor, @Louis.

@Louis, as a follow up, after a few days of active development, we encountered this again intermittently.

It is unclear what the trigger is, but the contents of the code block seems to be irrelevant.

Hello @StrangeTech and @yankiara,

I’m sorry to hear that this is still an issue on your end.

Unfortunately, I am not able to reproduce this on my end.
Would it be possible to have a few more details on where this is happening (post editor, site editor, user capabilities etc…) so that we can debug the situation?

Thanks in advance.


Here is a quick summary, let me know if you need more information:

  1. Page template for specific page
  2. Code block containing multiple different elements at different times (e.g. first only PHP field was used, then PHP, CSS and JS were all used, then only CSS and JS were used, etc) - Issue occurred in all three cases.

Steps to repeat:

  1. Add some content to the page template
  2. Add a code block with some code in it
  3. Save and view the page
  4. Edit the page template contents without editing the code block OR edit the code block without editing the other page template contents
  5. Save and view the page

Repeat steps 4-5 until you hit the issue - the code block contents are not rendered at all.

Note: When the issue occurs, editing the page template contents (without editing the code block) restores the page display to show correctly.