rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

Undefined array key 'width' for SVG logos #249

Open Dead-Man-Walker opened 1 year ago

Dead-Man-Walker commented 1 year ago

Describe the bug When a logo of type SVG is set, the error Undefined array key "width" is thrown. This is due to the Wordpress function _wp_get_attachmentmetadata(...) returning fewer array elements for SVG images. The error is thrown in .../plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.php:476

To Reproduce Set an SVG image in Rank Math SEO > Titles & Meta > Local SEO > Logo and reload the front page.

Expected behavior No error

Additional context Add any other context about the problem here.

pratikrm commented 1 year ago

Hi @Dead-Man-Walker

We couldn't reproduce this issue on our setup. Maybe some plugin or theme on your site is changing the metadata using wp_get_attachment_metadata filter? Can you please test this by disabling all the plugins and with default WordPress theme?