-
Delai Costa
When I activate these 3 options in the wp-config file
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', true );
And with the active MENU+ feature
I get this error at the top of my website.
Notice : Undefined index: width in
/home/cp04u/public_html/domain.com/wp-content/plugins/gp-premium/menu-plus/functions/generate-menu-plus.php
on line
2200Notice : Undefined index: height in
/home/cp04u/public_html/domain.com/wp-content/plugins/gp-premium/menu-plus/functions/generate-menu-plus.php
on line
2201 -
-
Delai Costa
Hello.
Thanks for your return.Can you explain better:
01 Why do you say the values in the SVG code are wrong?
02 What would be the correct values?
03 And how do you suggest that these values be changed?
Have a great day.
-
Delai Costa
In the alert, it says that the error is in the plus menu code: “generate-menu-plus.php”
Wouldn’t the reason for the error be the fact that the menu plus code wasn’t prepared to handle SVG files?
Because all the svg files I create, I define a size for them.
I need to set a size at export time.
How am I going to create an svg file without defining its dimensions?it doesn’t make sense to me.
-
Fernando
Hello Delai,
Just remove
px
. Leave the values. -
Delai Costa
Hey,
I edited de SVG image using notepad and remove de px, this work perfectly.But see.
When i export image from coreldraw, i can’t see any option to remove this “px” from svg code, see:
https://imgur.com/a/f04YF6TDon’t you think Generatepress should handle svg images to avoid these errors?
Since the px is generated by coreldraw itself at the time of export?
Please note that this does not occur with the default WordPress theme. It’s something that only affects Generatepress
-
Fernando
Usually, SVGs now don’t have px in the code. Example: https://icons.getbootstrap.com/icons/arrow-down-square/
I tested your SVG on my test site and I’m not encountering the issue with
px
in the code.Can you try installing the Safe SVG plugin and reuploading your SVGs?: https://wordpress.org/plugins/safe-svg/
-
Delai Costa
You didn’t find it because, as I said, I removed the px via notepad, and re-uploaded the svg without px.
I already use the safe svg plugin by 10up to allow the use of svg on websites.
-
Fernando
To clarify, is it the current logo you have? If so, I re-added
px
manually. -
Delai Costa
Yes.
The logo you see now is the same svg logo, i only remove the px using the notepad and re-upload on wordpress.
-
David
Hi there,
Wouldn’t the reason for the error be the fact that the menu plus code wasn’t prepared to handle SVG files?
its actually the limitations in WordPress not supporting SVG by default.
GP uses core WordPress functions to handle the site logos.
One of those functions is this:wp_get_attachment_metadata
https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/
And it expects the
width
andheight
of the attachment to be an integer. Which is standard for aimg
attachment.If CorelDraw insists on adding
px
to those attributes then run the SVG through this optimizer:https://jakearchibald.github.io/svgomg/
That should remove them and clean up the SVG
-
Delai Costa
Thanks David, i will talk to safe svg developer and talk about this.
Have a good day.
-
David
You’re welcome
- You must be logged in to reply to this topic.