seo-by-rank-math
seo-by-rank-math copied to clipboard
PHP Warning with the Table of Content: Undefined array key "titleWrapper"
Describe the bug Rankmath Version 1.0.219 WordPress is reporting many PHP Warnings linked to SEO by Rank Math plugin. It seems to happen when loading a page using the table of content block from the RankMath plugin. Here are details about the warning report on my website on Sentry: https://mathieu-lamiot.sentry.io/share/issue/da8c94003d2642e9b56b8b572fc4a3dc/
The warning comes from: /wp-content/plugins/seo-by-rank-math/includes/modules/schema/blocks/toc/class-block-toc.php in RankMath\Schema\Block_TOC::render_toc_block_content at line 103
for Warning: Undefined array key "titleWrapper"
.
In my case, from the Sentry report:
$parsed_block = {
attrs: {
headings: [
13 items
],
listStyle: ul
},
blockName: rank-math/toc-block,
innerBlocks: [],
innerContent: [
1 item
]
}
To Reproduce Steps to reproduce the behavior:
- Create a WP post with the "Table of content" block from SEO By Rank Math.
- Visit the page
- Check PHP warnings.
Expected behavior If it is expected that titleWrapper can be undefined, the plugin should not create warnings ; with a check and bail-out for instance. If it is not expected for titleWrapper to be undefined, then this case should not occur.
Screenshots NA
Desktop (please complete the following information):
- OS: MacOS 14.3
- Browser Chrome
- Version 124