The nuances of commercial development on WordPress. The studio is not always good. Hang out with the right company

In this series of articles, we plan to cover the fundamental points to consider when developing a WordPress plugin or theme.

The goal of this guide is to present you with a set of best practices that will be useful for both new and experienced developers getting started with WordPress.

Most of the approaches described in this series are already covered in the Code, but I know that the Code contains so much information that it can be difficult for newbies to navigate it.

In this article we will cover the following topics:

  • WordPress Coding Standards;
  • How to avoid function name conflicts;
  • Comment code;
  • Safety tips.

We will try to be as specific as possible in this series, so examples will be included in the articles effective application methods and examples typical mistakes. This will give you a clear understanding of how certain things work in WordPress.

Please note that not everything described in this series is required to be used when developing plugins. However, if you are already starting to learn, why not learn how to do it correctly?

I will try to make the articles in this series easy to understand. I will include some examples of well-written code and examples of errors in the articles. Not everything described here is required when creating a plugin, but if you're getting started with WordPress, why not do it right?

Once this becomes a habit, you will automatically adhere to standards and it will be easier for you to protect yourself from mistakes.

WordPress Coding Standards

Honestly, this is one of my biggest weaknesses. If you are developing tools for WordPress, you should simply follow WordPress Coding Standards. This helps improve code readability and avoid common mistakes.

WordPress is a publicly accessible and supported CMS, which means simple thing that everyone writes code that is easy to read, edit, and maintain for everyone involved.

In the beginning, you may find it difficult to change the coding style you are used to, but eventually you will find that it becomes second nature and your code becomes cleaner and much more readable.

IN WordPress Guide The standards are divided into four main languages ​​used:

  1. CSS Coding Standards
  2. HTML coding standards
  3. JavaScript Coding Standards
  4. PHP Coding Standards

Examples

Below I will show you a few simple examples PHP code to give you a general idea of ​​what we're talking about.

Errors:

if(condition) action0($var); if(condition) ( action1(); ) elseif(condition2) ( action2a(); action2b(); )

Examples of correct coding:

if (condition) ( action0($var); ) if (condition) ( action1(); ) elseif (condition2) ( action2a(); action2b(); )

The second code example is much more readable, isn't it? IN Coding Standards Guide Lots of examples to help you make your code cleaner. You'll be amazed at how easy it is to dramatically improve the readability of your code with just a few spaces and indentations.

While I was writing this article, I had just purchased a theme for a client, and when I wanted to change the code a little, I was shocked at how difficult it was to do so.

Here's what I mean:

>
" class="feature-link" title="!}"> ";} ?> "; foreach($categories as $tag) ( $tag_link = get_category_link($tag->term_id); $titleColor = categories_title_color($tag->term_id, "category", false); echo "".$tag->name ""; ) echo ""; } }?>

Even a little scary, isn't it? After working with this code for a few minutes, I sent the topic author an email with a link to the coding standards manual page.

How to Avoid Function Name Conflicts

Name conflicts occur when a function has the same name as a function that has already been defined previously. For example, if you have a get_the_post_terms() function in your theme, and you install a plugin that contains a function with the same name, you'll get something like:

