I’m getting error messages on plugins that still use wpseo_opengraph which is deprecated. Using string locator pluginb I noticed that wpseo_opengraph is used in Mooberry book manager (the numbers are line number and line position):
… add_filter(‘wpseo_opengraph_title’, array( $this, ‘override_wp_…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-tax-grid-page.php 28 14
… add_filter(‘wpseo_opengraph_url’, array( $this, ‘override_wp_se…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-tax-grid-page.php 29 14
… add_filter(‘wpseo_opengraph_desc’, array( $this, ‘override_wp_s…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-tax-grid-page.php 30 14
… add_filter(‘wpseo_opengraph_image’, array( $this, ‘override_wp_…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-tax-grid-page.php 31 14
… add_filter( ‘wpseo_opengraph_title’, array( $this, ‘override_w…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-book-cpt.php 58 16
… add_filter( ‘wpseo_opengraph_url’, array( $this, ‘override_wp_…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-book-cpt.php 59 16
… add_filter( ‘wpseo_opengraph_desc’, array( $this, ‘override_wp…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-book-cpt.php 60 16
… add_filter( ‘wpseo_opengraph_image’, array( $this, ‘override_w…
wp-content/plugins/mooberry-book-manager/includes/class-mbm-book-cpt.php 61 16
Can you please check this?
]]>Can you update the plugin?
Ben Linders
]]>I was using wpseo_opengraph to add meta tags for a second image for use by WhatsApp. WhatsApp likes a square image and it will use the last OG image (if there’s more than one) when somebody shares a webpage’s URL.
Since wpseo_opengraph has been depreciated, I rewrote the code for my functions.php file and while I am getting the og meta tags for the second image, the tags are coming at the end of the Yoast section (after the twitter tag and after the application/lt+json data), rather than just after the first image.
Having the second image og tags at the end works technically, but I would prefer to have all of the og info in one continuous section (just for esthetic reasons).
Here’s the code for the functions.php file:
// Add a second OG image (a square one for WhatsApp)
use Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter;
class Second_OG_Image_Presenter extends Abstract_Indexable_Presenter {
public function present() {
return '<meta property="og:image" content="https://www.sitename.com/wp-content/uploads/2019/08/Open-Graph-Sq.png" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />';
}
public function get() {
return "Get function not used – I’ve hard coding the image OG information above.";
}
}
function add_second_og_image_presenter( $presenters ) {
$presenters[] = new Second_OG_Image_Presenter();
return $presenters;
}
add_filter( 'wpseo_frontend_presenters', 'add_second_og_image_presenter' );
And here’s the OG info that gets created:
<meta property="og:locale" content="en_US" />
<meta property="og:locale:alternate" content="zh_CN" />
<meta property="og:locale:alternate" content="ko_KR" />
<meta property="og:locale:alternate" content="vi_VN" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Introduction" />
<meta property="og:description" content="We market products" />
<meta property="og:url" content="https://www.sitename.com/en/" />
<meta property="og:site_name" content="MIHOHoldings" />
<meta property="article:modified_time" content="2019-05-05T03:47:03+00:00" />
<meta property="og:image" content="https://www.sitename.com/wp-content/uploads/2019/05/MIHO-Open-Graph.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary" />
<script type="application/ld+json" class="yoast-schema-graph">{"@context": I deleted the json content ]}]}]}</script>
<meta property="og:image" content="https://www.sitename.com/wp-content/uploads/2019/08/MIHO-Open-Graph-Sq.png" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />
Thanks,
Rich
The following notice has been appearing on my site when my Yoast SEO plugin is activated:
Deprecated: class-opengraph-image.php is deprecated since version WPSEO 14.0 with no alternative available. in /home/const522/public_html/wp-includes/functions.php on line 4913
I gather from elsewhere in the forum that the problem is related to certain plugins. However, I’m not using any of the plugins cited. My site is up to date, including Yoast SEO 14.4.1.
I’m not a coder, but I can find my way around public_html via cPanel….
Any help appreciated.
Thanks,
Thomas Ward
]]>The error does not occur, ih either Yoast Seo or Polylang is deactivated.
Therefore I think, it is a problem of polylang.
Help would be great.
After the latest bulk updates on my site, the deprecation error appeared:
Deprecated: wpseo_opengraph is deprecated since version 14.0! Use wpseo_frontend_presenters instead.
I found the wpseo_opengraph
hook in polylang > modules > plugins > wpseo.php, line 38:
add_action( 'wpseo_opengraph', array( $this, 'wpseo_ogp' ), 2 );
so, I changed it to:
add_action( 'wpseo_frontend_presenters', array( $this, 'wpseo_ogp' ), 2 );
The error is gone, however, I’m not sure that action hooked does what it needs to do …
The wpseo_opengraph
action is deprecated since Yoast SEO v.14.0. (August 2019.)
I hope you’ll consider adding a fix for this for the next Polylang update!
Thanks
Have a great day
Regards !
]]>Please push out a fix.
]]>Fatal error: Uncaught ArgumentCountError: Too few arguments to function RTMediaInteraction::rtmedia_wpseo_og_image(), 0 passed in /public_html/wp-includes/class-wp-hook.php on line 287 and exactly 1 expected in /public_html/wp-content/plugins/buddypress-media/app/main/interactions/RTMediaInteraction.php:312 Stack trace: #0 /public_html/wp-includes/class-wp-hook.php(287): RTMediaInteraction->rtmedia_wpseo_og_image() #1 /public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array) #2 /public_html/wp-includes/plugin.php(544): WP_Hook->do_action(Array) #3 /public_html/wp-includes/plugin.php(660): do_action_ref_array(‘wpseo_opengraph’, Array) #4 /public_html/wp-content/plugins/wordpress-seo/src/integrations/front-end/backwards-compatiblity.php(60): do_action_deprecated(‘wpseo_opengraph’, Array, ‘14.0’, ‘wpseo_frontend_…’) #5 /public_html/wp-includes/class-wp-hook.php(287): Yoast\WP\SEO\Integrations\Fro in /public_html/wp-content/plugins/buddypress-media/app/main/interactions/RTMediaInteraction.php on line 312
Polylang use wpse_opengraph on line 38 of polylang/modules/plugins/wpseo.php
]]>I got the following error logs (that repeat endlessly). Not sure if it is a compatibility issue. I am using the latest version (2.1.1) WPSEO with WordPress 3.8.
class ‘WPSEO_OpenGraph’ does not have a method ‘image’ in /home/afun/public/mydomain.com/public/wp-includes/plugin.php on line 429
This only happened since I upgraded my plugin from 1.5.4 to 2.1.1.
Thanks,
Al
https://www.ads-software.com/plugins/wordpress-seo/
]]>