• Resolved bdd

    (@bws-online)


    I’m encountering a persistent PHP warning related to the Testimonials block, specifically involving the iconStyles array key. While the iconStyles key appears to be present in the block’s saved data, the warning continues to appear in my error logs.

    Here are the exact warning messages I’m seeing (always in sets of three):

    [02-Aug-2025 19:31:08 UTC] PHP Warning:  Undefined array key "iconStyles" in /home/my-account/mysite.com/wp-content/plugins/kadence-blocks/includes/blocks/class-kadence-blocks-testimonials-block.php on line 641
    [02-Aug-2025 19:31:08 UTC] PHP Warning: Trying to access array offset on value of type null in /home/my-account/mysite.com/wp-content/plugins/kadence-blocks/includes/blocks/class-kadence-blocks-testimonials-block.php on line 641
    [02-Aug-2025 19:31:08 UTC] PHP Warning: Trying to access array offset on value of type null in /home/my-account/mysite.com/wp-content/plugins/kadence-blocks/includes/blocks/class-kadence-blocks-testimonials-block.php on line 641

    I’ve checked my error logs, and these warnings appear to have been consistently occurring since at least June 4, 2025, indicating it’s a long-standing issue, not just a recent occurrence.

    This issue occurs on a site where I use the Testimonials Carousel block on three different pages. I can’t seem to get it to happen on demand, but it’s definitely still happening. (These are not synced blocks.)

    My Setup:

    • WordPress Version: 6.8.2
    • Kadence Blocks Version: 3.5.16 (this was just updated, so it wasn’t working on previous versions either)
    • PHP Version: 8.4 (just updated today — was on 8.0 before that, with the same errors)
    • Theme: Kadence Theme 1.2.28 (A child of that) (again, main theme just updated, but it wasn’t working on previous versions either)
    • Caching Plugin: LiteSpeed Cache 7.3.0.1 (cleared; also recently updated, so it wasn’t working on previous versions either)

    Troubleshooting Steps Taken:

    1. Re-saving Pages/Blocks: I have edited each of the three pages containing the Kadence Testimonials Carousel, specifically accessing the “Icon” style section within each block, and then re-saved the pages. This did not resolve the issue.
    2. Confirmed iconStyles in Block JSON: I have inspected the raw block code (in the Code Editor) and can confirm that the iconStyles key is indeed present and contains an object with relevant settings within the block’s attributes.

    Here is the JSON snippet for one of my Kadence Testimonials Carousel blocks, showing the iconStyles key:

    {
        "uniqueID":"6846_20987a-2b",
        "layout":"carousel",
        "columnControl":"individual",
        "gap":[30,"",""],
        "transSpeed":2000,
        "containerMaxWidth":800,
        "borderStyle":[{"top":["palette3","",2],"right":["palette3","",2],"bottom":["palette3","",2],"left":["palette3","",2],"unit":"px"}],
        "responsiveContainerBorderRadius":[6,6,6,6],
        "mediaStyles":[{"width":60,"backgroundSize":"cover","background":"","backgroundOpacity":1,"border":"","borderRadius":"","borderWidth":["","","",""],"padding":["","","",""],"margin":["","","",""],"ratio":""}],
        "mediaPadding":[0,0,0,0],
        "mediaBorderStyle":[{"top":["","",0],"right":["","",0],"bottom":["","",0],"left":["","",0],"unit":"px"}],
        "displayMedia":false,
        "displayTitle":false,
        "titleFont":[{"color":"","level":2,"size":["","",""],"sizetype":"px","lineHeight":["","",""],"linetype":"px","letterSpacing":"","textTransform":"","family":"","google":false,"style":"","weight":"","variant":"","subset":"","loadGoogle":true,"padding":["","","",""],"margin":["","","",""]}],
        "displayName":false,
        "displayOccupation":false,
        "ratingStyles":[{"color":"#ffd700","size":16,"margin":["","","",""],"iconSpacing":"","icon":"fas_star","stroke":2}],
        "displayIcon":true,
        "iconStyles":[
            {"size":25,"margin":["","","",""],"padding":["","","",""],"borderWidth":["","","",""],"borderRadius":"","border":"","borderOpacity":1,"color":"","background":"","backgroundOpacity":1,"title":"","icon":"fas_quote-left","stroke":2}
        ],
        "iconBorderStyle":[{"top":["palette3","",2],"right":["palette3","",2],"bottom":["palette3","",2],"left":["palette3","",2],"unit":"px"}],
        "kbVersion":2,
        "metadata":{"name":"Home Testimonials carousel (not synced)","categories":[],"patternName":"core/block/7203"}
    }
    

    I’m told this suggests the issue is not with the saved data itself, but perhaps how the plugin’s code at line 641 is accessing or expecting the iconStyles attribute at runtime, leading to a “null” value or “undefined array key” at that specific moment.

    Could you please provide some guidance on what might be causing this and how to resolve it?

    Thank you for your time and assistance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support victormonk

    (@victormonk)

    Hey @bws-online ,

    Welcome to Kadence Support.

    While I wasn’t able to directly reproduce this, I found an older report on this topic. I have reached out to the developer over that report to see if we can find a way to reproduce and fix this. On my end, I couldn’t reproduce this from scratch.

    However, someone else has also reported this in the past. Whenever I paste their block code directly into my editor and save the changes, the error shows in my error logs. So it looks like there is something fishy potentially going on here. It’s important to note that these are warnings and not technical or functional errors. Usually, debug mode should be disabled when running in production and these warnings shouldn’t break anything. If you do notice something “broken” on your website as a result of this, please let me know so I can look further into that.

    With that being said, I’ll have our dev team see if they can source where this occurs on their end and provide them with the information you have given us. If possible, consider sharing with us your block settings or block code.

    You can share your block code by copying your testimonial block. Then, whenever you paste from your clipboard, it will provide copyable code. (Here is a GIF for reference.) If you do not want to share your block code publicly, consider opening a direct support ticket with us.

    I hope this helps!

    Thread Starter bdd

    (@bws-online)

    Thank you @victormonk! I’ll open a ticket.

    Bonn

    (@bonnstellar)

    Thanks for opening a ticket @bws-online

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Warning: Undefined array key “iconStyles” in Testimonials Block’ is closed to new replies.