I was getting the same error.
if ( version_compare( $current_version, '1.2.3', '<' ) ) {
$opt = get_option('wpseo');
foreach ( $opt as $key => $val ) {
if ( !in_array( $key, array('ignore_blog_public_warning', 'ignore_tour', 'ignore_page_comments', 'ignore_permalink', 'ms_defaults_set', 'version', 'disableadvanced_meta', 'googleverify', 'msverify', 'alexaverify') ) ) {
unset( $opt[$key] );
}
}
update_option('wpseo', $opt);
}
It seems that the one that’s causing the error are the options. The $opt variable above is trowing a string when it’s supposed to be an array. The only fast way that I’ve seen is by updating the settings on the Yoast WordPress SEO dashboard.