WordPress Pros vs Cons: What a developers says
After using and researching the WordPress platform for a fair amount of time I’ve gained certain opinions about the platform itself. With these in mind I’ve gone ahead and put together a little list of WordPress pros vs cons when using WordPress as a developer. Some will agree with me. Others won’t. Just keep in mind this is a list of my personal thoughts on WordPress pros vs cons that I, as a developer wanted to share with you. So let’s get started with my own set of WordPress pros vs cons – kicking off with the cons.
While going through the WordPress source code I stumbled onto some ancient code and poor coding standards. One of the first things I saw was the variable declaration using the “var” keyword. This kind of variable declaration was used back in PHP4 version. I mean, who uses PHP4 anyway? Also there’s the lack of code organization. Having files that have more than 1000 lines of code and methods that have more than 100 lines of code makes the code much harder to read, debug and update.
While using WordPress I find myself using the “global” keyword more that ever before in order to reach current query or current post object. What bothers me most is the fact that you can run over global variables by accident. Once you do that you’ll find it hard to know what and where it went wrong. I know that declaring variable as global variable is the simplest way to make this work but it also makes the codebase more tightly coupled and fragile. You can find the full list of global variables user by WordPress here: http://codex.wordpress.org/Global_Variables
Function naming inconsistency
WordPress has a bunch of methods for templating, security and other causes as well. While using them I found a large amount of inconsistency regarding the function naming and return values. One of the things that bothers me the most is the get_ method problem. This is where some methods return the value and some of them print them. For example the_title() method does the same thing as the get_the_title() method except the the_title() method prints the value so you don’t have to write that echo keyword.
So that’s great, right? Well, it would be if there weren’t methods like the_post() that is void (changes the current post pointer index in the loop) and get_search_form($echo) that prints the form (even if it has a get_ prefix) if you didn’t pass first argument as false. I also found that some methods return false as the response if nothing is found and some of them return -1 or null. Therefore it’s a little bit hard to write strict conditionals without double checking the documentation. I know that this isn’t huge for most people because everyone eventually gets used to it. I’m someone who really likes clean code so I find this quite annoying.
MVC? Forget about it.
Once you start using WordPress you can forget about the MVC architecture (by default). While you won’t find that a problem when building blogs or smaller sites you will start to see the problem when creating larger and more complex sites. Why? Because without the MVC architecture template, files can become rather big and less readable. This is especially true when you add one (or more) additional post query, a little bit of conditional logic, and one or two loops and you access the global variables.
Poor “Rewrite API”
When creating complex sites or applications using WordPress as the platform you rely on, you’ll eventually stumble onto the WordPress Rewrite API. So what’s wrong with the API? Well, I already mentioned that using WordPress means ditching the MVC architecture. Having that it’s pretty much anticipated that the Rewrite API won’t be the best one you’ve ever seen.
To cut a long story short, the only way to choose which page template you want to render when Rewrite API matches the given URI to some registered regular expression pattern, is to create the page (in the administration area) that will act as a container for the data you want to show. Also to create a separate template file for that or that kind of page.
Migrating the WordPress database from one server to another is not as easy as export/import using phpMyAdmin or some other host provided tool. Why? Because WordPress serializes a bunch of stuff into database records. Some of those things include paths to files or folder on the server, urls to other posts on our site, urls to attached images and even the sites domain and path to WordPress core.
String replacement might not be the best idea because many of those strings are contained inside the serialized arrays with the record of how many chars that string contains. In order to help you, other developers have made a bunch of WordPress plugins that can help you with the migration process.
Here at Slicejack we use https://wordpress.org/plugins/wp-migrate-db/ plugin as a main database migration tool. But if you ever find yourself in a situation where exporting the database is the only way to go you can use tools like https://github.com/Blogestudio/Fix-Serialization for fixing serialization errors caused by serach-replace method of migration.
As we make our way through my WordPress pros vs cons it’s time to go on over to the sunny side of WordPress for the pros.
When I first saw the WordPress data model I must admit that I was a little bit lost but after using WordPress for some time I find it to be extremely good and reliable. Why? First of all, all of your “posts” are contained at one single table along side with all common attributes (timestamps etc.). That just feels right because it’s simplifying the queries that you use to find the list of latest posts from a specific post type or from multiple post types ordered by some common attribute/criteria. I also like the fact that all post type specific attributes (meta values) are also placed in one common table. This means that adding additional form fields (meta boxes, attributes) does not require any database structure updating. Finally I find this data model good because most of the projects I’ve worked on didn’t require any additional database tables as the WordPress provided tables served just fine.
Easy to setup and manage
Among the next WordPress pros is a benefit we can all relate to. WordPress takes less than a minute to install if you know what you’re doing and they keep updating that first encounter experience to make it as pleasant as possible. Once installed WordPress site is easy to manage as well because users have the possibility to use integrated themes or download some other free or premium themes and install them with ease. If a user needs extra functionality he can download an appropriate plugin, activate it and it’s job done! I know, I hate when users add too many plugins to their sites and especially when they add some without any or with bad reviews. As I’m talking about easy managing having this possibility is a big plus.
Currently WordPress is the best experience that users can get in the content managing area and I think that matters the most. With its sleek administration UI, tons of customization options and even a mobile app to help you manage your content on the go I think that it’s not strange that WordPress powers more than 20% of websites online. Having that amount of users is great because new users and developers can find a bunch of resources regarding best practices, examples and tutorials that will help them master platform management.
WordPress has a bunch of APIs that allow you as a developer to create themes with lots of customization options (widgets, sidebars, navigation, custom background image, page templates etc.). Why is that important? That amount of customization options allows the user who’ll use the platform to stand out from the crowd and unleash it’s creative potential by refreshing how the site looks without needing your assistance and without breaking the site concept you made during the site & theme development (well, in most cases).
Community and popularity
When we talk about open source software, having a large community gathered around one product is essential for the development and security of that same product. WordPress has a ton of contributors and users. Having a large community also means that the errors you might encounter will most probably be fixed even before you get a chance to see them. WordPress also has one other neat feature and that is the update mechanism that allows you to self-update WordPress when the update won’t break the site you are currently running.
Last but not least in the WordPress Pros argument is the platform’s documentation which is indeed large, powerful and helpful. That’s all I need to say.
Although this is a post about WordPress pros vs cons, WordPress is indeed a great tool and a great platform which users and developers love because it serves it’s purpose. I know that a bunch of stuff which I mentioned above as negative aspects is there for a specific reason and that’s to provide new versions of WordPress to as many people as possible. Here at Slicejack we use WordPress to create most amazing experiences for our clients and users and that experience would be, in my opinion, harder to build if it weren’t for the WordPress.
There you have it. I’m sure you could add to the list of my WordPress pros vs cons with your own views.
So it’s over to you. Agree? Completely object? Let me know what you thought of my WordPress pros vs cons.