Here are the 15 things you should be doing when developing for #WordPress, to make you a better developer [thread].

1. Always comment your code to make it easier for developers to understand what you are trying to do or what the code does.
2. Make sure you have WP_DEBUG turned on when in development to catch an errors and warning that your code is producing.
3. Use the excellent WP Query plugin by @johnbillion. This provides a suite of tools to improve your code such as monitoring queries, HTTP requests, template files being used, identifying slow queries and so much more.
4. Make your code neat, tidy and easier to read. Not only will this help other developers using your code, but it will help you in the future when you read your code again
5. Follow the WordPress coding standards for PHP, HTML, CSS and javascript. The make spotting errors in your code much easier.
6. Namespace your function and classes to make sure that they do not clash with those from other plugins, themes and even WordPress core.
7. Don't reinvent the wheel. It is likely that WordPress already has a function, class or API for what you want, therefore use it rather than rolling your own. You get lots of performance and security benefits.
8. Make your code as extensible as possible to allow other developers (including yourself) able to build upon your work and modify it safely.
9. Enqueue scripts and styles correctly, using the correct WordPress functions. Don't just dump them in head for example.
10. Use the DRY (don't repeat yourself) coding principles making repeatable tasks into functions for example. This means maintaining your code is much easier and it makes it more efficient.
11. Use nonces when processing and submitting data input. These are number used only once strings which increase security.
12. Escape data output and sanitize user input with WordPress' sanitization and escaping functions.
13. Plugins should always be in their own folder. This makes this more neat and tidy and allows developers to add to and improve the plugin file structure in the future.
14. Make all strings in your plugins and themes translatable so those using them in different languages can easily do so once your plugin has been translated.
15. Last but not least, use a child theme when appropriate, particularly if you are using a theme that gets updated over time. This will prevent any modifications you do from being lost.
You can follow @wpmark.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: