Fatal error: Uncaught Error: Call to a member function attributes() on bool

Description:
I am developing my first real project with Cwicly (so it can be some noob mistakes).
I am using Tailwind.
I am using Shuffle to generate the layout and I am using almost exclusively the “copy html to block” feature.
I am working locally with Local by Flywheel.

The error appeared multiple times:

  1. First only on the front-end while deleting an element in the header (I succeeded recovering the error with some CTRL+Z) I thought it was because I used two tabs with the editor opened at the same time (one on the header the other on the page).
  2. But then, it also crashed the editor while working on a “CTA” section… Maybe after a “paste” it happened really fast. Now I am not even able to recover the page I was working on.

Here the full error log:

Warning: simplexml_load_string(): Entity: line 1: parser error : Specification mandates value for attribute data-config- in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1884

Warning: simplexml_load_string(): viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-config- in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1884

Warning: simplexml_load_string(): ^ in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1884

Fatal error: Uncaught Error: Call to a member function attributes() on bool in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php:1885 Stack trace: #0 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(3293): Cwicly\Helpers::get_svg_attributes('<svg width="24"...') #1 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(431): cc_get_dyn('viewbox', Array, Array, Object(WP_Block), Array, NULL) #2 [internal function]: {closure}(Array) #3 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(436): preg_replace_callback('/(?!{}){(?!"|&q...', Object(Closure), '\n<svg class="cc...') #4 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(404): cc_parser('\n<svg class="cc...', Array, Object(WP_Block)) #5 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/blocks/svg/svg.php(38): cc_render('\n<svg class="cc...', Array, Object(WP_Block)) #6 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(258): cc_svg_render_callback(Array, '\n<svg class="cc...', Object(WP_Block)) #7 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #8 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #9 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #10 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #11 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #12 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1484): WP_Block->render() #13 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1522): render_block(Array) #14 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/helpers/template-part.php(160): do_blocks('<!-- wp:cwicly/...') #15 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(258): cc_modify_template_part_render(Array, '<!-- wp:cwicly/...', Object(WP_Block)) #16 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1484): WP_Block->render() #17 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1522): render_block(Array) #18 /Users/laugau/Local Sites/naomi/app/public/wp-includes/block-template.php(260): do_blocks('<!-- wp:templat...') #19 /Users/laugau/Local Sites/naomi/app/public/wp-includes/template-canvas.php(12): get_the_block_template_html() #20 /Users/laugau/Local Sites/naomi/app/public/wp-includes/template-loader.php(106): include('/Users/laugau/L...') #21 /Users/laugau/Local Sites/naomi/app/public/wp-blog-header.php(19): require_once('/Users/laugau/L...') #22 /Users/laugau/Local Sites/naomi/app/public/index.php(17): require('/Users/laugau/L...') #23 {main} thrown in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1885

Step-by-step reproduction instructions:
Please write the steps needed to reproduce the bug.
Use Shuffle and copy/paste some sections.
Make some edits.
I guess the error will finish to pop up.
Sadly, I didn’t succeed to isolate the error but I can provide a .zip export.

Environment info

  • WordPress version: 6.4.3
  • Cwicly Plugin version: 1.4.0.3

Hello @LauGau,

Thanks for the report.
Could you possibly send support@cwicly.com a few more details about the HTML you’re pasting into Cwicly?
It seems as if there might be some invalid characters within the SVGs that are being added.

Thanks in advance.

Cheers,

The section was this one:

