Coding Style Guide

This section of the Nuttify Developers manual covers how Nuttify coders write clean HTML, PHP and CSS.

Good code:

  • Is neatly written
  • Uses indentation
  • Has “Goldilocks” comments (i.e. just right – not too many, not too few)
  • Is written and formatted consistently
  • Is easily readable and understandable
  • Is efficient and effective
  • Uses descriptive function names
  • Uses descriptive variable names

Additionally – Nuttify Code Style requires:

  • Using in built WordPress functions in preference to writing our own implementations
  • Leverages the WordPress Template Hierarchy to the fullest extent
  • Leverages the inbuilt WordPress queries and loops over custom coded solutions
  • Leverages pre_get_posts ,  WP_Query  over other solutions for the majority of the heavy lifting
  • Leverages custom post types wherever practical
  • Enqueues all CSS
  • Enqueues all Javascript
  • Escapes all data that is not already escaped by an inbuilt WordPress function
  • Sanitises all input to the database
  • When using a mysql query directly (this is rare) uses $wpdb->prepare  to sanitise the query

Articles in this section

Like what you see?

Find out how we can build a champion website for you.

Call Nuttify today 1300 688 4391300 688 439
or send us a message
No comments yet.

Leave a Reply