Slide 1

Slide 1 text

I wanna be a WP dev

Slide 2

Slide 2 text

Who I am Filippo Gangi Dino @ weLaika

Slide 3

Slide 3 text

Torino Coding Society - torinocodingsociety.it Every 2 weeks free and opened coding speechs (with food and beverage). If you love coding

Slide 4

Slide 4 text

I wanna be a WP dev

Slide 5

Slide 5 text

You are not alone

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

think about other developers search better solutions avoid 'developer lock-in' use conventions

Slide 8

Slide 8 text

whether you are using php (Haml, Slim), CSS (Sass, Scss) or javascript (coffescript) there are lot of style guides.

Slide 9

Slide 9 text

Example http://cssguidelin.es/ multiple files data-hook naming conventions

Slide 10

Slide 10 text

Editor

Slide 11

Slide 11 text

The editor is your better collegue. Choose it. Customize it.

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Sublime Text Sublime Text http://www.sublimetext.com/ packages: Wordpress - packagecontrol.io/packages/WordPress Emmet - packagecontrol.io/packages/Emmet Foundation Snippets - packagecontrol.io/packages/Foundation%205%20Snippets

Slide 14

Slide 14 text

Dev env

Slide 15

Slide 15 text

You need it. Don't work live in production.

Slide 16

Slide 16 text

CLI use the! Use the CLI!

Slide 17

Slide 17 text

wp-cli - wp-cli.org wp plugin install hello-dolly wp plugin activate hello-dolly wp user import-csv /path/to/users.csv

Slide 18

Slide 18 text

wp-server - github.com/wp-cli/server-command $ w p s e r v e r P H P 5 . 5 . 2 4 D e v e l o p m e n t S e r v e r s t a r t e d a t J u l 1 4 1 9 : 1 0 : 0 0 2 0 1 5 L i s t e n i n g o n h t t p : / / l o c a l h o s t : 8 0 8 0

Slide 19

Slide 19 text

Plugins

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

few is better that many Never change a winning team suspect about swiss army knife plugins

Slide 22

Slide 22 text

Cons slowdown uncontrolled growth why ask to make something to a plugin when you can make yourself better? conflicts

Slide 23

Slide 23 text

Theme

Slide 24

Slide 24 text

Make your own theme. Is the only perfect solution for your needs.

Slide 25

Slide 25 text

There is only what you need.

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Read the official WP themes (twentyfifteen, twentyfourteen, ....)

Slide 28

Slide 28 text

functions.php

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Don't let functions.php do everything. You need to use it (or debug it)!

Slide 31

Slide 31 text

Conventions i n c / Put here your php logic.

Slide 32

Slide 32 text

flame also twentyfifteen have 355 lines of code and twentyfourteen 519 lines code is poetry

Slide 33

Slide 33 text

Enqueue

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Use WordPress to manages queues of scripts and stylesheets.

Slide 36

Slide 36 text

< ? p h p w p _ e n q u e u e _ s c r i p t ( $ h a n d l e , $ s r c , $ d e p s , $ v e r , $ i n _ f o o t e r ) ; ? > < ? p h p w p _ e n q u e u e _ s t y l e ( $ h a n d l e , $ s r c , $ d e p s , $ v e r , $ m e d i a ) ; ? >

Slide 37

Slide 37 text

Versioning

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Remember everything you've done Make teamwork possible Isolated introduction of features Help you to find the bug

Slide 40

Slide 40 text

Security

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

WordPress is the most used CMS in the world. This is the problem.

Slide 43

Slide 43 text

Basically follow the official instructions: Hardening Wordpress - codex.wordpress.org/Hardening_WordPress

Slide 44

Slide 44 text

Deploy

Slide 45

Slide 45 text

Automate recurring tasks to avoid errors.

Slide 46

Slide 46 text

Example, simple, manual deploy sequence Open FileZilla. Connect. Search local theme folder. Select modified files. Push to production. Verify. Select forgotten files. Push to production. Change directory to plugins folder. Select new plugins. Push to production. Make a db dump. Launch s e d changing domain. Visit production phpmyadmin. Import dump. Go to backend. Make manually changes for serialized arrays settings.

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Wordmove - github.com/welaika/wordmove $ w o r d m o v e p u s h - t p d

Slide 49

Slide 49 text

Maintenance

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Also with automat(t)ic updates your site needs maintenance. Make your customers conscious.

Slide 52

Slide 52 text

Thanks to all Questions? @mukkoo - twitter.com/mukkoo [email protected] dev.welaika.com