Drupal Site Audit - SFDUG
description
Transcript of Drupal Site Audit - SFDUG
![Page 1: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/1.jpg)
Site AuditDrupal Best Practices and Content Analysis
https://drupal.org/project/site_audit
2014.10.13 - SFDUG
![Page 2: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/2.jpg)
Jon PeckSenior Engineer at Four Kitchens
@FluxSauce - github.com/fluxsauce - drupal.org/u/fluxsauce
![Page 3: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/3.jpg)
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.
![Page 4: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/4.jpg)
Why audit sites?
• Learn about contents and structure
• Ensure optimal configuration
• Discover areas of improvement
![Page 5: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/5.jpg)
Every site is unique, but…
• Built with the same framework
• Similar architectural requirements
• One size fits most
http://www.flickr.com/photos/juliancolton/5360064817
![Page 6: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/6.jpg)
Effective auditing
• Consistent
• Quantifiable
• Contextually aware
• Easy to understand
• Actionable recommendations
![Page 7: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/7.jpg)
Static program analysis
• Performance & behavior gathering
• Does not execute
• Non-intrusive
• Automated
![Page 8: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/8.jpg)
What is Site Audit?
• Drupal 7 site analyzer
• Installed on target platform
• Provides reports in multiple formats
• Powers Launch Check on Pantheon
![Page 9: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/9.jpg)
Requirements
• Bootstrappable Drupal site
• Drush 5.10 or higher
• Shell access to target
![Page 10: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/10.jpg)
Installation
• Not a module
• Place in Drush commands folder
• Within user profile for just yourself
• Within Drush installation folder
![Page 11: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/11.jpg)
What does Site Audit check?• Best Practices
• Block
• Cache
• Codebase
• Content
• Cron
• Database
• Extensions
• Google Insights
• System Status
• Users
• Views
• Watchdog
![Page 12: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/12.jpg)
What doesn’t Site Audit analyze?
• DOM / front-end performance
• Usability and site experience
• Aesthetics
• Content
![Page 13: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/13.jpg)
Usagedrush help -‐-‐filter=site_audit
![Page 14: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/14.jpg)
drush audit_cache
![Page 15: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/15.jpg)
drush ac --detail
![Page 16: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/16.jpg)
HTML Output drush audit_best_practices --html --detail
![Page 17: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/17.jpg)
JSON output drush audit_cron --json
![Page 18: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/18.jpg)
Vendor support drush ae --vendor=acquia
drush ae --vendor=pantheon
![Page 19: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/19.jpg)
Audit All drush aa --skip=insights --html --bootstrap
![Page 20: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/20.jpg)
ReportsWhat and why.
![Page 21: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/21.jpg)
• 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
Best Practices
![Page 22: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/22.jpg)
Block
• Caching • Cache Report
![Page 23: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/23.jpg)
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
![Page 24: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/24.jpg)
Codebase
• Size of entire site on disk
• Size of public files
• Managed file size, count
![Page 25: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/25.jpg)
Content
• Available content types and node counts
• Unused content types - consider removing
• Available vocabularies and term counts
• Unused vocabularies - consider removing
![Page 26: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/26.jpg)
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
![Page 27: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/27.jpg)
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
![Page 28: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/28.jpg)
Status
• Drupal status report
• Highlights errors and problems
![Page 29: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/29.jpg)
Users
• Who is #1, blocked?
• Count of all users
• Count of blocked users
• Role list, counts by role
![Page 30: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/30.jpg)
Views
• Count enabled
• Caching rendered output
• Caching query results
![Page 31: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/31.jpg)
Watchdog
• Number of 404s
• How old the logs are
• Count of entries
• PHP errors
• Syslog
![Page 32: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/32.jpg)
DevelopmentYes, it is extensible.
![Page 33: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/33.jpg)
Structure
• Object-oriented, abstract classes
• Checks - individual checks; treat like unit tests
• Report - collection of checks, run in a specific order. Can abort.
![Page 34: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/34.jpg)
• Extend abstract SiteAuditReport, SiteAuditCheck
• Drush hooks
• Add callbacks
• Add to audit_all
• README.md
Writing custom Checks and Reports
![Page 35: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/35.jpg)
Hacked! integration
![Page 36: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/36.jpg)
Drupal 8 version in development.
![Page 37: Drupal Site Audit - SFDUG](https://reader033.fdocuments.in/reader033/viewer/2022052522/547e640fb47959ca508b4b7f/html5/thumbnails/37.jpg)
Good configuration matters.https://drupal.org/project/site_audit
@FluxSauce - github.com/fluxsauce - drupal.org/u/fluxsauce
Applied site_audit recommendations.