This issue affected one of our sites. We actually don’t use Publicize, but the issue appeared after using slideshows for our galleries, instead of just laying them all out in columns. The error code only appeared I want to say on pages using the slideshows, but I could always recheck.
What I ended up doing was temporarily editing the plugin’s php file until the plugin is updated to correct this error.
Disclaimer: I’m in no way affiliated with this plugin and am obviously not responsible for any issues you may encounter, so please back up before you make any changes!!!
1. In the WordPress Dashboard, go to Plugins > Editor > Select Jetpack for WordPress.com to edit plugin > Then scroll until you see “jetpack/modules/publicize.php.” You’ll then want to click on “jetpack/modules/publicize/enhanced-open-graph.php.”
2. Jump to Line 49 as mentioned in the error and delete the code around it, or look for:
/**
* Better OG Image Tags for Gallery Post Formats
*/
function enhanced_og_gallery( $tags ) {
if ( !is_singular() || post_password_required() )
return $tags;
global $post;
// Always favor featured images.
if ( enhanced_og_has_featured_image( $post->ID ) )
return $tags;
$summary = Jetpack_Media_Summary::get( $post->ID );
if ( 'gallery' != $summary['type'] )
return $tags;
$images = $secures = array();
foreach ( $summary['images'] as $i => $image ) {
$images[] = $image['url'];
$secures[] = $summary['secure']['images'][$i]['url'];
}
$tags['og:image'] = $images;
$tags['og:image:secure_url'] = $secures;
return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'enhanced_og_gallery' );
3. Delete that text and click Update File. Check your site and see if that removed the error text!
Afterwards, I logged out and took a look to see if everything still looked OK. From what I’m seeing everything seems to work. I also logged back in and did some more work to ensure all was well. If anything, it may affect open-graph data for SEO? No idea. I just needed the error message gone!
Should I encounter any further errors, I’ll be sure to let you know.