Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Notices after updating to 16.1.1 #16879

Open
romancieciuch opened this issue Apr 11, 2021 · 8 comments
Open

PHP Notices after updating to 16.1.1 #16879

romancieciuch opened this issue Apr 11, 2021 · 8 comments

Comments

@romancieciuch
Copy link

Hello there!

I've got a bug after updating to 16.1.1.

Got notices pasted below:

Notice: Trying to access array offset on value of type bool in /www/wp-content/plugins/wordpress-seo/src/helpers/schema/image-helper.php on line 98

Notice: Trying to access array offset on value of type bool in /www/wp-content/plugins/wordpress-seo/src/helpers/schema/image-helper.php on line 100

Notice: Trying to access array offset on value of type bool in /www/wp-content/plugins/wordpress-seo/src/helpers/schema/image-helper.php on line 101

I have found out that:

/www/wp-content/plugins/wordpress-seo/src/helpers/schema/image-helper.php
on line 96 there should be an if-statement, as we have to double check whether the array or NULL was passed.

This solution works:

if (empty($attachment_meta)) return false;

Use my code or please use your own to fix the problem.

Thank you.

@Djennez
Copy link
Member

Djennez commented Apr 12, 2021

@romancieciuch I found that the calls to that function either don't trigger, or have the correct arguments. Can you tell me your settings from SEO -> Search Appearance -> Knowledge Graph & Schema.org? So are you using person or organization and twat is the used data?

@romancieciuch
Copy link
Author

I have chosen: Organization

And the data is:
Name: dbay.pl
Logo: File in SVG

@Djennez
Copy link
Member

Djennez commented Apr 12, 2021

Ah, right. It's the SVG that is causing this to fail. As a workaround you can set a png / jpg as a logo. I am not sure if / when we'll support svgs here.

@romancieciuch
Copy link
Author

OK, will do.

Thank you, sir! :)

@wpsumo
Copy link

wpsumo commented Apr 13, 2021

@Djennez SVG is not supported as organization logotype in wp admin by Yoast?

@Djennez
Copy link
Member

Djennez commented Apr 13, 2021

SVG is not supported as organization logotype in wp admin by Yoast?

No, it currently isn't (I don't know the reasoning behind this). SVGs aren't supported as uploadable filetypes (by default) in WordPress either.

@wpsumo
Copy link

wpsumo commented Apr 13, 2021

@Djennez Okay, it's very common these days to use vector graphics for logotypes and other media. It's not natively supported, but it is a format google support, so I still consider it important to support. Many users allow uploading of SVG files via plugins as they are sanitized before.

@gcPhil
Copy link

gcPhil commented Mar 11, 2022

I noticed a related issue: I used a SVG-File as Logo (uploaded and used without problems last year, before Yeast SEO version 16.1.1.). When I now (in version 18.2) tried to save some OTHER setting in the “Search Appearance” Settings area it results in this error message on the frontend:
Warning: Undefined array key “url” in /[MY-CENSORED-URL]/wp-content/plugins/wordpress-seo/src/helpers/schema/image-helper.php on line 98

It took several weeks until I found out that the SVG Logo file causes this. Changing to a JPG Logo worked as a workaround but it would be great if this could get fixed and SVG files would work again (or at least would produce a clear understandable error message in the backend instead of breaking the frontend.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants