Description
Description:
Schema.org @dataset is added to the chart if the Title and description are filled: https://vertis.d.pr/qdMpO5
Schema on the page - https://vertis.d.pr/QZQp4r
This works fine, however, when checking on Google structure data testing tool, there are warnings about adding two optional/recommended properties (license and creator):
https://vertis.d.pr/vbFu9u
There are many optional properties - https://developers.google.com/search/docs/data-types/dataset#dataset
However, warnings are thrown only for license and creator.
This doesn't break schema but as these are only 2 properties throwing warnings maybe we can add fields to the plugin's UI and allow users to input values for these 2 properties?
Alternatives:
An alternative is to use a filter and modify the string of Schema, for example to add license (to all charts):
add_filter( 'visualizer_schema', function( $schema, $chart_id ) {
$schema = str_replace('
}', ',
"license":"https://urlicense.com"
}', $schema);
return $schema;
}, 10, 2 );
Or per chart -
add_filter( 'visualizer_schema', function( $schema, $chart_id ) {
if ($chart_id = 13) {
$schema = '{
"@context":"https://schema.org/",
"@type":"Dataset",
"name":"Title of your chart that will replace what is set in Visualizer",
"description":"Description of your chart that will replace description set in Chart settings",
"license":"https://creativecommons.org/publicdomain/zero/1.0/"
}';
}
return $schema;
}, 10, 2 );
For users that have many charts, this is not a very practical approach.
Ticket - https://secure.helpscout.net/conversation/1468413923/272924/