• My site is on WordPress 5.2.4 and version 1.7.7 of the Schema plugin. I’m getting the following error in WP_Debug mode and have narrowed it down to this plugin:

    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

    I swapped out my theme with the 2019 Theme and the error persists. Any assistance you can provide would be helpful. Thank you in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hesham Zebida

    (@hishaman)

    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!

    Plugin Author Hesham Zebida

    (@hishaman)

    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?

    Plugin Author Hesham Zebida

    (@hishaman)

    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.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Undefined index: scheme error’ is closed to new replies.