Archived topic
PHP error: Undefined array key "width" and "height"
5 replies · Started by Yannick on August 2, 2022
Hello,
I am using a SVG as a logo and get two PHP errors in the menu plus module. The array keys for "width" and "height" are undefined. There is a link to the site in the private information. I already tried to reupload my SVG to fix the problem.
The Query Monitor plugin shows the following traceback:
wp-content/plugins/gp-premium/menu-plus/functions/generate-menu-plus.php:2074 (or 2075)
generate_do_navigation_branding()
wp-includes/class-wp-hook.php:307
do_action('generate_inside_navigation')
wp-content/themes/generatepress/inc/structure/navigation.php:37
generate_navigation_position()
wp-content/themes/generatepress/inc/structure/navigation.php:221
generate_add_navigation_after_header()
wp-includes/class-wp-hook.php:307
do_action('generate_after_header')
wp-content/themes/generatepress/header.php:56
load_template('wp-content/themes/generatepress/header.php')
wp-includes/template.php:716
locate_template()
wp-includes/general-template.php:48
get_header()
wp-content/themes/generatepress/page.php:17
I think my problem is similar to this topic: https://generatepress.com/forums/topic/undefined-array-keys-in-menu-plus-component/
Hi Yannick,
Seems when the SVG was uploaded, there was no dimension added to the file.
Can you try to install the Safe SVG plugin, and re-upload the SVG again?
Hi Ying,
I reuploaded to logo with safe SVG and it worked. Before I used the SVG feature of Happy Files Pro. I think they dont set a width and height for an SVG.
Kind regards
Yannick.
I guess so.
Once the SVG is uploaded, you can remove the Safe SVG plugin if you want :)
Hi Ying, I have already done that. Thank you very much for your help!
You are welcome :)