Slide 1

Slide 1 text

From Cowboy Coding to Professional Developer Andy Brudtkuhl @abrudtkuhl YouMetAndy.com/wckc

Slide 2

Slide 2 text

What Is Cowboy Coding? … and why it is a necessary evil

Slide 3

Slide 3 text

TL;DR Don’t code live on your production server. Use version control. Be nice, use standards, and avoid shiny object syndrome.

Slide 4

Slide 4 text

What makes a better developer?

Slide 5

Slide 5 text

Be pragmatic.

Slide 6

Slide 6 text

Be empathetic. (this is not easy)

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Use standards. (please)

Slide 9

Slide 9 text

Tools Don’t Matter. Tools Mean Everything

Slide 10

Slide 10 text

Be a good teammate.

Slide 11

Slide 11 text

Avoid Shiny Objects

Slide 12

Slide 12 text

Be verbose. (comment your code, describe your commits)

Slide 13

Slide 13 text

Automate your busy work.

Slide 14

Slide 14 text

Test your software (because someone else will)

Slide 15

Slide 15 text

Don’t Repeat Yourself.

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Setup a local dev environment.

Slide 18

Slide 18 text

Local Dev Environment • MAMP Pro • Desktop Server • VVV

Slide 19

Slide 19 text

Use version control.

Slide 20

Slide 20 text

What goes in Git? • Entire Site • Single Plugins and Themes • Never commit your wp-config.php file • Google “Git Ignore WordPress” for an example .gitignore file

Slide 21

Slide 21 text

Sync your data.

Slide 22

Slide 22 text

WP DB Migrate Pro • Use WP DB Migrate Pro • Migrate Data • Push / Pull Sync Data • Use WP_CLI addon to automate

Slide 23

Slide 23 text

Deploy with sanity.

Slide 24

Slide 24 text

Deploy with sanity • Dev / Test / Production environments • Stop doing things manually • Use WP-DB-MIGRATE to move data • Use WP-Pusher to deploy updates (no FTP, yay!) • Use Git on your server • Capistrano or Chef

Slide 25

Slide 25 text

Being A Better WordPress Developer Tips and tools to be a better WordPress developer

Slide 26

Slide 26 text

define( 'WP_DEBUG', true );

Slide 27

Slide 27 text

Separate Concerns • Use Plugins for functionality and Themes for design • Don’t abuse functions.php • Use functionality plugins

Slide 28

Slide 28 text

the loop.

Slide 29

Slide 29 text

Follow WordPress Standards • Read the Codex • Follow WordPress developer standards for Themes, Plugins, and Core Contribution

Slide 30

Slide 30 text

Use Core Features • Theme Customizer • Settings API • Options API • Image Thumbnails • Menu System • Widgets, Shortcodes • Custom Post Types & Taxonomies

Slide 31

Slide 31 text

Enqueue All The Things • Include scripts and stylesheets in Themes and Plugins by enqueuing them • NEVER include your own version of jQuery

Slide 32

Slide 32 text

Use Template Parts • Create reusable template parts • Build reusable loops • Reduce and Reuse code

Slide 33

Slide 33 text

Validate, Sanitize, Escape • Validate = check user input • Sanitize = clean user input • Escape = securing user generated output

Slide 34

Slide 34 text

Transients FTW • Simple Caching • Big Performance • Store data you expect to expire

Slide 35

Slide 35 text

Use Starter Templates • WordPress Plugin Boilerplate • Theme templates like sage, roots, _s • GenerateWP.com

Slide 36

Slide 36 text

Know variable scope • Don’t define your own Globals • Use namespaces and classes to properly scope your variables

Slide 37

Slide 37 text

WP-CLI • A WordPress command line interface • Setup, install, configure sites from your terminal • Easily create scripts to spin up new sites • Automate Database migrations • Schedule Database Migrations

Slide 38

Slide 38 text

Manage Dependencies • Use plugin_exists( ‘my-plugin’ ), class_exists( ‘MyClass’ ), or function_exists( ‘my_awesome_function’ ) • TGM Plugin Activation • Require / Recommend dependencies in your custom themes and plugins • Use composer • custom plugin or theme with third party dependencies

Slide 39

Slide 39 text

My Workflow 1. Grab a task (Jira or Trello) 2. Pull latest version of project from Bitbucket 3. Pull latest version of data from Staging / Production 4. Code feature / fix bug 5. Commit and push updated code with comment and link back to ticket in Jira/Trello 6. Deploy with WP Pusher or Git

Slide 40

Slide 40 text

My Tools • Editor: Atom.io • Local Dev: MAMP Pro • Terminal: iTerm • Source Control: Git with Bitbucket • Data Management: WP DB Migrate Pro • Deployment: WP Pusher • Site Management: InfiniteWP

Slide 41

Slide 41 text

YouMetAndy.com/wckc @abrudtkuhl