Fatal error: Cannot redeclare get_the_post_terms() (previously declared in....

Unfortunately, this happens much more often than it should. But such conflicts are easy to avoid.

For this we have the following options:

1. Function prefixes

For example, if your plugin is called "WordPress Cool Plugin", you can use the wcc_ prefix for all its functions.

So in the example above, the name of our function would be wcc_get_the_post_terms() .

2. Wrap functions in a class

Perhaps your plugin is so simple that it doesn't even require a class, but you can still create one to organize elements. I particularly like using the singleton design pattern, but take a look at the example below of a simple class with a static method:

class Wcc_Mailer ( static function send($post_ID) ( $friends = " [email protected]"; mail($friends,"New post!", "Check my new post in " . get_permalink($post_ID)); return $post_ID; ) ) add_action("publish_post", array("Wcc_Mailer", "send") );

As you can see, in this example I just used a prefix for the class name, but my function is called "send". This method name is protected from changes through the global namespace; the method itself cannot be called directly. To call it I would need to do the following:

Wcc_Mailer::send($post_id);

Comment code

Code comments are a developer's best friend. You may not want to comment on every function or variable you create, but trust me, as your code grows - especially as it incorporates components of other developers' code - it becomes very difficult to determine what exactly a piece of code does.

Also, as I said, WordPress is a public-facing CMS. Many developers will be working with your code, and leaving hints for them will greatly help them figure out what's what.

Personally, I use PHPDoc syntax for commenting functions, using Sublime + Docblockr this is very easy.

Let's see how the WordPress guys comment the wp_mail() function located in the wp-includes/pluggable.php file:

/** * Sends mail messages similar to PHP mail * * Returning true does not automatically mean that the user received * the mail. This only means that the method used completed * the request without errors. ", * if both hits are specified. If only the "wp_mail_from" hit is used, * the sender address will only indicate email. * * The default content type is "text/plain", which does not allow HTML. * However, you can specify email content type using * the "wp_mail_content_type" filter * * The default encoding corresponds to the encoding used in the blog. Another * encoding can be set using the "wp_mail_charset" filter * * @uses PHPMailer * * @. param string|array $to An array or comma-separated list of email addresses for sending letters. * @param string $subject Subject of the message * @param string $message Message text * @param string|array $headers Optional. param string|array $attachments Optional. Attached files. * @return bool Always when the content of the message was sent successfully */ function wp_mail($to, $subject, $message, $headers = "", $attachments = array() ) ( [....] // Sent!

try ( return $phpmailer->Send(); ) catch (phpmailerException $e) ( return false; ) )
As you can see, they describe what the function does, what parameters it needs, and what it returns.

Quite informative, isn't it?Comments are not intended to be used only with PHP. In HTML, for example, I like to use

at the end of large blocks of code, so it's much easier for me to navigate the code later.

In CSS, I use comments to divide the code into different sections.

For example:

/********************* GENERAL STYLES *********************/ body ( font- family: Arial; color: #333; ************************* STYLES H1, H2, H3, H4, H5 ************* **************************************** ***/ h1, .h1 ( font-size: 2.5em; line-height: 1em; font-family: $vag-bold; ) /***************** **** NAVIGATION MENU STYLES *********************/ nav ( color:red ) [...]

Safety must be taken very seriously! If your plugin or theme becomes popular, trust me, you don't want thousands of sites to be hacked because of you. If you think I'm exaggerating, look at Checkmarx research

their 2013 ranking of the top 50 WordPress plugins.

Now let's look at some WordPress development security tips:

XSS vulnerabilities To prevent XSS we must do two things. Check the security of incoming data check the security of outgoing data.

There are several methods for checking security depending on the data and the context in which it is used. The general rule is that you should not trust any data that is input, and you should not trust any data that is output.

For data input, you can use, for example, sanitize_text_field() , which checks for invalid UTF-8 text, converts single characters into an object<, убирает все теги, удаляет разрывы строк, отступы и лишние пробелы, а также убирает октеты. В зависимости от контекста, существуют разные функции, которые помогут вам обезопасить данные.

The same thing happens when you output data. Take a look at the following example of how a link is rendered:

">

  • esc_url rejects invalid URLs, eliminates invalid characters, and removes dangerous characters;
  • esc_html encodes & "' when outputting HTML.

Again, depending on the data you have, there are various functions that can help you. For JavaScript you can use esc_js.

In addition to checking the data itself, do not forget to check the date.

Preventing direct access to files

Most hosts provide direct access to files. For your plugin, this means that there will likely be some PHP errors occurring, and these errors will become valuable information for attackers.

To prevent this you can place very simple code at the top of your script:

// Exit if direct access is granted if (! defined("ABSPATH")) exit;

This will generally prevent the script from executing if it is not accessed through WordPress.

Remove all warnings and notifications

It's not just PHP errors that attackers can take advantage of - notices and warnings also include a lot of valuable information for them. Each plugin must be coded using DEBUG mode.

This will also prevent attackers from figuring out outdated functions in your plugin. To enable DEBUG mode simply find this line in your wp-config.php file and set it to TRUE:

define(WP_DEBUG, true);

Use Nonce values

Nonce is an abbreviation for numbers used once, they are used to protect against cross-site cross-site request forgery, or CSRF.

In other words, these are unauthorized or duplicate requests that can result in permanent unwanted or even irreversible changes to the website, particularly the database. This can happen due to the fault of attackers or due to mistakes of trusted users.

Depending on where you need to apply the Nonce value, you can create it in different ways.

For links use wp_nonce_url() :

$complete_url = wp_nonce_url($bare_url, "trash-post", "my_nonce");

For forms - wp_nonce_field() :

wp_nonce_field("trash-post", "my_nonce");

Elsewhere - wp_create_nonce() :

wp_localize_script("my-script", "my-var-name", array("nonce" => wp_create_nonce("trash-post", "my_nonce"));

If you look at the example above you will see how I use wp_localize_script ( which will be discussed in the next article) to include a nonce in a block of JavaScript code. I'm doing this because I plan to later use JQuery to make an AJAX request, and you should always include a nonce in AJAX calls too.

After that, in the script, just to check the nonce, use the following code:

if(! wp_verify_nonce("trash_post" , "my_nonce")) ( die("Busted!"); )

Use WordPress Features and Libraries

Always check if you can do what you need with the core WordPress features and libraries. This way, your scripts will be less vulnerable, and if they contain unsafe parts, WordPress developers will know about it and notify users.

First, I want to point out that becoming a top WordPress developer will take a lot of effort—it's a lot of hard work. It requires a significant amount of time, energy and determination. If you are looking for a simple step-by-step instruction on “How to get to the top,” reading this article will be worth your time. Statistically, the odds are not in your favor.

By the way, installing WordPress after reading a few tutorials and customizing a few themes does not make someone a leader in development. Such people may know more than the average person and have the right to call themselves “Experts.” Leading developers go far beyond basic knowledge; they themselves push the boundaries of what is possible. They bring innovative contributions to the community while also demonstrating excellence in the work they do. So I want you to be more than just an “Expert”, I want you to be one of the best.

Why be a leader in development?

Why not? If you're working with WordPress, why not just settle for the medium? There is already too much “average” in life and the meaning of the word “normal” is too overrated. There are other reasons. Here, for example, are the benefits of leading WordPress developers:

  • – Earn more money
    There is a high demand for WordPress and customers are willing to pay more for developers who are the best in their field.
  • – Get the best clients
    When you're at the top, you have the opportunity to say “no” to projects that don't excite you and “yes” to projects that interest you.
  • – Have more influence
    As a recognized expert, you have the opportunity to shape the future of WordPress, as well as the ecosystems built around it.

One hour of reading per day

If you are going to become a top professional, then you will need to spend at least one hour every working day reading and learning more about WordPress. There is no shortcut and no way around this requirement. Learning and mastering WordPress will take some time. If you watch TV, stop, 90% of the time it doesn't do you any good. If you're a gamer, sell your games or throw them away. Reaching the top requires commitment and sacrifice, and the best place to start is by eliminating things in your life that don't serve you.

Start by setting aside one hour of each workday to read. Disable icq, skype, etc., switch your phone to silent mode and read. As you read, take notes on what you learn. Please note that time is passing faster than you expected. Follow the established rhythm day after day, week after week, month after month. And when you feel the results, spend even more time reading.

Additionally, define a three-hour block, two to three times a week. The point is to commit to learning and promise yourself to take the necessary time to complete it.

Enroll in WordPress University


There's never been a better time to learn and master WordPress than now. There are a huge number of wonderful resources available to anyone who is willing to take the time and effort to use them. You will need some education before you begin gaining experience. Of course, you can just start “disassembling” existing projects. But I suggest you wait, develop self-discipline and study - soon there will be plenty of time for experimentation. Start learning with the social aspects of your experience.

Hang out with the right company

We become like those with whom we interact. If you want to be one of the best WordPress developers, start spending time with those at the top. Read their blogs, follow them on Twitter, give “feedback” to their thoughts and ideas, go to WordCamps and chat with them. Read the interview on CodePoet. Follow their lead, ask them for advice, follow their advice and report the results.

Here's a short list of WordPress developers to get you started:

Read

There is a lot of material available about WordPress. There are thousands of people talking about WordPress, making it increasingly difficult to filter out the noise. Yes, there are authorities, but when you start learning WordPress, you should start your journey by finding the highest quality resources and focusing your efforts there.

Here are some resources to help you understand what I mean:

  • – WordPress Codex
    The WordPress Codex is a publicly editable repository for all things WordPress. Start with the very basics and focus on mastering the WordPress interface from the end user's perspective. Learn about WordPress semantics. Read about theme design and .
  • – Books on WordPress
    There are over a dozen books available about WordPress. Start with those whose names attract you. Think the book “WordPress for Dummies” is too simple for you? Maybe not? Your clients may read it, you need to have an understanding of it. When you finish reading, thank the author and write a review.
  • – Blogs on WordPress
    Find and check out the best blogs about WordPress. Subscribe to their newsletters. Read them regularly and communicate with the authors. Here are a few of my favorite WordPress blogs on Smashing Magazine, WP Tuts+, and WP Candy.

Understand technology

If you're going to learn WordPress, as a developer you need to understand the technologies that underlie it. If you are already a programmer and PHP/MySQL are not new to you, great. Make sure your skills are up to date. If you are new to programming, start learning.

Here are a few places to start:

  • – Learn PHP and MySQL
    It is very important to know PHP and MySQL, especially important to know “best practices”. Outdated textbooks will not help you with this. And what you learned a few years ago may not be relevant now. Not sure where to start? Start with Lynda.com or Learnable.com. Learn about MySQ L performance.
  • – Explore Codebase
    Take the time to explore the WordPress code on Trac and Xref. Read the documentation to understand how everything works. See what you don't understand and ask questions. Familiarize yourself with how WordPress is structured.
  • – Install Nightly build (test version)
    Set up your local development environment and run Nightly build as a means to stay informed about WordPress's development path.
  • – Read “Make WordPress”
    A good way to understand the technology is to follow the evolving discussions taking place on make.wordpress.org. You can follow discussions about core, plugins and beginner themes.

Do your homework

Practice what you learn. Start with your own WordPress websites. After reading the textbook, implement what you have learned. Experiment. “Disassemble” existing projects. Monitor your knowledge and write down your ideas and thoughts for the future. Spend as much time on your own projects and experiments as you can.

Here are some areas for development:

  • – WordPress API
    Start exploring the list of available APIs in Codex. Read the information available for each API and experiment with each one (some will be easier than others). Look for tutorials for each API to get a real-world perspective and what you can do with each.
  • – Ajax in WordPress
    Even if you are already familiar with Ajax, learn about using Ajax in WordPress. Then move on to using Ajax when developing plugins. Look for textbooks to develop your own knowledge.
  • – WordPress PHP classes
    Check out the list of classes created by WordPress developers. Experiment with them in your own projects and master them. In particular, pay special attention to WP_Query, WP_Theme, and wpdb. Look for tutorials on each of the classes, as well as third-party communities such as WPAlchemy.

Get experience with WordPress


With your education well underway, it's time to get some real-life experience—and lots of it. Your path to the top is paved with trials and difficulties. The experience gained at the sites of our own projects is an important step in the right direction. One of the best ways to gain experience is to start doing work for others.

Find clients

Working for clients, paid or unpaid, is one of the best ways to gain experience. Clients will challenge you with problems that you would never face on your own. If you're just starting out, . The goal is not just to get a few hundred hours of WordPress experience, but a few thousand, and working for clients is one of the best ways to do this.

Create a topic

Create a theme that you would actually use. Publish it, paid or free. Respond to the feedback you receive from developers and end users using your theme. Ask for theme reviews from designers you respect. Update your theme by implementing additions or corrections received from feedback. Strive to ensure that you can be proud of your work.

Develop a plugin

Then, as you get to know WordPress better, you will find features that have not yet been realized. Implement them yourself. Take what you've learned about plugin development and put it into practice. Write a safe plugin that solves real needs - this will be your contribution to the already huge number of plugins. Publish it, paid or free, and get feedback from people who use it.

Suggest improvement

Join the WordPress Community


Publish guides

I started in 2006 with a simple tutorial I wrote (keep in mind how long ago it was). I took what I just realized and put it into a guide to help others save time and headaches. Many who read it said thank you, some even asked me to do some work for them. That's how guides are made - taking the best of what you've just learned and sharing it with others so they can reap the benefits of their efforts. It's worth it.

Contribute to Codex

As you study the Codex you will notice areas that need improvement. Find out how to become a volunteer. Dedicate your time to improving the quality of documentation. While the documentation in the Codex is constantly improving, there are still features and capabilities of WordPress core that are not documented. If you have information in this area, please share it with others.

Participate in forums

Most beginner WordPress developers ask questions on the official support forum (translator's note: in the original link to wordpress.org/support). Answer their questions (even stupid ones, but they are basic - we all started somewhere). Next, become an active member of the WordPress Stack Exchange community. Answer questions and study the answers given by other developers.

Participate in WordCamps

Check out the upcoming WordCamps. A sure sign of mastery is being able to teach someone else something you can do yourself. Read Diary Of A WordCamp. Want to make things more difficult? Become an organizer and bring a WordCamp near you.

Conclusion

The process of becoming a leader in WordPress development requires smarts, continuous improvement, and a willingness to do the hard work. It starts with training and then moves on to real work. Finally, the title of “top developer” requires dedication to the WordPress community, as well as an acknowledgment of the responsibility of those who shape and define the future of WordPress.

Published 30.8.2012

If you need a WordPress programmer to work remotely or on staff, pay attention to YouDo performers. Qualified specialists have a large portfolio of personal developments, so they have an understanding of solving complex problems.

Help from a WordPress programmer will be needed in the following cases:

  • urgently need to launch a new website on the Internet
  • support from a professional in the development and maintenance of new projects and plugins is needed
  • we need a developer who will evaluate the correctness of the code and improve it if necessary

If you are looking for a website development professional from Moscow who does freelance work, look through the profiles of specialists registered on YouDo. You will be able to discuss the specifics of the work and the procedure for completing the task with any of the WordPress programmers.

Price for a YouDo artist's work

A WordPress programmer who is registered on YouDo will carry out high-quality improvements to the project. Most specialists have experience working with systems such as WordPress, Joomla, DLE, 1C Bitrix.

Order the services of YouDo performers and get the opportunity to inexpensively obtain the following web resources:

  • personal pages
  • landing pages
  • corporate portals
  • sites designed to use a large amount of information, for example, online stores

On the YouDo website you can find a responsible freelancer who will program high-load projects at an affordable price. The cost of developer services depends on the complexity of the project and your requirements. The profiles of specialists indicate prices for main types of work. If you are looking for an experienced freelancer who will take on the development of modules and components for the Joomla CMS, contact the YouDo developers.

How long will it take the YouDo performer to complete the task?

If you urgently need a specialist who will create a blog on WordPress, leave a request on the YouDo website. In the task, you can note the main wishes for professionals and ask them to send you a portfolio. From specialists you will receive the support that will be necessary for the full-scale deployment of a web project on the Internet.

YouDo’s convenient search and ranking system for performers will allow you to find private freelance specialists and representatives of web studios in Moscow or from other cities in a few minutes. By ordering the help of a professional, you will receive inexpensive solutions regarding the creation, modification or re-programming of websites of any subject.

You will make the right choice if you stop your search for a new employee with YouDo performers. Our specialists will help you develop scripts (JavaScript, PHP, JQuery, AJAX) and edit existing websites. An experienced WordPress programmer will quickly add payment systems to the site and check the code for errors.

Nowadays, everyone who is not too lazy creates websites. One of the most popular engines is WordPress. A programmer for this engine must not only know PHP, but also know the structure of the engine itself, be able to layout and know jquery (JavaScript)
It just so happens that I quite often have to look for a WordPress developer for my website. I came across several developers. Some people do their job very poorly. I can recommend someone.
Well, now I’ll tell you the basic principles of how to choose a WordPress specialist.

The studio is not always good.

The first people who made improvements to WordPress for me were the studio. As I understand it, I was unlucky and ran into very unprofessional performers. In detail - the story about this.
Briefly, the studio takes a lot of money, you may not get results, but you waste time and money. Recommended when there is no alternative. In the studio, it is always better to talk to a specific performer, and not to the manager. Test how well a real programmer knows WordPress. Even if the manager praises the developers, it is better not to trust, but to check. Otherwise, you can step on my rake and repeat the story described above.

Indie WordPress Programmer

By indie I mean a developer who works for himself. It’s worth talking to the person right away to find out their level of knowledge of WordPress. When I was looking for a person, I came across Kolesnikov Sergei. The following dialogue took place:

Kolesnikov Sergey: Hello
Dmitry Evgenievich: Question
Kolesnikov Sergey: listening
Dmitry Evgenievich: How well do you know WordPress?
Kolesnikov Sergey: I guess it’s not for me to judge))
Kolesnikov Sergey: what are you interested in?
Dmitry Evgenievich: Well, let’s say how a post differs from a page other than the type of entry in the database
Kolesnikov Sergey: I don’t have time to take exams now)) if there’s something specific, I’ll listen to you
Dmitry Evgenievich: Just a second
I need such a plugin
Dmitry Evgenievich: estimate the price in rubles and terms
Dmitry Evgenievich: since specifically
Kolesnikov Sergey: ok, I’ll unsubscribe

