The Site Audit module is a classic. It will reach 10 years old in June of 2023. It gives you a detailed report of your Drupal site in the web admin, providing a nice pass-fail display for review. It has a drush command that renders the report to the terminal in HTML, text, or JSON.
Earlier this year, we started a new project that resulted in a few new features for Site Module, launching the 4.x version branch.
Site Audit 4
The Drupal agency Vardot contracted me to build a "Drupal Support Dashboard" that would aggregate important information about all of their Drupal sites in one place.
With so many sites, hosted in many different places, it was a real challenge to manage. The DSD would display Drupal versions, update status, last cron run, cache state, and more so that they could find out which sites needed attention.
After researching a few options, we realized that the Site Audit module already had most of the checks we wanted, and in fact, Vardot had already developed an enhanced set of Site Audit checks we could use.
Site Audit Entity
The Site Audit module only displayed data. In order to send it, we needed to store it, on both the receiver and the sender sides.
So we created a new Drupal content Entity called SiteAuditReport. This allowed us to track the state of your site over time.
The Site Report entity is fieldable, which allowed us to add a reference field to the "Site" entity we created. If needed, additional fields could be added to help organize reports.
There are unlimited possibilities now that the reports are entities. You can add fields, create views, store reports from multiple sites, and use any other module that has Drupal Entity API integrations.
In the future, someone could develop Site Report Types, which could allow you to select specific Site Audit reports when creating site report of that type.
Site Audit Send and Site Audit Server
Once we had the entity, it was relatively easy to set up a remote connection. Drupal already has REST API capabilities, so all we had to do was to configure the built in entity REST endpoint and code up a SiteAuditReportEntity:send() method to POST the data.
Once the data was there, we already had the admin UI to browse them, and Vardot could build custom Views around them to create a CMS for their customers and websites.
In summary, Site Audit 4 helps you keep track of your sites over time and space with many powerful features.
- Store site audit reports as entities to view changes over time.
- Add fields to enhance reports.
- Save & Send site audit reports on cron.
- Run Site Audit Server module to create a central drupal site for storing site audit reports from other sites.
- Sync field data from other sites to the Site Audit Server.
Combined with Drupal site building tools, it can be used to create a Drupal Site Dashboard specifically built for your use case.
Check out my sessions on Site Audit 4:
- Site Audit Module: https://www.drupal.org/project/site_audit
- Site Audit Server: https://www.drupal.org/project/site_audit_server
Are you trying to improve the quality of your Drupal sites with Site Audit?
We're here to help. ThinkDrop Consulting is available to hire for custom Site Audit development, Site Audit Server deployments, enterprise DevOps and QA/QC, and more.
Get in touch to discuss your project!