1. Site Audit
Drupal Best Practices and Content Analysis
https://drupal.org/project/site_audit
2014.10.13 - SFDUG
2. Jon Peck
Senior Engineer at Four Kitchens
@FluxSauce - github.com/fluxsauce - drupal.org/u/fluxsauce
3. What is an audit?
• official inspection of an
individual's or organization's
accounts
• validate the good things
you’re doing
• highlight areas of
improvement
Electrical inspector in Public Safety Building, 1957
Item 54948, Engineering Department Photographic Negatives
(Record Series 2613-07), Seattle Municipal Archives.
4. Why audit sites?
• Learn about contents and structure
• Ensure optimal configuration
• Discover areas of improvement
5. Every site is unique, but…
• Built with the same framework
• Similar architectural
requirements
• One size fits most
http://www.flickr.com/photos/juliancolton/5360064817
7. Static program analysis
• Performance & behavior gathering
• Does not execute
• Non-intrusive
• Automated
8. What is Site Audit?
• Drupal 7 site analyzer
• Installed on target platform
• Provides reports in multiple formats
• Powers Launch Check on Pantheon
10. Installation
• Not a module
• Place in Drush commands folder
• Within user profile for just yourself
• Within Drush installation folder
11. What does Site Audit check?
• Best Practices
• Block
• Cache
• Codebase
• Content
• Cron
• Database
• Extensions
• Google Insights
• System Status
• Users
• Views
• Watchdog
12. What doesn’t Site Audit
analyze?
• DOM / front-end performance
• Usability and site experience
• Aesthetics
• Content
21. Best Practices
• Drupal Fast 404 HTML pages
• Multisite - informational
• PHP Filter - should be disabled
• Settings and configuration - exists, not symbolic
• settings.php
• sites/all
• sites/default
• Unnecessary files in sites
23. Cache
• Anonymous page
caching
• Backends - list
• Bins - list any specified
• Default class
• Minimum cache lifetime
- should be never expire
• Lock - display default
locking mechanism
• Page Compression -
should be on
• Expiration of cached
pages - at least 15
minutes
• Aggregate and
compress CSS, JS
24. Codebase
• Size of entire site on disk
• Size of public files
• Managed file size, count
25. Content
• Available content types and node counts
• Unused content types - consider removing
• Available vocabularies and term counts
• Unused vocabularies - consider removing
26. Database
• Collation - check if
anything isn’t UTF-8
• Engine - checks if anything
isn’t using InnoDB
• Row count - reports tables
with more than X rows
• Size in MB - including
indexes and data
27. Extensions (modules and themes)
• Count - 150 as arbitrary warning
• Dev - reports development modules, provider aware of dev env
• Disabled but not uninstalled
• Duplicate - checks for duplicates
• Missing - enabled, but code is missing
• Unrecommended - Short list of bad modules
• Version - specific problems in widely used modules
28. Status
• Drupal status report
• Highlights errors and problems
29. Users
• Who is #1, blocked?
• Count of all users
• Count of blocked users
• Role list, counts by role
33. Structure
• Object-oriented, abstract classes
• Checks - individual checks; treat like unit tests
• Report - collection of checks, run in a specific order.
Can abort.