Hi,
I’ve scanned the plugin files for an undefined variable $scheme, it’s used twice in the plugin functions, and it’s defined. So, it won’t cause this error.
Also in another check, the only place we are using a function that could cause this is here, but we check here for variable before using it!
See below:
if ( !empty($logo) ) {
$logo_attachment_id = attachment_url_to_postid( $logo );
// If the above function fails, we can use the commented one below:
//$logo_attachment_id = schema_wp_get_attachment_id_from_url( $logo );
if ( !empty($logo_attachment_id) ) {
$schema['logo'] = schema_wp_get_image_object_by_attachment_id( $logo_attachment_id );
$schema['logo']['@id'] = $url . '#logo';
} else {
// It's external, use image url only
$schema['logo'] = $logo;
}
}
I think this is coming from somewhere else, and not caused by the Schema plugin.
Thread Starter
270net
(@270net)
Thank you for your quick response!
To double-check myself, I deactivated all plugins except the Schema plugin and changed my theme to the default 2019 (and 2017) theme. The error persists:
Notice: Undefined index: scheme in /wordpress/wp-includes/media.php on line 4067 Notice: Undefined index: scheme in /wordpress/wp-includes/media.php on line 4068
If it is not the plugin, do you have any alternative suggestions? Or is there some additional troubleshooting I can do to narrow down the location of the error?
Thank you again in advance for your time and expertise!
Thanks for digging more into it.
Have you set the logo in: Schema Settings > Knowledge Graph > Organization info?
This probably where the function would trigger an error.
I will do another test to see what comes out and let you know.
Thread Starter
270net
(@270net)
Hello, yes, there is a logo set there. Is it necessary to include a logo there, or would it pull from the General tab?
I am asking because the notice you are seeing in the logs may comes from the function that returns logo image details.
Thread Starter
270net
(@270net)
Yes, I do have a logo set in that section.