Auditing a Drupal website with Site Audit
Site Audit is a contributed module that I have recently used in several Drupal projects. It is a minimally maintained module at the level of updates, but with great potential and available for the latest versions of Drupal.
What is Site Audit and what is it for?
Site Audit is a platform designed to audit and evaluate various aspects of a website. From security to performance, Site Audit provides a detailed look at the overall health of a Drupal site. This module provides crucial information that makes it easy to identify and resolve potential issues before they impact the user experience.
Site Audit uses a technique known as " Static Program Analysis" . This mechanism does not actually make requests to the target site, and by doing so avoids the observer effect. It is non-intrusive, requiring no installation at the target site or configuration.
In addition, Site Audit is capable of generating Reports that we can review and export in HTML format. These reports can report points such as:
- Best practices and structural recommendations.
- Blocks - cache.
- General Website Cache β Optimal Drupal caching settings.
- Source code review: site size; size and number of managed files, etc.
- Content: Checks for unused content types and vocabularies.
- Cron.
- Database: sorting, engine, row count and size.
- Extensions.
- Insights β Website analytics with Google PageSpeed ββInsights.
- Security.
- Status: Check the built-in Drupal status report for errors.
- Users.
- Views.
- Watchdog: 404 error count, age, number of entries, enabled, PHP errors...
Installation and configuration
To install Site Audit it is recommended to do it through composer. On the contributed module page you have the downloads available.
To enable the module we can do it through the interface or from drush with the following command:
drush en site_audit -yOnce installed and enabled in Drupal, we will have a new menu link in Reports, called "Site Audit". Through this menu we can access the report that is dynamically generated or the configuration of said report.
The configuration allows us to select which points of our website Site Audit will analyze and include in the report it generates for us.
The Site Audit report
Site Audit generates a report as complete as the options we mark to be included in the analysis of our website. The module generates a fairly complete report with many considerations to take into account. In my personal opinion, it is an essential module to audit a website built with Drupal today, in addition to the use of other tools for accessibility, SEO, etc...
To generate a complete report of our website and export it, we can do it from drush with the following command:
drush site_audit:all --bootstrap --detail > site_audit_report.htmlThis exports us the report, which we can also see from the Drupal interface, in html format so we can send it or manage it as we want. Simply wonderful.
The Site Audit contributed module allows us to carry out an exhaustive analysis of our website, something very important to take into account if we are going to deploy a website to production or already have one available. Thanks to this module, we can find important security gaps, corrupt data or lack of efficiency in the database, overload of unused files, security problems in permissions and much more. A module without a doubt highly recommended.