| > It's an horrible peace of software, with horrible PHP code 4.x style, a db schema only a beginner could have come up with and an ecosystem with a lot of trash [...] I must disagree with these statements. Although it is not the most elegant one I've seen, using the word "horrible" is simply out of place. Have you ever built some sites with it? Do you realize that WordPress is developed in open source with many talented people working on it every day? The DB schema is actually quite flexible, being able to accommodate various kinds of data without many modifications. Apart from that, you can write your own beautiful code according to the newest PHP standards if you want in your WordPress-powered projects. No-one is forcing you to use old versions of PHP. As far as the success of WP is concerned, I think the reasons for it are very similar to why PHP is successful: - A huge community with plenty of plugins and themes. - Supported on basically any hosting service. - Being free with free updates. - Refined administration panel with many subtle features like auto-saving posts to Local Storage, which can save your article in case of an accident. and much more... I'm not saying that WordPress doesn't have its own issues, however, ignorantly stating that it is "an horrible peace of software" is simply outrageous. |
You really can't. Wordpress actively prevents you from writing beautiful, modern code. When writing themes, every template has to be in the root directory of the theme, creating an awful mess. All of wordpress has global variables and/or state in functions that is simply inescapable, making it impossible to write unit tests. Dependency injection is completely out of the question.
If you want to modify some behaviour and someone hasn't thought of putting in a filter for the exact thing you want to modify, it's not a matter of extending a class and overriding a method. Because wordpress is littered with huge god functions with global state, you basically have to copy/paste hundreds of lines of code and make sure that you keep that up-to-date with core updates yourself to prevent future bugs.
Several times I've gone into plugin development thinking "this must be possible without making too much of a mess", thinking I can separate out the unit-testable bits and write a thin WP wrapping layer that deals with the global state. Every time I've been disappointed.
It's not about PHP versions alone. It's that Wordpress was designed in and for PHP 4, and was never modernized. That's an inescapable fact, regardless of which PHP version your server runs.