Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
I have just raised this with our dev team and we will be getting back to you shortly with more info to address this vulnerability.
Looking forward to helping you. Thank you.
Hello,
Thank you for letting us know about this issue. I have forwarded this issue to our Development Team and they will release an update soon with the fix.
For now, to fix the issue on your site please change following code in plugins/schema-markup-rich-snippets/schema-markup-rich-snippets.php on line 381
change:
if ( is_user_logged_in() && is_admin_bar_showing() ) {
$this->container['json']->add( 'version', $this->version, 'rankMath' );
$this->container['json']->add( 'ajaxurl', admin_url( 'admin-ajax.php' ), 'rankMath' );
$this->container['json']->add( 'adminurl', admin_url( 'admin.php' ), 'rankMath' );
$this->container['json']->add( 'security', wp_create_nonce( 'rank-math-schema-ajax-nonce' ), 'rankMath' );
}
to
if ( is_user_logged_in() && is_admin_bar_showing() ) {
$this->container['json']->add( 'version', $this->version, 'rankMath' );
$this->container['json']->add( 'ajaxurl', admin_url( 'admin-ajax.php' ), 'rankMath' );
$this->container['json']->add( 'adminurl', admin_url( 'admin.php' ), 'rankMath' );
$this->container['json']->add( 'security', wp_create_nonce( 'rank-math-schema-ajax-nonce' ), 'rankMath' );
}
That should fix the issue.
I hope that helps. If there is anything else, please let us know.
Thank you.
I got a plugin fatal error when adding if ( is_user_logged_in() && is_admin_bar_showing() ) {
however I now just removed the part starting line 381 completely, because we don’t need these frontend hints. We just need the JSON LD.
Thanks!
Hi there,
Thanks for the follow up.
I am glad that you were able to fix this 🙂
Feel free to contact us should any other issues come up. Thank you.