PHP Warning: Undefined array key “iconStyles” in Testimonials Block
-
I’m encountering a persistent PHP warning related to the Testimonials block, specifically involving the
iconStylesarray key. While theiconStyleskey 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 641I’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:
- 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.
- Confirmed
iconStylesin Block JSON: I have inspected the raw block code (in the Code Editor) and can confirm that theiconStyleskey 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
iconStyleskey:{ "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 641is accessing or expecting theiconStylesattribute 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!
The topic ‘PHP Warning: Undefined array key “iconStyles” in Testimonials Block’ is closed to new replies.