wordproof / wordproof-timestamp

WordProof Timestamp Plugin for WordPress
GNU General Public License v3.0
12 stars 7 forks source link

Schema output is malformed / invalid / has structural errors #38

Open jonoalderson opened 3 years ago

jonoalderson commented 3 years ago

The current schema output is malformed / invalid / has structural errors.

For example:

As such, I'd recommend restructuring the output to align with the following example (based on https://yoast.com/wordpress-5-7/):

Examples

Before

<script type="application/ld+json" class="wordproof-schema">
{
  "@context": {
    "@type":"ArticleTimestamp",
    "@version":"0.2.0"
  },
  "blockchain": "eosio_main",
  "transactionId": "9e72f05cd1f03474db452daa93eccfd90b03c06ce6eaf85efb757eee79f67b46",
  "hash": "451a293ed8eed619a4ed19d81c96fb52c0f4b6499935ccab3cd7d176fce81eb2",
  "title": "WordPress 5.7: What's new in this release?",
  "content": "[...]",
  "date": "2021-03-10T09:29:06+01:00",
  "url": "https:\/\/yoast.com\/wordpress-5-7\/"
}
</script>

After

<script type="application/ld+json" class="wordproof-schema">
{
  "@context": "https://wordproof.com/schema/",
  "@graph": [{
    "@type":"ArticleTimestamp",
    "blockchain": "eosio_main",
    "transactionId": "9e72f05cd1f03474db452daa93eccfd90b03c06ce6eaf85efb757eee79f67b46",
    "hash": "451a293ed8eed619a4ed19d81c96fb52c0f4b6499935ccab3cd7d176fce81eb2",
    "title": "WordPress 5.7: What's new in this release?",
    "content": "[...]",
    "date":"2021-03-10T09:29:06+01:00",
    "url": "https://yoast.com/wordpress-5-7/"
  }]
}
</script>
andrei0x309 commented 3 years ago

This will cause problems with AMP too: screenshoot

Full-size image link