Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Last active May 11, 2018 17:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Greg-Boggs/cd93085d0248176ca2c6c870e4b2f349 to your computer and use it in GitHub Desktop.
Save Greg-Boggs/cd93085d0248176ca2c6c870e4b2f349 to your computer and use it in GitHub Desktop.
Conduct a Drupal Site Audit

Create a good backup

Put the site in version control

Create a Github copy of the code if it doesn't already exist. Start your first commit with everything exactly the way it is before you start. If the project already has git, do perserve the git history.

Backup the files and database

Name and Date the backup. Do this before you change anything. Just in case.

Create a QA Plan that covers at least 20 pages

The QA Plan should include the highest traffic pages and at least one or two pages of the admin UI including saving a node.

Run a performance test

Run a speed test with Pingdom 5 times from the same data center. Throw away the first result and average the remaining 4. http://tools.pingdom.com/fpt/

QA the 20 pages

Run through the QA Plan from the previous step and note anything that looks obviously broken before you start.

Make a local copy of the site

All Site Audit work should be done on a local copy of the website so that you can edit the local site and test freely without changing production. Setting up the site locally may take time. Do include building the CSS from Sass.

Confirm that the CSS matches the Sass

When you build a theme from SASS, be careful to see if there are any edits to the CSS that aren't in SASS.

Run the Site Audit Module

This provides a generally useful broad overview that you will use later to see which content types and taxonomies are unused.

Security

Enable SSL

Free certs from either Lets encrypt or Cloudflare.

Disable and uninstall all unused modules

Deleting modules requires a seperate uninstall step BEFORE you remove the code from the website. You cannot uninstall a module after you delete it.

Disable the PHP filter

You may have to search the database for <? and move any code found to a custom module or theme hook.

Run all security updates

Check the last time it was run. If it's been more than a year, rerun the QA plan after you finish this step.

Run hacked module

This double checks that all the contributed modules and core match what comes from Drupal.org. If there are any patches, you may need to make .patch files for them.

Change the admin and site emails if needed

Make sure the user/1 email is set to the correct person. Reset it to yourself if needed.

Check permissions screen for any hidden admin roles

A hacked website may have had new roles added to it.

Confirm every account that has access to admin roles

It's common for previous employees to still have active accounts. Go ahead and deactivate anyone who hasn't logged in for more than a year. They can be turned back on later.

Coding Standards

Run the code through PHPCS and Coding Standards

Remember that PHPCS can often fix many easy problems for you. Full details are here: https://www.drupal.org/node/1587138

Reorganize modules

Put custom modules into a /custom folder. Consider moving features into /features so that generated code isn't mixed in with custom code. This makes custom code much easier to search through and learn when you use many small features.

Namespace code well

Make sure all modules and custom functions are name spaced with the project name

Create a feature(s) of all configuration

It's probably best to just check everything here. You can't be sure what's been configured and what hasn't. So, put everything in features and then regenerate the feature and remove anything like last updated date that changes on each feature update.

Performance

Check all performance checkboxes

Check the page cache and aggregate CSS/JS. For Pantheon, Do not check the gzip option. Set the minimum time out to 0 and the maximum to at least 15 or 30 minutes.

Resave all the home page images

Make sure all the home page images are the correct file type, compression, and sizes needed for the home page. Consider removing any image styles for Hero images and upload the correct size hero images to avoid having them double compressed by Drupal.

Move CSS to the header and JS to the footer

CSS should be in the header. JavaScript should be async or just above the closing body tag.

Put the site behind a CDN

I like Cloudflare, but Max CDN, and Fastly are good too. A CDN will geo-locate the static content close to the end user. This should not be considered optional.

Consider removing any module that disables block caching

Block caching is key for logged in performance. If a module has disabled it, consider removing that module.

Add Redis support

This is Pantheon specific. It's nice to have, but important for logged in site performance.

Cache the views

Use Views Content Cache to cache the views query and html for 6 days. Expire it based on the type of content in the view. For block views, set the block cache to the type that makes sense for the view (global, per page, per role, etc.)

Enable fast 404

Drupal 404 pages are super, super slow. So, use Fast 404.

SEO

Make sure the main pages have good < titles >

The home page should have a good title. Titles should be unique, they should describe the content of the page. They, ideally should contain an actual keyword phrase that people do type into Google.

Make sure metatag and redirect are enabled

Redirect makes sure /node/1 redirects to the human friendly URL. Metatag gives pages metadescriptions. The Metadescription should describe the content of the page and it should contain search keyword phrases. They should always be unique.

Do not use nofollow

Search API Facets are a common culprit of bad No Follow. No Follow is bad. It costs the site link juice and should never be used on internal links. It should almost never be used on links at all. If the site contains any untrusted, spam, external links, those links should be deleted. No Follow doesn't fix bad content.

Content

Run a broken link check

No one likes broken links. Use the Drupal broken_link module to fix them.

Run an accessibility check

We don't have a standard tool for this yet. There are several popular web-based ones.

Fix common accessibility issues like Alt tags

Primarily, you want to ensure that images have alt tags, that H tags are used correctly and that there is good color contrast on all key pages.

Consider simplifying the navigation

Drop down mega menus are bad for new visitors. Consider simplifying them by removing the drop down.

Consider removing the slide show

Slideshows a poor user experience. Instead, pick a good hero and stick with it. No one sees any of the other slides anyway.

Clean up

Consider deleting any unused taxonomy and tags

Anything with zero terms can be deleted. You can readd it later if needed. Also consider disabling any free tagging widgets.

Consider deleting any unused content types

If a content type has zero pages, delete it. You can put it in a feature, commit it, push it, then delete it and remove the feature if you want to save a copy of it just in case.

Disable any unused views

No sense in having unused content sitting around published.

Unpublish any unused content or test content

Sort the content oldest first and see if there's any test or development only content still hanging around published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment