publishpress / PublishPress-Authors

PublishPress Authors is the best plugin for adding many authors to one WordPress post. You can create multiple authors, co-authors and guest authors.
14 stars 8 forks source link

Schema Issue with RankMath #1901

Open rizaardiyanto1412 opened 2 months ago

rizaardiyanto1412 commented 2 months ago

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; }