Opened 5 years ago
Closed 5 years ago
#4998 closed defect (bug) (fixed)
Improvements to plugin page schema
Reported by: | jonoaldersonwp | 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
BreadcrumbList
node. This is erroneous in its current format, and will be reintroduced via a future issue.
- Remove the escaped slashes in the
downloadUrl
property; e.g.,https:\/\/downloads.wordpress.org\/plugin\/wordpress-seo.12.9.1.zip
should behttps://downloads.wordpress.org/plugin/wordpress-seo.12.9.1.zip
.
- In the
AggregateRating
property, change theworstRating
value to1
.
- Add a
url
property, where the value is the canonical URL of the plugin.
Related, #4695
Change History (12)
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
5 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
@
5 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
worstRating
to 1 (or omit it, which defaults to 1) and conditionally add theaggregateRating
prop if reviews are present?
That sounds like the best option to me, Drop worstRating
and Conditionally add aggregateRating
if ratingValue >= 1
#5
@
5 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.
- Yes, the
url
should be on theSoftwareApplication
piece - and it should indeed reference the 'local' version; sorry for the lack of clarity on that one!
- We should leave the
worstRating
value as1
, but omit theaggregateRating
piece (which contains theworstRating
property) if there are no reviews of the plugin.
#6
@
5 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
@
5 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_SLASHES
to 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.Rating
can 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'tworstRating
therefor 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.