Oct 25, 2012

The 10 Commandments WordPress Developer

Filled under:

The 10 Commandments WordPress Developer
Being WordPress developer requires no special skills other than those programmed in PHP or CSS, but if there is advice that can make a difference and develop solid developments and, above all, no problems for itself or its clients.

That is why I have seen fit, so successful are the tips, translate this list compiled by Floris P. Lof :

1. Always define WP_DEBUG to true during development

You would not believe the amount of code error messages that you receive from plugins and themes. All these warnings can cause low memory errors, which will reduce the performance of the site to consume more memory than necessary.WP_DEBUG is also a very useful tool to find out if you are using obsolete functionality.

2. Stick to standards and CSS code WordPress

The WordPress standards have been established after years of experience. If you abide by these rules will get a clean and easily readable code for yourself and others.Hence the slogan "code is poetry" ..

3. Comment your code

Your code must not only be easy to leer by others but you should be able to understand why the rest either chose to write code in a particular way. There are many ways to dress a saint, but explain your choice as described in the Codex .

4. Learn how the "core" of WordPress, read the actual lines of code

You should know how WordPress function internally. When you load the plugins?, When are requests to the database?, When will you upload files of the songs? and all that. You can learn a lot from reading the "core" of WordPress.

5. Use functions and internal APIs whenever possible WordPress

No reinvents the wheel, before learning to write code if there is a function or procedure that is already in the "core". Learn the "core", as I said before, and discover how everything works. You'll be surprised what you will find there. Some examples would be these utility functions .

6. Put your code praenomen

There are many people who write code for WordPress themes and plugins. And it is quite possible that your function name, or class variable used is the same as another person. So you should always put praenomen as your initials or your website. For example (AW):

aw_nombredefuncion ();

7. Never trust user input! Sanitize & escape!

This is a major problem, now and perhaps forever. WordPress is loaded with tools that allow you to write secure sites. A good idea would be the chapter 6 of this book . You had it right?

8. Use nonces

This would be an extension of the commandment anteriior. Use "nonces" ensures all the features you need your forms. Check this page Codex

9. Locate your code

In Europe, unlike in America, we are used to writing in multiple languages, so it is not surprising that a client asks you a theme or plugin is available in another language or dialect.

So write your code thinking it "internacionalizable". This will add another language in the future easier.

10. Performance, performance, performance

We need to develop high performance sites. In all the code you write or you include either a request to the database, code PHP, HTML, CSS, JavaScript or attachment support for images, always keep in mind the performance. Every nanosecond account.


Post a Comment