When working on projects. I attempt to leverage toolsets that perform broad tasks (like Drush) or automate things that I could do manually — but may be cumbersome. In preparing to release a new a site from a Drupal6 to Drupal7 upgrade I figured … hey I wonder if there’s some sort of automated Audit I can perform on the website. I stumbled across the Site Audit tool in recent Drupal news. So I decided to give it a whirl.
What Does Site Audit Do
The site audit Drush tool is not a Drupal module, it is a Drush extension that performs a static analysis of the website. It doesn’t pretend to log into the website and examine details as a valid user — so it can be run on production websites if you want. Version 1.13 of the tool offers reporting on the following information:
- Best Practices – structural recommendations
- Block – caching
- Cache – optimal Drupal caching settings
- Codebase – size of the site; size and count of managed files
- Content – checks for unused content types, vocabularies
- Cron – Drupal’s built-in cron
- Database – collation, engine, row counts, and size
- Extensions – count, development modules, duplicates, missing
- Insights – Analyze site with Google PageSpeed Insights
- Security – check for common security exploits, such as malicious menu router items
- Status – check for failures in Drupal’s built-in status report
- Users – blocked user #1, number of normal and blocked users, list of roles
- Views – caching settings
- Watchdog – 404 error count, age, number of entries, enabled, PHP errors
So in short it gives you a birds eye view summary report you can flip through and examine the status-quo of your website with the production practices of Pantheon, a prominient Drupal Service provider (Pantheon developed this tool).
Installing the Site Audit Tool
As opposed to a Drupal module, the Drush Site Audit package is installed by simply copying the full site audit folder to a Drush folder. Refer to the drush documentation on where plugins and extensions may be installed. Typically Drush can be installed for your personal webserver account $home directory (typically a .drush folder); or system wide for all users.
Once the folder is in the correct location simply run drush cc drush to clear Drush’s internal file caching and pick-up this new extension.
Performing an Audit Scan and Viewing Results
There are alot of ways to invoke a site audit command. I basically issued the following site audit to save an HTML report to my Desktop:
drush aa --html --bootstrap --detail --skip=insights > ~/home/USERNAME/Desktop/audit.html
I then viewed the results:
As you can see there’s alot of information here. My goal is not to fix every problem, or tweak every setting. But, I believe being able to generate quickly can provide a good deal of situational awareness of how your website is configured and is functioning. These report(s) can’t fix anything by themselves but they can help shed light on issues you may be experiencing on your site.
Examining the Results
On this site, the site is still in development. Therefore alllll caching is disabled. That causes a huge hit in the Score. Of all the information in my report output the only thing I care about is the notification that many of my tables are MyISAM; I’m not sure why these aren’t INNODB tables after a Drupal7 upgrade … I will have to investigate this! But, all in not, this specific report yielded nothing surprising. Your report may be much more interesting!
Looking for quality web hosting? Look no further than Arvixe Web Hosting!