Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema Issue with RankMath #1901

Open
rizaardiyanto1412 opened this issue Sep 10, 2024 · 0 comments
Open

Schema Issue with RankMath #1901

rizaardiyanto1412 opened this issue Sep 10, 2024 · 0 comments

Comments

@rizaardiyanto1412
Copy link
Contributor

rizaardiyanto1412 commented Sep 10, 2024

Original report: https://secure.helpscout.net/conversation/2700707337/225602?viewId=6932143

Step to replicate:

  1. Install RankMath
  2. Set article type to NewsArticle

image

When PublishPress Authors active, you will get this scheme
schema issue.txt

When PublishPress Authors deactivated, you will get correct schema:
correct schema.txt

The difference?

WRONG:
image

CORRECT:
image

From client:

Found the line code with the issue, removed the function, and it's working correctly.

publishpress-authors-pro/lib/vendor/publishpress/publishpress-authors/src/modules/rank-math-seo-integration/rank-math-seo-integration.php

if (isset($data['publisher'])) {
$data_publisher = $data['publisher'];
if (isset($author_profile_data['@name'])) {
$data_publisher['name'] = $author_profile_data['@name'];
} elseif (isset($author_profile_data['name'])) {
$data_publisher['name'] = $author_profile_data['name'];
}
if (isset($author_profile_data['sameAs'])) {
$data_publisher['sameAs'] = $author_profile_data['sameAs'];
}

if (isset($author_profile_data['@image'])) {
if (isset($data_publisher['image'])) {
$data_publisher['image'] = $author_profile_data['@image'];
} elseif (isset($data_publisher['logo'])) {
$data_publisher['logo'] = $author_profile_data['@image'];
}
} elseif (isset($author_profile_data['image'])) {
if (isset($data_publisher['image'])) {
$data_publisher['image'] = $author_profile_data['image'];
} elseif (isset($data_publisher['logo'])) {
$data_publisher['logo'] = $author_profile_data['image'];
}
}
$data['publisher'] = $data_publisher;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants