rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

Warning: Illegal string offset '@type' in schema\class-admin.php on line 207 #98

Closed codetot closed 2 years ago

codetot commented 3 years ago

Describe the bug

Warning: Illegal string offset '@type' in wp-content\plugins\seo-by-rank-math\includes\modules\schema\class-admin.php on line 207

To Reproduce Steps to reproduce the behavior:

  1. Install RankMath
  2. In Setup Guide, just skip all steps.
  3. Migrate posts from old site (which has Rank Math data) using WP All Import plugin (add all custom fields)
  4. Navigate to Posts after migrating.

Screenshots

Screenshot_2

Additional context

I believe your code check empty($schemas) is not good cover in this case. In my dump data, it loads:

'schema-177880' => string '' (length=0)
  'schema-177883' => string '' (length=0)
  'schema-177922' => string '' (length=0)
  'schema-177938' => string '' (length=0)
codetot commented 3 years ago

And in frontpage, it has same issue:

( ! ) Warning: Illegal string offset '@type' in D:\Laragon-WebServer\www\mcv2\wp-content\plugins\seo-by-rank-math\includes\modules\schema\class-opengraph.php on line 46
surajv commented 2 years ago

@codetot could you please udpate to the latest version and check again?

Thank you.