Opened 6 years ago
Closed 6 years ago
#4998 closed defect (bug) (fixed)
Improvements to plugin page schema
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | low | |
| Component: | Plugin Directory | Keywords: | seo |
| Cc: |
Description (last modified by )
Plugin pages like https://en-gb.wordpress.org/plugins/wordpress-seo/ include schema.org markup in the form of JSON-LD.
It contains some minor issues, which should be rectified. Specifically:
- Remove the
BreadcrumbListnode. This is erroneous in its current format, and will be reintroduced via a future issue.
- Remove the escaped slashes in the
downloadUrlproperty; e.g.,https:\/\/downloads.wordpress.org\/plugin\/wordpress-seo.12.9.1.zipshould behttps://downloads.wordpress.org/plugin/wordpress-seo.12.9.1.zip.
- In the
AggregateRatingproperty, change theworstRatingvalue to1.
- Add a
urlproperty, where the value is the canonical URL of the plugin.
Related, #4695
Change History (12)
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
6 years ago
Edit: Also, https://developers.google.com/structured-data/testing-tool/ seems OK with the syntax at present.
It isn't okay with the syntax when you run it on the example plugin without reviews (https://en-gb.wordpress.org/plugins/tortoiz-feed/).
Maybe the best route is to move worstRating to 1 (or omit it, which defaults to 1) and conditionally add the aggregateRating prop if reviews are present?
#4
in reply to:
↑ 3
@
6 years ago
Replying to dufresnesteven:
It isn't okay with the syntax when you run it on the example plugin without reviews (https://en-gb.wordpress.org/plugins/tortoiz-feed/).
Huh, I must've run it against the same plugin twice..
Maybe the best route is to move
worstRatingto 1 (or omit it, which defaults to 1) and conditionally add theaggregateRatingprop if reviews are present?
That sounds like the best option to me, Drop worstRating and Conditionally add aggregateRating if ratingValue >= 1
#5
@
6 years ago
- If un-slashing the
urlvalue is a pain, we can live with it for now. Will need to address eventually, but not an urgent problem.
- Yes, the
urlshould be on theSoftwareApplicationpiece - and it should indeed reference the 'local' version; sorry for the lack of clarity on that one!
- We should leave the
worstRatingvalue as1, but omit theaggregateRatingpiece (which contains theworstRatingproperty) if there are no reviews of the plugin.
#6
@
6 years ago
If un-slashing the url value is a pain, we can live with it for now. Will need to address eventually, but not an urgent problem.
Like I said, is there any real reason to? Other than looking prettier? It's valid JSON as it is and parses correctly.
#7
@
6 years ago
Yeah, primarily because consistency of values is important.
As we gradually extend the JSON into a full graph, we need to avoid the risk of conflicting or divergent values, otherwise, we're going to send conflicting signals. This is going to get particularly headachey as we start to use proper ID structures (based on URLs), when the URL values then differ from the ID structure.
There are many cases where URL and ID values are used interchangably (e.g., in Google's interpretation of the breadcrumb spec), so we need a standardised approach. We also need to anticipate interoperability with other systems which use/reference nodes by ID or by URL, which means that those values have to be predictable and consistent.
See the example markup here, for example.
I'm fairly certain that the escaped Slashes isn't an issue as it's a JSON literal. But we can pass
JSON_UNESCAPED_SLASHESto avoid that happening if 100% absolutely required.. annoyingly it's a JSON blob that's built up using manywp_json_encode()'s so i'd be inclined to leave it as-is.Ratingcan technically be 0, which I guess represents an unrated plugin, Just to randomly pick one of the latest plugins as an example:https://en-gb.wordpress.org/plugins/tortoiz-feed/. Shouldn'tworstRatingtherefor be 0?To be clear, that should be added to the
"@type": "SoftwareApplication",node correct?Should it be the global WordPress.org domain or the localised one? I'm assuming the localised one?
For reference, implementation is here: https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php?marks=16-128#L16
Edit: Also, https://developers.google.com/structured-data/testing-tool/ seems OK with the syntax at present.