As you can see, the developer refused to take the test, and of course he didn’t write to me. I definitely won’t get involved with someone like that. Not only does he most likely not know voprdpress, because... couldn’t answer a simple question right away, so he still doesn’t keep his promise. Well, naturally, he didn’t unsubscribe. Such a specialist will either screw you over by abandoning the project in the middle of the deadline, or will do everything so crookedly that you will be tortured to correct mistakes.

You need to find the right WordPress specialist

Stepasyuk Andrey gives a completely different idea of ​​himself (http://stepasyuk.org.ua/)
The development price per hour from 15 dollars is, in principle, a very reasonable price. When communicating, it is immediately clear that the person knows WordPress, because... asks the right questions after reading the technical specifications. There is no need to test a person's knowledge of the engine. Prepayment work with this specialist is one of the guarantees of a discount and that the specialist will complete your project.
The key condition for choosing a candidate is interest in your project, questions before starting the project and during the course of work. If there are no questions, it’s a reason to wonder if the work is going well...

There are also failures

I also had failures. A person took on a job and did not complete it on time. Therefore, before giving a person a job, you need to test the developer and understand his level. To do this, you can ask simple questions

  1. How is a post different from a page?
  2. Can a person code and how well does he know JS?
  3. What table are posts stored in?
  4. What are additional fields and how to set them

You can come up with a lot of questions. They depend on your technical savvy. If you are not familiar with the engine yourself, you can ask other questions:

  1. What is the most difficult thing in technical specifications and why?
  2. What's the most challenging project you've done? Ask for an example and clarify what is difficult
  3. Have you developed plugins?

Typically, experience developing a plugin for a WordPress programmer is a good experience. An advance payment for the work can be made in the amount of 10-30 percent, with the condition that if the project is delayed, the advance payment is returned without any obligations.

My Blacklist of WordPress Developers

Here I will provide contacts of those who did not complete the work or did it poorly.
The first office I wrote about was BVB Logic. They did the job crookedly and very poorly.
Second person: Skype: spider13_ - instead of the stated 1 week, my project took 3 weeks. As a result, I abandoned the long-term construction. Implementation questions constantly arose. It seems that the person doesn’t know the engine itself well, although he got to work and seemed to be doing something. For the second week I did not provide anything. Then he stopped responding to messages on Skype. The collaboration had to end.

P.S. By the way, our website is still open.

Good day, dear reader. Fate turned out to be such that I am one of those who is responsible for developing projects for an online agency in my beloved city of Khabarovsk. And I would like to tell you about how we maintain the proper quality of the product for clients, given fairly low budgets in comparison with the central part of Russia, which affects the requirements for the speed of project assembly. And my goal is to reduce the costs of development and further maintenance, which results in the need to make a website as quickly as possible with as many elements editable in the admin panel as possible.

For the most part, the information will be “technical”, regarding CMS Worpdress, “on the top.” I’m only talking about our path, for whom the use of technologies, ways, techniques, etc. question of religion - please refrain from holivars. Let's get started.

First, a small digression. In general, our projects are divided into several types according to the principle of development:

  • HTML template with themeforest -> assembly on CMS;
  • Design -> layout -> assembly on CMS;
  • Development of individual solutions.

I’ll make a reservation right away that in this article I will only consider the first two points, because summarizing the third seems to me to be a rather difficult task, because favorite/the best/everyone else is bad Everyone has their own technologies, and in small towns it can be difficult to find a good level developer for RoR/Flask and others like them. And I’ll go through them briefly. If there is interest in this topic, why not include a detailed tutorial article “How to build a website on WP in 4-8 hours, which the client will be happy with.”

Why Wordpress?

Low budgets and the desire to bring less entropy into the world justified the choice. In details:

  • Convenience of the admin panel for clients. I'm serious, after the introduction of this CMS, all customer training was reduced to the fact that we send the administrator password. Memories of recording the video “How to create news”, “How to change the phone number on the site” no longer appear in my dreams.
  • Website build speed. About 4-8 hours per project is great. Competitive advantage.
  • Developer learning curve for building projects. So far, my record is 1.5 weeks of training from scratch (that is, the HTML abbreviation seems like a spell calling Satan) to a full site assembly in a period that suits me.
  • Beautiful graphics for clients with CMS rating :)
  • Freeware, no need to purchase licenses.

