Releases: iaincollins/structured-data-testing-tool
v4.5 - Add option to API to disable auto-insertion of tests
The option auto
can now be specified as an option when using the API (example usage).
When set to false
it disables the automatic insertion of tests for structured data that is auto-detected and will only perform tests explicitly specified (either via the tests
argument, or in any Presets specified).
This reduces the number of tests performed, which can improve performance and make debugging easier - although it may mean errors are missed as more sophisticated built-in structured data tests are added over time.
This option defaults to true
(i.e. the default behaviour remains unchanged).
v4.4.1 - Fix example in README and provide additional examples
- Fixed issue with one of the examples code snippets in the README which was outdated.
- Added
examples
directory to provide examples that show how to use the API.
v4.4 - Improve <meta> tag tests and CLI output
- Improved handling of tests for
<meta>
tag properties that are missing or have no value or are empty. - Display and reporting of missing or empty properties is more consistent, but error types are still unique.
- Improved CLI output by reducing amount of data displayed by default and grouping important information.
- Updated test framework.
Version 4.0 introduced additional information in CLI output, this update reduced some of the information shown by default, but it is all still displayed with --info/-i
option is passed. Important information, such as missing properties or properties with no value set, is now better highlighted in the CLI output.
Specific error types returned by the API have been updated (and are now more specific) but the format of responses remains the same.
v4.1 - Support JSON input
Now supports auto-detecting of JSON input.
If the contents of a URL, a file or a string provided to the API or Command Line Interface is a serialized JSON object then it will be detected and parsed the same way as if it was a page with a JSON LD embedded in it.
This resolves the feature request reported in #9 by @pdehaan.
v4.0.1 - Minor improvements to documentation
Minor edits to clarify points in the documentation.
v4.0 - Adds support for flagging tests as optional
Summary
This release adds support for optional properties in presets (properties which are valid, but not required) and enhancements to the output of the CLI.
It also includes a breaking change, but it is unlikely to impact many (if any users) as the feature was rarely used and is likely to be easy to resolve by migrating tests to the new option if you are impacted by it.
Changes
Changes to supported options
This release adds a new boolean flag to tests called optional
and removes support for the more confusingly named info
option (which used to perform a similar role but had limited utility).
Tests marked as optional
do not count towards passed, failed or total tests run, though the number of optional tests run is displayed as separate statistic in the Command Line Interface.
The result of optional tests run can be inspected via the CLI and API and still have a status of passed or failed which is visible if a test is inspected, however optional tests are displayed differently on the command line (and only visible if the property being tested is found) and optional tests are grouped separately in the API response (they can be inspected by iterating over results.optional
).
Changes to the CLI
Additionally, this update also includes minor changes to the CLI output to better highlight warnings and optional information and to make it easier to view and debug results.
Additional information in the CLI output is now shown by default, including listing all properties found on any Schema objects on the page (though the tool does not currently validate the actual properties).
Example CLI output
An example of the new output below shows all the properties found on Schema.org objects for a page, and then lists the properties found on them that are known to be supported by Google for those schemas.
NB: The test below was run with the option --presets Google
.
Migrating
- If you have used the option
info
in any existing tests or custom presets, you can probably just change them all to theoptional
, however despite being a documented it option it seems like no-one was actually using it and it was not used by any of the presets, and the property was only used by internal logic. - If you were using the
results.info
property from the API response, you should change this toresults.optional
. Unlike tests with theinfo
option, all tests withoptional
set totrue
will be here, regardless of if they pass or fail (they will never end up in.passed
,.failed
or.warnings
). - In most cases the change to the supported options will not impact the number of tests reported as run.
- Two new tests for schemas supported by Google (WebPage and Organization) are included in this release, which may increase the number of test performed if you are using the Google preset.
Notes
This issue resolves issues reported in #11 by displaying additional properties found on Schemas by default.
v3.6 - Add support for localhost URLs
v3.5 - Improved command line output and documentation
A modest update that includes improvements to the command line output and to the documentation.
v3.0 - Improved schema validation logic
In this release, Schema.org validation and Google Structured Data validation have been split so markup can validated independently for technical correctness and for vendor compatibility.
There are easy to accommodate but breaking API changes in this release, which should provide a stable API foundation for future updates.
New in this release
- Automatically detects Schema.org markup and tests it separately from vendor specific validation.
- You can now use
--schemas
to specify schemas to check for as well as to list them. - You can optionally prefix schema names with 'jsonld:', 'microdata:', 'rdfa:' to check for a schema specified in a particular way (e.g.
--schemas Article
or--schemas jsonld:Article
or--schemas Microdata:Article
). - You can specify one or more schemas to check for, the same way the
--presets
option works (e.g.--schemas "jsonld:Article,BreadcrumbList,microdata:WPFooter"
) - Presets can now contain other presets (to any level), to allow for easier organisation of tests. e.g. use
--presets SocialMedia
to test social media markup, or--presets Google
to apply rules based on those for the Google Structured Data Testing Tool. - Presets can now have conditional tests to determine if a preset is invoked, which is useful when grouping presets inside other presets, so that groups of tests are only applied when appropriate.
- Individual tests within presets can now have conditional tests to determine if they should run.
- Added new preset called 'Google' which checks commonly used schemas for structured data properties that Google expects to see.
- Added a new preset called 'SocialMedia', containing both Twitter and Facebook presets.
- Removed
--disable-presets
option as is now redundant. - All options available via both API and Command Line Tool.
- Updated README and inline documentation.
Known limitations
- This update does not validate if individual Schema.org schema properties exist or check if the contents of those properties are valid (this is possible with the API using a custom preset).
- The Google preset is contains subset of tests based on responses from the Google Structured Data Testing Tool and tests for all known Article schema types, but does not validate all supported Schemas or test the contents of properties using the same rules (this is possible with the API using a custom preset).
v2.0 - Enhancements and bug fixes
New since v1.0:
- Added option to disable automatic preset testing, so that only explicitly requested presets are tested - see or
--disable-presets
or-d
in the CLI tool anddisablePresets: true
in the API. - Added option to group tests by setting a
group
property on each test. - Added option to set a default group for all tests in a preset using
group
property on a preset. - Added option to set a default schema for all tests in a preset using
schema
property on a preset. - Added a
name
anddescription
to all schema presets using definitions from Schema.org. - Improved documentation, especially for options and presets.
- Fixed bug impacting instances of itemProps containing multiple properties on the same element.
- Fixed bug impacting case-sensitive file systems.
- Minor improvements to CLI tool output.