<section data-section-id="13" data-share="" data-category="faq" data-component-id="2b43ff56_01_awz" class="relative py-20 overflow-hidden bg-gray-50">
        <img class="absolute top-0 left-0 mt-44" src="saturn-assets/images/faq/light-blue-left.png" alt="" data-config-id="auto-img-1-1">
        <img class="absolute top-0 right-0 mt-10" src="saturn-assets/images/faq/star-right.svg" alt="" data-config-id="auto-img-2-1">
        <div class="relative container px-4 mx-auto">
          <div class="max-w-5xl mx-auto">
            <div class="text-center mb-24">
              <span class="inline-block py-1 px-3 mb-4 text-xs font-semibold text-orange-900 bg-orange-50 rounded-full" data-config-id="auto-txt-1-1">FREQUENTLY ASK QUESTION</span>
              <h1 class="font-heading text-5xl xs:text-6xl md:text-7xl font-bold text-gray-900">
                <span data-config-id="auto-txt-2-1">You ask? We</span>
                <span class="font-serif italic" data-config-id="auto-txt-3-1">answer</span>
              </h1>
            </div>
            <div class="pt-18 sm:pt-24 px-8 sm:px-20 pb-18 bg-white rounded-4xl shadow-lg">
              <button class="flex mb-8 pb-8 group w-full items-start justify-between border-b border-gray-100 text-left">
                <div class="max-w-xl pr-5">
                  <h3 class="text-xl font-semibold text-orange-900 mb-3" data-config-id="auto-txt-4-1">Do you provide a complete design style?</h3>
                  <p class="text-lg text-gray-500" data-config-id="auto-txt-5-1">Pretium ac auctor quis urna orci feugiat. Vulputate tellus velit tellus orci auctor vel nulla facilisi ut. Ante nunc risus viverra vivamus. Eros amet at lectus ac ac nibh dignissim.</p>
                </div>
                <div class="pt-1">
                  <span>
                    <svg width="17" height="3" viewBox="0 0 17 3" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-1-1">
                      <path d="M15.4619 0.045166H1.46194C1.19673 0.045166 0.942374 0.150523 0.754838 0.338059C0.567302 0.525596 0.461945 0.77995 0.461945 1.04517C0.461945 1.31038 0.567302 1.56474 0.754838 1.75227C0.942374 1.93981 1.19673 2.04517 1.46194 2.04517H15.4619C15.7272 2.04517 15.9815 1.93981 16.1691 1.75227C16.3566 1.56474 16.4619 1.31038 16.4619 1.04517C16.4619 0.77995 16.3566 0.525596 16.1691 0.338059C15.9815 0.150523 15.7272 0.045166 15.4619 0.045166Z" fill="#FF460C"></path>
                    </svg>
                  </span>
                </div>
              </button>
              <button class="flex mb-8 pb-8 group w-full items-start justify-between border-b border-gray-100 text-left">
                <div class="max-w-xl pr-5">
                  <h3 class="text-xl font-semibold text-black group-hover:text-orange-900" data-config-id="auto-txt-6-1">Do you provide a complete design style?</h3>
                  <p class="hidden group-hover:block mt-3 text-lg text-gray-500" data-config-id="auto-txt-7-1">Pretium ac auctor quis urna orci feugiat. Vulputate tellus velit tellus orci auctor vel nulla facilisi ut. Ante nunc risus viverra vivamus. Eros amet at lectus ac ac nibh dignissim.</p>
                </div>
                <div class="pt-1">
                  <span class="hidden group-hover:block">
                    <svg width="17" height="3" viewBox="0 0 17 3" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-2-1">
                      <path d="M15.4619 0.045166H1.46194C1.19673 0.045166 0.942374 0.150523 0.754838 0.338059C0.567302 0.525596 0.461945 0.77995 0.461945 1.04517C0.461945 1.31038 0.567302 1.56474 0.754838 1.75227C0.942374 1.93981 1.19673 2.04517 1.46194 2.04517H15.4619C15.7272 2.04517 15.9815 1.93981 16.1691 1.75227C16.3566 1.56474 16.4619 1.31038 16.4619 1.04517C16.4619 0.77995 16.3566 0.525596 16.1691 0.338059C15.9815 0.150523 15.7272 0.045166 15.4619 0.045166Z" fill="#FF460C"></path>
                    </svg>
                  </span>
                  <span class="block group-hover:hidden">
                    <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-3-1">
                      <path d="M15.4619 7H9.46194V1C9.46194 0.734784 9.35659 0.48043 9.16905 0.292893C8.98151 0.105357 8.72716 0 8.46194 0C8.19673 0 7.94237 0.105357 7.75484 0.292893C7.5673 0.48043 7.46194 0.734784 7.46194 1V7H1.46194C1.19673 7 0.942374 7.10536 0.754838 7.29289C0.567302 7.48043 0.461945 7.73478 0.461945 8C0.461945 8.26522 0.567302 8.51957 0.754838 8.70711C0.942374 8.89464 1.19673 9 1.46194 9H7.46194V15C7.46194 15.2652 7.5673 15.5196 7.75484 15.7071C7.94237 15.8946 8.19673 16 8.46194 16C8.72716 16 8.98151 15.8946 9.16905 15.7071C9.35659 15.5196 9.46194 15.2652 9.46194 15V9H15.4619C15.7272 9 15.9815 8.89464 16.1691 8.70711C16.3566 8.51957 16.4619 8.26522 16.4619 8C16.4619 7.73478 16.3566 7.48043 16.1691 7.29289C15.9815 7.10536 15.7272 7 15.4619 7Z" fill="black"></path>
                    </svg>
                  </span>
                </div>
              </button>
              <button class="flex mb-8 pb-8 group w-full items-start justify-between border-b border-gray-100 text-left">
                <div class="max-w-xl pr-5">
                  <h3 class="text-xl font-semibold text-black group-hover:text-orange-900" data-config-id="auto-txt-8-1">How was the license?</h3>
                  <p class="hidden group-hover:block mt-3 text-lg text-gray-500" data-config-id="auto-txt-9-1">Pretium ac auctor quis urna orci feugiat. Vulputate tellus velit tellus orci auctor vel nulla facilisi ut. Ante nunc risus viverra vivamus. Eros amet at lectus ac ac nibh dignissim.</p>
                </div>
                <div class="pt-1">
                  <span class="hidden group-hover:block">
                    <svg width="17" height="3" viewBox="0 0 17 3" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-4-1">
                      <path d="M15.4619 0.045166H1.46194C1.19673 0.045166 0.942374 0.150523 0.754838 0.338059C0.567302 0.525596 0.461945 0.77995 0.461945 1.04517C0.461945 1.31038 0.567302 1.56474 0.754838 1.75227C0.942374 1.93981 1.19673 2.04517 1.46194 2.04517H15.4619C15.7272 2.04517 15.9815 1.93981 16.1691 1.75227C16.3566 1.56474 16.4619 1.31038 16.4619 1.04517C16.4619 0.77995 16.3566 0.525596 16.1691 0.338059C15.9815 0.150523 15.7272 0.045166 15.4619 0.045166Z" fill="#FF460C"></path>
                    </svg>
                  </span>
                  <span class="block group-hover:hidden">
                    <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-5-1">
                      <path d="M15.4619 7H9.46194V1C9.46194 0.734784 9.35659 0.48043 9.16905 0.292893C8.98151 0.105357 8.72716 0 8.46194 0C8.19673 0 7.94237 0.105357 7.75484 0.292893C7.5673 0.48043 7.46194 0.734784 7.46194 1V7H1.46194C1.19673 7 0.942374 7.10536 0.754838 7.29289C0.567302 7.48043 0.461945 7.73478 0.461945 8C0.461945 8.26522 0.567302 8.51957 0.754838 8.70711C0.942374 8.89464 1.19673 9 1.46194 9H7.46194V15C7.46194 15.2652 7.5673 15.5196 7.75484 15.7071C7.94237 15.8946 8.19673 16 8.46194 16C8.72716 16 8.98151 15.8946 9.16905 15.7071C9.35659 15.5196 9.46194 15.2652 9.46194 15V9H15.4619C15.7272 9 15.9815 8.89464 16.1691 8.70711C16.3566 8.51957 16.4619 8.26522 16.4619 8C16.4619 7.73478 16.3566 7.48043 16.1691 7.29289C15.9815 7.10536 15.7272 7 15.4619 7Z" fill="black"></path>
                    </svg>
                  </span>
                </div>
              </button>
              <button class="flex mb-8 pb-8 group w-full items-start justify-between border-b border-gray-100 text-left">
                <div class="max-w-xl pr-5">
                  <h3 class="text-xl font-semibold text-black group-hover:text-orange-900" data-config-id="auto-txt-10-1">How was the license?</h3>
                  <p class="hidden group-hover:block mt-3 text-lg text-gray-500" data-config-id="auto-txt-11-1">Pretium ac auctor quis urna orci feugiat. Vulputate tellus velit tellus orci auctor vel nulla facilisi ut. Ante nunc risus viverra vivamus. Eros amet at lectus ac ac nibh dignissim.</p>
                </div>
                <div class="pt-1">
                  <span class="hidden group-hover:block">
                    <svg width="17" height="3" viewBox="0 0 17 3" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-6-1">
                      <path d="M15.4619 0.045166H1.46194C1.19673 0.045166 0.942374 0.150523 0.754838 0.338059C0.567302 0.525596 0.461945 0.77995 0.461945 1.04517C0.461945 1.31038 0.567302 1.56474 0.754838 1.75227C0.942374 1.93981 1.19673 2.04517 1.46194 2.04517H15.4619C15.7272 2.04517 15.9815 1.93981 16.1691 1.75227C16.3566 1.56474 16.4619 1.31038 16.4619 1.04517C16.4619 0.77995 16.3566 0.525596 16.1691 0.338059C15.9815 0.150523 15.7272 0.045166 15.4619 0.045166Z" fill="#FF460C"></path>
                    </svg>
                  </span>
                  <span class="block group-hover:hidden">
                    <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-7-1">
                      <path d="M15.4619 7H9.46194V1C9.46194 0.734784 9.35659 0.48043 9.16905 0.292893C8.98151 0.105357 8.72716 0 8.46194 0C8.19673 0 7.94237 0.105357 7.75484 0.292893C7.5673 0.48043 7.46194 0.734784 7.46194 1V7H1.46194C1.19673 7 0.942374 7.10536 0.754838 7.29289C0.567302 7.48043 0.461945 7.73478 0.461945 8C0.461945 8.26522 0.567302 8.51957 0.754838 8.70711C0.942374 8.89464 1.19673 9 1.46194 9H7.46194V15C7.46194 15.2652 7.5673 15.5196 7.75484 15.7071C7.94237 15.8946 8.19673 16 8.46194 16C8.72716 16 8.98151 15.8946 9.16905 15.7071C9.35659 15.5196 9.46194 15.2652 9.46194 15V9H15.4619C15.7272 9 15.9815 8.89464 16.1691 8.70711C16.3566 8.51957 16.4619 8.26522 16.4619 8C16.4619 7.73478 16.3566 7.48043 16.1691 7.29289C15.9815 7.10536 15.7272 7 15.4619 7Z" fill="black"></path>
                    </svg>
                  </span>
                </div>
              </button>
              <button class="flex mb-8 pb-8 group w-full items-start justify-between border-b border-gray-100 text-left">
                <div class="max-w-xl pr-5">
                  <h3 class="text-xl font-semibold text-black group-hover:text-orange-900" data-config-id="auto-txt-12-1">How much we can buy this marvelous product?</h3>
                  <p class="hidden group-hover:block mt-3 text-lg text-gray-500" data-config-id="auto-txt-13-1">Pretium ac auctor quis urna orci feugiat. Vulputate tellus velit tellus orci auctor vel nulla facilisi ut. Ante nunc risus viverra vivamus. Eros amet at lectus ac ac nibh dignissim.</p>
                </div>
                <div class="pt-1">
                  <span class="hidden group-hover:block">
                    <svg width="17" height="3" viewBox="0 0 17 3" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-8-1">
                      <path d="M15.4619 0.045166H1.46194C1.19673 0.045166 0.942374 0.150523 0.754838 0.338059C0.567302 0.525596 0.461945 0.77995 0.461945 1.04517C0.461945 1.31038 0.567302 1.56474 0.754838 1.75227C0.942374 1.93981 1.19673 2.04517 1.46194 2.04517H15.4619C15.7272 2.04517 15.9815 1.93981 16.1691 1.75227C16.3566 1.56474 16.4619 1.31038 16.4619 1.04517C16.4619 0.77995 16.3566 0.525596 16.1691 0.338059C15.9815 0.150523 15.7272 0.045166 15.4619 0.045166Z" fill="#FF460C"></path>
                    </svg>
                  </span>
                  <span class="block group-hover:hidden">
                    <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-9-1">
                      <path d="M15.4619 7H9.46194V1C9.46194 0.734784 9.35659 0.48043 9.16905 0.292893C8.98151 0.105357 8.72716 0 8.46194 0C8.19673 0 7.94237 0.105357 7.75484 0.292893C7.5673 0.48043 7.46194 0.734784 7.46194 1V7H1.46194C1.19673 7 0.942374 7.10536 0.754838 7.29289C0.567302 7.48043 0.461945 7.73478 0.461945 8C0.461945 8.26522 0.567302 8.51957 0.754838 8.70711C0.942374 8.89464 1.19673 9 1.46194 9H7.46194V15C7.46194 15.2652 7.5673 15.5196 7.75484 15.7071C7.94237 15.8946 8.19673 16 8.46194 16C8.72716 16 8.98151 15.8946 9.16905 15.7071C9.35659 15.5196 9.46194 15.2652 9.46194 15V9H15.4619C15.7272 9 15.9815 8.89464 16.1691 8.70711C16.3566 8.51957 16.4619 8.26522 16.4619 8C16.4619 7.73478 16.3566 7.48043 16.1691 7.29289C15.9815 7.10536 15.7272 7 15.4619 7Z" fill="black"></path>
                    </svg>
                  </span>
                </div>
              </button>
              <button class="flex group w-full items-start justify-between text-left">
                <div class="max-w-xl pr-5">
                  <h3 class="text-xl font-semibold text-black group-hover:text-orange-900" data-config-id="auto-txt-14-1">Do you have any terms &amp; conditions?</h3>
                  <p class="hidden group-hover:block mt-3 text-lg text-gray-500" data-config-id="auto-txt-15-1">Pretium ac auctor quis urna orci feugiat. Vulputate tellus velit tellus orci auctor vel nulla facilisi ut. Ante nunc risus viverra vivamus. Eros amet at lectus ac ac nibh dignissim.</p>
                </div>
                <div class="pt-1">
                  <span class="hidden group-hover:block">
                    <svg width="17" height="3" viewBox="0 0 17 3" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-10-1">
                      <path d="M15.4619 0.045166H1.46194C1.19673 0.045166 0.942374 0.150523 0.754838 0.338059C0.567302 0.525596 0.461945 0.77995 0.461945 1.04517C0.461945 1.31038 0.567302 1.56474 0.754838 1.75227C0.942374 1.93981 1.19673 2.04517 1.46194 2.04517H15.4619C15.7272 2.04517 15.9815 1.93981 16.1691 1.75227C16.3566 1.56474 16.4619 1.31038 16.4619 1.04517C16.4619 0.77995 16.3566 0.525596 16.1691 0.338059C15.9815 0.150523 15.7272 0.045166 15.4619 0.045166Z" fill="#FF460C"></path>
                    </svg>
                  </span>
                  <span class="block group-hover:hidden">
                    <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-11-1">
                      <path d="M15.4619 7H9.46194V1C9.46194 0.734784 9.35659 0.48043 9.16905 0.292893C8.98151 0.105357 8.72716 0 8.46194 0C8.19673 0 7.94237 0.105357 7.75484 0.292893C7.5673 0.48043 7.46194 0.734784 7.46194 1V7H1.46194C1.19673 7 0.942374 7.10536 0.754838 7.29289C0.567302 7.48043 0.461945 7.73478 0.461945 8C0.461945 8.26522 0.567302 8.51957 0.754838 8.70711C0.942374 8.89464 1.19673 9 1.46194 9H7.46194V15C7.46194 15.2652 7.5673 15.5196 7.75484 15.7071C7.94237 15.8946 8.19673 16 8.46194 16C8.72716 16 8.98151 15.8946 9.16905 15.7071C9.35659 15.5196 9.46194 15.2652 9.46194 15V9H15.4619C15.7272 9 15.9815 8.89464 16.1691 8.70711C16.3566 8.51957 16.4619 8.26522 16.4619 8C16.4619 7.73478 16.3566 7.48043 16.1691 7.29289C15.9815 7.10536 15.7272 7 15.4619 7Z" fill="black"></path>
                    </svg>
                  </span>
                </div>
              </button>
            </div>
          </div>
        </div>
      </section>

Not sure what’s wrong with it. I will also send and archive of the site at support@cwicly.com as for now I cannot recover my page.

Thanks again for your help

So yes, it seems related to the SVGs.
Maybe the data-config-id="auto-svg-1-1"

I re-confirm that I had the following options enabled :

  • SVG Uploads
  • Import SVGs from HTML copy/paste
  • Inline SVG

The last update totally solved the issue.

Thanks for the quick fix @Louis :pray:

1 Like

Hello @LauGau,

Thanks for providing the local installation to us, this helped us debug the situation.
There were a few invalid SVGs in your design (data attributes with a - at the end and no value) which were not being fixed in our initial function.

Thanks for confirming this no longer causes a fatal error on your end, much appreciated!

Cheers,