And yes, I won't knock on your door with a brochure in my hand and say, “Would you like to talk about WP?” We just use this CMS and that’s what this note is about. In fact, here is a monologue in printed format that I give to all new webmasters who come to us.

What nuances should be taken into account when designing a project?

I believe that you should think about the nuances of website assembly at this stage. Here are some general and specific recommendations, perhaps obvious, coming from the set of plugins and snippets that I use.

The template should be easily divided into the “site header”, the actual content and the “footer”. If you need to hide some header/footer elements, WP provides quite a few great conditional features. ( is front page(), is_404() etc.). If you need to change the appearance - CSS can, body_class() available.

When creating various menus that will be managed through Appearance -> Site Menu, you must adhere to the following structure:

The important thing here is that submenus must have a css class sub-menu. This will save you from having to write a custom walker when building the site for the function wp_nav_menu($args);.

I’ll be obvious as captain, but all dynamic positions in the layout should be either separate elements (if a phone, then, for example + 7 XXX XXX etc. without distortion), for further replacement of the placeholder, or be similar to the following logical structure:

Layout to the list
List element layout

List element layout
Layout after the list

Be sure to create a separate rule in CSS for the content that clients insert through wysiwyg in the admin panel. Something like this (let it be LESS):

User-content( ... a( &:hover( ... ); &:active( ... ); &:focus( ... ); ) p( ... ) table( thead ( ... th ( ... ) ) tbody ( tr( ... td( ... ) ) ) h1, h2, h3, h4, h5, h6, h7( ... ) h1( ... ) ... h7( ... ) ul( ... li( ... ) ) img( … ) )

In the future, it will save you from calls like “Why did I insert a picture and everything worked for me!”

If you have image galleries on your site (three in a row, six in a row, etc.), then you need to match the layout of these galleries to the layout generated by WP with the gallery shortcode. Or redefine this shortcode and make the layout simply by adhering to the rule “Layout before the list, Layout of the list element, Layout after the list”, if the WP functionality in terms of the number of columns and other things is redundant.

The page navigation layout generated by WP looks something like this:

Layout of breadcrumbs is trivial. Either ul li list or , separated by " >> " and others like them.

I also want to say that the entire block of the above fits into one phrase - type it up by stylizing the markup generated by WP/plugins/function snippets and you will be happy.

We received a set of html/css/js files, what next?

At this point in time, the practice is that we have a repository that we call kosher_wordpress, so that on each project we do not have to install a bunch of plugins again every time. What it contains and what, in my opinion, is sufficient at the moment:

And the entire project assembly boils down to the following:

Approximate contents of the file with snippets:
ID));


$image = vt_resize(null, $url, 220, 220, true);

if (!$image["url"]) $image["url"] = "http://placehold.it/220x220&text=NO IMAGE";