Top Banner
The Evolution of WordPress Software Development Aki Björklund @akibjorklund
38
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Evolution of WordPress Software Development

The Evolution of WordPress Software Development

Aki Björklund @akibjorklund

Page 2: The Evolution of WordPress Software Development

How do you organize your custom code?

Page 3: The Evolution of WordPress Software Development

Why?

Page 4: The Evolution of WordPress Software Development

I bet it is not pretty

Page 5: The Evolution of WordPress Software Development

WordPress offers no file/folder structure

Page 6: The Evolution of WordPress Software Development

WordPress offers no autoloading

Page 7: The Evolution of WordPress Software Development

WordPress offers no unit test framework

Page 8: The Evolution of WordPress Software Development

WordPress offers no dependency management

Page 9: The Evolution of WordPress Software Development

WordPress offers no [insert a “professional” software

development tool here]

Page 10: The Evolution of WordPress Software Development

Probably it shouldn’t either

Page 11: The Evolution of WordPress Software Development

There aren’t any plugins you can install to get those

Page 12: The Evolution of WordPress Software Development

There are plugin frameworks and some site frameworks

Page 13: The Evolution of WordPress Software Development

They are not widespread

Page 14: The Evolution of WordPress Software Development

…thus not suitable as basis of significant applications

Page 15: The Evolution of WordPress Software Development

We could roll our own… or not

Page 16: The Evolution of WordPress Software Development

What can we use then?

Page 17: The Evolution of WordPress Software Development

Create a solution out of existing widespread technologies

Page 18: The Evolution of WordPress Software Development

Solution like that is on a stable foundation

Page 19: The Evolution of WordPress Software Development

I’ll introduce to you our stack

Page 20: The Evolution of WordPress Software Development

Yours could be different

Page 21: The Evolution of WordPress Software Development

Bedrock gives us a project structure, but not for your own code

Page 22: The Evolution of WordPress Software Development

Composer gives us dependency management

Page 23: The Evolution of WordPress Software Development

Composer PHP autoloader will load files when they are needed

Page 24: The Evolution of WordPress Software Development

Symfony’s DependencyInjection component lets us write loosely

coupled code

Page 25: The Evolution of WordPress Software Development

PHPUnit and WP_Mock enable unit testing

Page 26: The Evolution of WordPress Software Development

WPlinth is our collection of base classes

Page 27: The Evolution of WordPress Software Development

About code organization

Page 28: The Evolution of WordPress Software Development

Site specific code lives in the mu-plugins folder

Page 29: The Evolution of WordPress Software Development

mu-plugins/app-loader.php

Page 30: The Evolution of WordPress Software Development

Example folder structure of the

application

/Connection /PostType /QueryFilter /Service /Taxonomy /Test Application.php

Page 31: The Evolution of WordPress Software Development

Classes inherit WPlinth base classes

Page 32: The Evolution of WordPress Software Development
Page 33: The Evolution of WordPress Software Development

Invest in some time to organize your code

Page 34: The Evolution of WordPress Software Development

No need to use all the tools mentioned here for all projects

Page 35: The Evolution of WordPress Software Development

Document your solution online

Page 36: The Evolution of WordPress Software Development

Let’s start building standards

Page 37: The Evolution of WordPress Software Development

Write code that you would gladly inherit from someone else

10 years from now

Page 38: The Evolution of WordPress Software Development

@akibjorklund

akibjorklund.com/2015/wceu for slides and more info