how not to build drupal sites - sai tanay

19
NOTE: This presentation is a Work in Progress . The current copy shared is intended only for review purposes by the DCD panel.

Upload: drupal-camp-delhi

Post on 13-Dec-2014

785 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: How NOT to build Drupal Sites - Sai Tanay

NOTE:This presentation is a Work in Progress. The current copy shared is intended only for review purposes by the DCD panel.

Page 2: How NOT to build Drupal Sites - Sai Tanay

How “N O T”to build Drupal SitesTanay SaiTechnical Account ManagerAcquia

Page 3: How NOT to build Drupal Sites - Sai Tanay

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

Page 4: How NOT to build Drupal Sites - Sai Tanay

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

Page 5: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” hack core● Why?

● Use Hooks, APIs from core

and contrib

Page 6: How NOT to build Drupal Sites - Sai Tanay

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

Page 7: How NOT to build Drupal Sites - Sai Tanay

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()

Page 8: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” put code in database● PHP Filter

● Views PHP module

● Why?

● Common Scenarios

● Alternative better approaches

Page 9: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” clutter your site● Dozens of unused modules,

content types, vocabularies

● Be a miser

Page 10: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” Content Typify Everything● Use Custom Entities

wherever Appropriate

Page 11: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” just MYISAM● InnoDB vs MyISAM

Page 12: How NOT to build Drupal Sites - Sai Tanay

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

Page 13: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” default your FILTERS● Input Formats

● Filters

Page 14: How NOT to build Drupal Sites - Sai Tanay

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

Page 15: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” Log Everything Everywhere● Disable DB Log● Enable Syslog● Disable Statistics, Use GA or

similar

Page 16: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” leave UI modules enabled● UI Modules

● Simpletest

● Migrate

● Migrate Extras

● Coder

● Devel

Page 17: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” Use them. Stay Away!● Statistics

● ..

● ..

Page 18: How NOT to build Drupal Sites - Sai Tanay

Do “NOT” Leave behind 404● Use Fast 404

● Prevent Bootstrap and

Database operations for that

favicon which is always

missing

Page 19: How NOT to build Drupal Sites - Sai Tanay

Do “NOT”