Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How NOT to build Drupal Sites - Sai Tanay

1,215 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

How NOT to build Drupal Sites - Sai Tanay

  1. 1. NOTE: This presentation is a Work in Progress. The current copy shared is intended only for review purposes by the DCD panel.
  2. 2. How “N O T” to build Drupal Sites Tanay Sai Technical Account Manager Acquia
  3. 3. Do “NOT” code too much ● Do not program too much ● When you have a hammer everything looks like a nail ● Don't be in a rush to become a Drupal "Programmer" ● Do not try to solve the Problem by Programming
  4. 4. Do “NOT” custom code too much ● Hard to Maintain ● Leverage existing good contrib modules ● You are just re-inventing the wheel ● Contrib code tested and reviewed by many
  5. 5. Do “NOT” hack core ● Why? ● Use Hooks, APIs from core and contrib
  6. 6. Do “NOT” be too generic ● ● ● ● ● hook_init, hook_boot form_alters without check for form if Including JS, CSS through these init hook 403 - Use Drupal's permissions system instead Overriding other module’s behaviour - Use hook_menu_alter, hook_form_alter etc instead of hook_init
  7. 7. Do “NOT” get into trouble ● ● ● hook_init hook_boot hook_exit() ● ● ● hook_node_access() hook_node_access_records() hook_node_access_alter() ● ● hook_node_grants() hook_node_grants_alter()
  8. 8. Do “NOT” put code in database ● PHP Filter ● Views PHP module ● Why? ● Common Scenarios ● Alternative better approaches
  9. 9. Do “NOT” clutter your site ● Dozens of unused modules, content types, vocabularies ● Be a miser
  10. 10. Do “NOT” Content Typify Everything ● Use Custom Entities wherever Appropriate
  11. 11. Do “NOT” just MYISAM ● InnoDB vs MyISAM
  12. 12. Do “NOT” default PERMISSIONS ● ● ● Do not leave any permission checked or unchecked by default Uncheck all and start checking one by one after putting some thought Whenever is new module is added check the permissions added and see the roles that these permissions were granted to
  13. 13. Do “NOT” default your FILTERS ● Input Formats ● Filters
  14. 14. Do “NOT” leave out CACHING ● ● ● ● ● ● ● Block Caching Page Caching Views Caching Entity Cache module Boost/Varnish Memcache APC ● ● ● Set appropriate cache lifetimes Page Compression CSS/JS Aggregation
  15. 15. Do “NOT” Log Everything Everywhere ● ● ● Disable DB Log Enable Syslog Disable Statistics, Use GA or similar
  16. 16. Do “NOT” leave UI modules enabled ● UI Modules ● Simpletest ● Migrate ● Migrate Extras ● Coder ● Devel
  17. 17. Do “NOT” Use them. Stay Away! ● Statistics ● .. ● .. ●
  18. 18. Do “NOT” Leave behind 404 ● Use Fast 404 ● Prevent Bootstrap and Database operations for that favicon which is always missing
  19. 19. Do “NOT”

×