23
Sudar Muthu | @sudarmuthu #WCMumbai Developer Tools to increase your Productivity as a WordPress Developer Sudar Muthu (@sudarmuthu) http://sudarmuthu.com

WordPress Developer tools

Embed Size (px)

Citation preview

Page 1: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Developer Tools to increase your Productivity as a WordPress Developer

Sudar Muthu (@sudarmuthu)http://sudarmuthu.com

Page 2: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Me• Programming in PHP for more than a decade and in

WordPress for about 8 years.

• Big fan of automating process and workflows.

• Contributor to a couple of open source projects including WordPress.

• Released about 2 dozen plugins in WordPress.

• Remote worker at 10up (and yes 10up is hiring :) )

Page 3: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

What about you?• Are you a developer?

• What is your experience with PHP and WordPress?

• What is your typical development environment?

• Do you prefer GUI tools or cli tools?

• What are your expectations out of this talk?

Page 4: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

IDE

Page 5: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

https://xkcd.com/378/

Page 6: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

IDE• I have used vim extensively and recently moved to

PhpStorm (still use vim mode)

• Move away from generic text editors and prefer an IDE.

• Look for WordPress integration.

• Look for integration with other dev tools that you use (phpcs, wp-cli etc)

• Look for xDebug support.

• Pick one that you are comfortable with.

Page 7: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Demo

Page 8: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Local Development Environment

Page 9: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Local Development Environment

• I use VVV and FlyWheel

• VVV for having a local environment that resembles production as much as possible using vv.

• I use FlyWheel to quickly create sites with different PHP versions (especially PHP 5.2)

Page 10: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Local Development Environment

• Pick something where you can easily create new sites.

• Ability to replicate production environment as closely as possible will be a plus.

• Don’t ever install PHP directly on Windows.

• Other popular options include Wamp, Xamp etc.

Page 11: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

xDebug

Page 12: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

xDebug

• PHP extension that allows you to step through code for debugging. Very powerful.

• I use it with VVV and PhpStorm.

• Helped me to debug lot of complex problems.

• Use IDE integrations to save time.

Page 13: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Demo

Page 14: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

wp-cli

Page 15: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

wp-cli• I use wp-cli extensively for normal day to day

operations. Saves me lot of time.

• wp-cli shell opens an interactive shell. Very handy to quickly test some logic or read options/transient etc.

• wp-cli ssh can be used to run commands on a remote server.

Page 16: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Demo

Page 17: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

PHP CodeSniffer

Page 18: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

PHP CodeSniffer• Static code analyser that captures common code

problems.

• Use a custom phpcs standard for your project on top of WordPress standard.

• Integrate it with your IDE or with git using pre-commit hook.

• I use it with both PhpStorm and vim.

Page 19: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Demo

Page 20: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

PHPUnit

Page 21: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

PHPUnit

• Unit testing framework used by WordPress core.

• Definitely check WordPress core unit tests.

• Set it up using wp-cli (Don’t try to set it manually)

• Refer to my talk about Unit testing for WordPress at WordCamp Pune.

Page 22: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Closing Remarks

• Use something that you are comfortable with.

• Always try to automate as much as possible.

• Have fun :)

Page 23: WordPress Developer tools

Sudar Muthu | @sudarmuthu #WCMumbai

Thank You@sudarmuthu

http://sudarmuthu.com https://github.com/sudar