G
G
Greg Popov2018-06-18 20:42:57
WordPress
Greg Popov, 2018-06-18 20:42:57

Where to find WordPress the right way?

Hello. I decided to understand wp, because. quite a powerful tool for solving certain business problems, but there is one thing.
I have been writing code for more than 5 years, and all this time wp repelled with its insides, yet the classic of the genre with classes, tests, and other charms takes its toll, and when you open this mass, you close it after 15 minutes, because you don’t want to get your hands dirty.
But still it is necessary.
Interested here that:
1. How all it is pushed under version control?
2. Where can I see the instruction manual for the internals from people who at least know what KISS is and speak the same language as the developers?
3. Is there an analogue of php the right way where all sorts of goodies are collected in one place?
4. Tips from people who, like me, came to deal with wp after design patterns.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Dmitry, 2018-06-18
@dimasmagadan

1. How does all this fit under version control?
just like any other code.
Someone likes to put composer-lock.json/vendors in rap, someone doesn't, etc. With WP it's the same - you can put the engine itself, you can not put it. Depends on the codestyle/habits of your team.
2. Where can I see the instruction manual.
There is documentation on the official website.
Developing under WordPress does not mean picking the developer in the engine files. They gave you filters/hooks, gave you a few apis, use them - that's enough. If not, most likely your project is out of scope for WP, or you are doing something wrong.
3. Is there an analogue of php the right way...
On the official website. You can also find rules for phpcs there, how to set up unit tests, and so on.
4. Tips from people who, like me, came to deal with wp after design patterns.
What for? What do you work with, these people or WordPress?
If you need to work, read the documentation, everything is clearly explained there. If you want to discuss "what a WP fig engine" - then you can finally do it on any forum on the Internet and it is not necessary that the interlocutors own any patterns.

L
lukoie, 2018-06-19
@lukoie

Here's what's interesting:
In a VI you will basically be doing
a) a theme
b) a plugin
and both will git normally.
even with plugins. I even have a plugin updated from github on one project. That is, I made changes in the plugin, pushed it, and in the WordPress admin panel in the plugins section, I clicked to update the plugin - voila, you're done.
The VI has a boilerplate for the template and for the plugin. With OOP, classes, blackjack and geishas. Take and use. Do not want ten files of this OOP of yours - do any game in one file. VP and it hides.
for Russian-speakers, the site wpkama is considered a Mecca
The most important advice is to stop chasing the VP. It was written by programmers. Normal, mature programmers. And another dozen or a hundred programmers tested it and rules. For almost any project, there are a dozen people who will snort what is wrong here, and there is something wrong, and everything is wrong. VI is a tool for CONTENT MANAGEMENT, not for the programmer. This is not Drupal, made by programmers for programmers for the sake of programming itself. The creators of the VP are aware that this is a tool that is needed for the person who will fill the site, and a programmer with a designer is needed only at the initial stages of its creation, and the VP is not made for and not for them.

F
Flying, 2018-06-18
@Flying

I was able to overcome my aversion to the Wordpress code and start working with it after I found out about Timber , after all, Twig is not at all like stuffing pieces of html :)
For the formation of interfaces (and data structures) in the admin panel, I cannot imagine myself without ACF . I use the Pro version. it's definitely worth it, but there is also a free one. Moreover, in the 5th version they added such a wonderful thing as Local JSON , which makes ACF very friendly with respect to version control systems.
For multilingualism, a developer friendly WP Multilang plugin has recently appeared, sharpened primarily for developers. In company with Loco Translateallows you to work with multilingualism very conveniently.
You also need to remember about the WP cli , without it it's hard for a developer who is used to the console :) There is Wordpress Packagist
to work with Composer , so plugins / themes can be installed directly through Composer. I tried to file a plugin for Composer that manages all this, but so far the quality is not enough imho to give it to the public. I also highly recommend taking a closer look at the guys from Delicious Brains , they have a lot of interesting things on their blog. Wordpress support is in PHPStorm, which helps a lot. In general, Wordpress, of course, is a very murky thing inside, but with a thin layer of abstractions overlaid, you can live relatively comfortably :)

V
Vladimir Druzhaev, 2018-06-18
@OtshelnikFm

Where to find WordPress the right way?
https://www.wptherightway.org/en/

A
Alexander Taratin, 2018-06-19
@Taraflex

https://habr.com/post/301848/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question