Slide 1

Slide 1 text

WordFlow complete Workflow for WordPress developers @mukkoo

Slide 2

Slide 2 text

@MUKKOO

Slide 3

Slide 3 text

@mukkoo dev.welaika.com

Slide 4

Slide 4 text

Disclaimer no kittens no live coding too much to say @mukkoo

Slide 5

Slide 5 text

<% Story time %>

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

WordPress is fun! So many plugins! Huge community! Lots of freedom!

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Every team has different tools. Every customer has different needs. Every project is unique.

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

we need conventions. documentation is boring.

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Webpack! Node! Yarn! Pug!
 Sass! CoffeeScript! DeployDeployDeploy!

Slide 14

Slide 14 text

Agenda fast bootstrap rich development environment deploy often and everywhere @mukkoo

Slide 15

Slide 15 text

fast bootstrap @mukkoo

Slide 16

Slide 16 text

Install core* ↳ $ wp core download
 ↳ $ wp core install *with wp-cli @mukkoo

Slide 17

Slide 17 text

Install wordless* ↳ $ wp plugin install wordless ↳ $ wp plugin activate wordless ↳ $ wp wordless theme create new_theme *with wp-cli @mukkoo

Slide 18

Slide 18 text

bootstrap complete fast @mukkoo

Slide 19

Slide 19 text

RICH Development env @mukkoo

Slide 20

Slide 20 text

├── assets │ ├── fonts │ ├── images │ ├── javascripts │ └── stylesheets ├── config │ ├── initializers │ └── locales ├── node_modules ├── theme │ ├── assets │ ├── helpers │ └── views ├── tmp │ └── README.mdown ├── Procfile ├── index.php ├── package.json ├── screenshot.png ├── style.css ├── webpack.config.js └── yarn.lock theme structure initializers views index.php assets JS stack

Slide 21

Slide 21 text

Why wordless is good? built-in initialisers webpack: images optimization sass transpiling webpack: assets digest (cache) coffeescript transpiling pug interpreter livereload with browsersync @mukkoo

Slide 22

Slide 22 text

Easy to handle 50+ helpers - link_to(), image_tag() - placeholder_text(), placeholder_image() - latest_posts_of_type() - render_view(), render_partial() - and more… @mukkoo

Slide 23

Slide 23 text

Extend custom webpack configuration custom node packages import @mukkoo

Slide 24

Slide 24 text

HTML Pug if (foo) bar(1 + 5)

Hello Wordcamp!

<%php echo(get_the_title()) %>

You are amazing

PUG doctype html html(lang="en") head title Pug script(type='text/javascript') if (foo) bar(1 + 5) body h1 Hello Wordcamp! #container.col h2= get_the_title() p You are amazing @mukkoo

Slide 25

Slide 25 text

css body { font-size: 14px; margin-top: 20px; margin-bottom: 20px; } .table { padding: 20px; background-color: #ff0000; } .table __cell { padding: 10px; background-color: #ff0000; } .table __cell—inverse { background-color: #0000ff; } sass $base-font-size: 14px $gutter: 20px $base-color: #ff0000 
 body font-size: $base-font-size margin: top: $gutter bottom: $gutter .table padding: $gutter background-color: $base-color & __cell padding: $gutter / 2 background-color: $base-color &—inverse background-color: #0000ff

Slide 26

Slide 26 text

javascript (es6) var fill; fill = function(container = “cup”, liquid = “coffee”) { return `Filling the ${container} with ${liquid} ...`; }; var result = []; var ingredients = [“coffee”, “milk”, “syrup”, “ice”]; for (i = 0; i < ingredients.length; i ++) { result.push(fill(ingredients(i))); } coffeescript fill = (container = “cup”, liquid = “coffee”) -> `Filling the ${container} with ${liquid} ...` var ingredients = [“coffee”, “milk”, “syrup”, “ice”] result = (fill(elem) for elem in ingredients)

Slide 27

Slide 27 text

deploy often and everywhere @mukkoo

Slide 28

Slide 28 text

bad habits @mukkoo manual tasks no conventions late deploy, live coding

Slide 29

Slide 29 text

good habits @mukkoo automation shared practices deploy early, deploy often

Slide 30

Slide 30 text

wordmove @mukkoo ↳ $ gem install wordmove ↳ $ wordmove init *requires ruby *

Slide 31

Slide 31 text

movefile @mukkoo global: sql_adapter: wpcli local: vhost: http: //vhost.local wordpress_path: /home/john/sites/your_site database: name: database_name user: user password: password host: localhost production: vhost: http: //example.com wordpress_path: /var/ www/your_site database: name: database_name user: user password: password host: host exclude: - '.git/' ssh: host: host user: user

Slide 32

Slide 32 text

movefile @mukkoo global: sql_adapter: wpcli local: vhost: http: //vhost.local wordpress_path: /home/john/sites/your_site database: name: database_name user: user password: password host: localhost production: vhost: http: //example.com wordpress_path: /var/ www/your_site database: name: database_name user: user password: password host: host exclude: - '.git/' ssh: host: host user: user local: vhost: http: //vhost.local wordpress_path: /home/john/sites/your_site database: name: database_name user: user password: password host: localhost development environment

Slide 33

Slide 33 text

movefile @mukkoo global: sql_adapter: wpcli local: vhost: http: //vhost.local wordpress_path: /home/john/sites/your_site database: name: database_name user: user password: password host: localhost production: vhost: http: //example.com wordpress_path: /var/ www/your_site database: name: database_name user: user password: password host: host exclude: - '.git/' ssh: host: host user: user production environment production: vhost: http: //example.com wordpress_path: /var/ www/your_site database: name: database_name user: user password: password host: host exclude: - '.git/' ssh: host: host user: user

Slide 34

Slide 34 text

goodies @mukkoo multistage supports ssh works with ftp it use wp-cli and rsync

Slide 35

Slide 35 text

@mukkoo Something goes wrong with production database ↳ $ wordmove pull -d Local fix and push to staging ↳ $ wordmove push -e staging —t First deploy ↳ $ wordmove push —all Local plugins update and deploy to production ↳ $ wordmove push -e production —p

Slide 36

Slide 36 text

@mukkoo

Slide 37

Slide 37 text

@mukkoo .------------------------. | PSYCHIATRIC | | HELP 5¢ | |________________________| || .-""" --. || || / \ .-. || || | ._, \ || || \_/`-' '-.,_/ || || (_ (' _)') \ || || /| |\ || || | \ __ / | || || \_).,_____,/}/ || __ ||____;_ --'___'/ ( || |\ || ( __,\ \_/------ || ||\ ||______________________ || |||| | |||| THE DOCTOR | \||| IS [IN] _____| \ || (______) `|___________________ // ||\ //= ||=\ ` `` `

Slide 38

Slide 38 text

recap use wp-cli! use wordless! use wordmove! @mukkoo

Slide 39

Slide 39 text

recap automate your workflow work in a custom environment deploy early, deploy often @mukkoo

Slide 40

Slide 40 text

Bonus remember to contribute at open source software @mukkoo

Slide 41

Slide 41 text

Bonus #2 use wp-cli @mukkoo

Slide 42

Slide 42 text

@mukkoo

Slide 43

Slide 43 text

Q&A thank you all @mukkoo