Documentation

Documentation to build on the Passmarked platform

Issues

Passmarked runs tests on websites, which can be either single pages or full websites. The API can be used to start and wait for reports to run and return with the results.

These results of these tests, produce a list of issues which present which problems were found and their aggregated details. Each of these issues include occurrences which contain specific information about where and on what page a problem was found.

Install

To enable the Passmarked Client side API in your project, add the following script:

<script src="//jsapi.passmarked.com/v1.js"></script>

For more details, see github.com/passmarked/js on the project itself.

After adding the script, the passmarked object will become available for use

Request

To request the issues of a report, the .getIssues() function is provided. The function is called as such:

passmarked.getIssues({
  report: '(report-uid)'
}, function(err, issues) {
  if(err) {
    console.error(err);
  } else {
    for(var i = 0; i < issues.length; i++) {
      console.log(issues[i].getMessage());
      console.log(issues[i].getImpact());
      console.log(issues[i].getWeight());
      console.log(issues[i].getType());
      console.log(issues[i].getCount());
      console.log(issues[i].getCategory());
      console.log(issues[i].getTest());
      console.log(issues[i].getUID());
    }
  }
});

The function supports and expects a few parameters as such:

NameTypeDescription
reportstringREQUIRED - The UID of the report to fetch the occurrences for

Response

The function will return an array of Issue objects that has the following functions:

NameTypeDescription
.getMessage()stringReturns a user friendly message that can be used to display the information to a user
.getImpact()floatReturns a float that contains the percentage of which this issue impacted the calculated score.
.getWeight()floatReturns the weight (out of a 100) of the rule as voted by the community at the time, when the check was run.
.getType()stringReturns the level/type of the issue. Options currently are notice, warning, error and critical.
.getCount()integerReturns the number of times which this problem was found.
.getCategory()stringReturns the category of the issue on the Passmarked platform. These categories include: performance, compatibility, content or security.
.getTest()stringReturns the key of the test from the Passmarked platform. See the Library for a list of tests being run at the moment.
.getUID()stringReturns the UID of the rule as configured by the open sourced code
Signup icon
Ready to see how well your site scores?

Passmarked works best when you have an account. It allows you to keep a dashboard with saved data of the sites you have run through the system, we’ll alert you about important updates and you get access to the Passmarked Slack forum.

Sign up to get started