WordPress as a Framework

WordPress is one of the most popular CMS (Content Management Systems) as far as the user base and ease of access is concerned. Many famous content rich websites use WordPress as their back-end – including SitePoint itself. Regular updates, a larger community, great support forum, rich documentation and many other factors have put WP way ahead of its competitors.

The first thing that comes to most people’s minds when thinking of WordPress is Blog or Content Management Platform, but there is another angle to it. Have you considered that it can act as a full framework for developing web applications as well?

There are various aspects which are taken into consideration before choosing a framework for web development. In this piece, we are going to look into features that WP provides if we treat it as a web development framework.

Community, Support and Documentation

WordPress has a great community and an active support forum. Whether it is an issue with installation, setting up, development or anything else, everything is timely resolved by the support community. The WordPress Codex is a community moderated wiki which is regularly updated. Documentation is the first thing you need when learning any new language or framework, and the codex provides just that. While most, if not all, other frameworks also sport these features, it’s important to note that WP does too, thus not lagging behind.

User Management

WordPress has an excellent user management module which takes care of all the functionality such as user registration and login, user role management, assigning capabilities to different roles and creating new roles. This functionality can be further enhanced by using plugins like the Capability Manager which also provides all the above features without you having to worry about session management or security issues.

If we talk about other frameworks, most provide some sort of User Management solution – for example, Yii provides a user management extension known as Yii-User and similarly for CodeIgniter framework, you`ll find a user management control panel named BackendPro which you can easily integrate into your CI project.

Admin Dashboard

Who wouldn’t love their application having an easy to use admin panel through which the front-end content could be managed? WP provides a ready to use back-end panel which has most of the options you might need. In addition to it, you can create your own custom setting pages for a wide set of requirements. One more perk is that you don`t have to worry about back-end styling at all – WP comes with its own set of styles for the back-end panel.

The Admin Dashboard is the part that lacks in other frameworks. Symfony and Yii provide a couple of extensions for their respective frameworks through which you can generate the Admin UI, but the functionality part is left up to you. This is one area in which having a CMS is advantageous, but can cause significant overhead if it lacks the features you need, and has features you don’t.

CRUD (Create Read Update Delete) Operation

Most people appreciate a framework’s help in performing these basic operations, so picking one that makes it easy is often a deciding factor for many developers.

Lets try to relate this with the real world a bit. As far as WordPress is concerned, everything is a post. A book is a post, a person is a post, and any distinguishable entity is a post. WordPress calls them Custom Post Types.

Let us take an example of Book for now. If you tell WordPress that you want to define a post type named “Book” for your application, you will automatically get all the CRUD bundled with it.

  • Add / Update Book – This will be the default WordPress post edit screen for adding / updating books.
  • View / Delete Books – This will be the book listing page with delete option as well.
    add_action( 'init', 'create_post_type' );
    function create_post_type() {
            register_post_type( 'book',
            array(
              'labels' => array(
                 'name' => __( 'Books' ),
                 'singular_name' => __( 'Book' )
              ),
            'public' => true,
            'has_archive' => true,
            )
        );
    }

The above code snippet does all the magic behind it, and the CRUD operation is generated for the book post type. You do not have to write SQL queries for this, rather focusing on the business logic, making the development truly rapid.

Considering other frameworks, Yii dominates with its very easy to use GUI CRUD Generator followed by the GroceryCrud module for CodeIgniter and then scaffolding in CakePHP. True, the nitty gritty fine tuning of CRUD operations and database relations is still up to you, but when wanting to get off the ground fast and improve later, these solutions come second to none.

Uploads and Media Management

File upload and media management is a must for all modern day frameworks as you cannot think of any application which does not have media support these days – whether it is images, music or videos. WordPress has an integrated media library (these media files are nothing but attachment post types as we have discussed above) through which you can upload media and perform various operations such as cropping, flipping, resizing etc.

WordPress image functions allow users to use the uploaded images anywhere in the front-end with all the modification flexibility from your side. You can even create a gallery of images in the back-end and display it in the front-end.

If we look outside WordPress, Symfony and Yii also provide cool extensions for media and file upload management, but objectively, none as rich as a fully formed CMS like WordPress. This takes a huge chunk of manual development of your time, allowing you to focus on the business critical parts first.

Extensibility and scalability

From a developer’s point of view, extensibility and scalability are a very important part of every framework. Hooks and Filters are what make WordPress a powerful framework for development.

Filters

If you want to change the output of some default functionality, just pass it to your custom filter and output anything you want.
Suppose you are managing a directory website (with lists of all types of books) with their respective prices, and you want to increase the appeared price of every book by $10. This will be the filter you`ll write.

    add_filter('book_price','custom_book_price');
    function custom_book_price($book_price){
        $book_price = $book_price + 10;
        return $book_price;
    }

The above code will add $10 to the price of each book and will show in the view. Filters are present in every high quality modern framework and templating engine.

Hooks

Hooks are nothing but custom function calls at specific points in the WordPress code execution chain. You can even think of them as triggers. Suppose you want to be notified via email whenever a new entry is created in your application. For this you will hook a custom function up to the default publish_post hook of WordPress.

add_action('publish_post','custom_mail_admin');

Now all you need to do is implement the function custom_mail_admin and it will get executed automatically whenever a new post is published.

Hooks and Filters together are a powerful duo, and one of the main reasons of WordPress’ successful evolution into a web development framework for so many companies.

To a certain degree, hooks are supported in all major frameworks, but vary in trigger times. Obviously, a framework like, for example, Kohana won’t have a “publish_post” hook, but might have a “post-controller” hook (it does – in the form of system.post-controller) which executes after a controller is finished performing its action.

URL Routing and SEO Friendly URLs

A very important parameter if you are looking towards building a news/content application or website. The URL structure plays a very important role in SEO as we all know, and WordPress has a powerful Permalink functionality through which you can have different types of permalinks for content or pages depending on your requirements.

URL rewriting also plays a crucial role in a complex web application where your URL contains many GET parameters and the URL becomes too long and complex. Like many frameworks, WordPress provides a Rewrite API through which you can play with the URL structure and customize it as per your requirements, though admittedly, WP does this in an incredibly user friendly manner.

Almost all frameworks support URL routing, among which Laravel provides a decent user-friendly routing API followed by Yii, Zend, CakePHP and others.

Caching

If you are looking at a high performance application serving millions of users, you need to have a caching mechanism in place. WordPress has a built in Transient API which provides database level caching functionality to be used in your application. If you are looking for a more advanced caching mechanism with all the controls in your hand, then plugins like W3 Total Cache will serve this purpose. Use this way to manage cache without much overhead.

Again, most frameworks support this. Some examples include Yii and Laravel, both of which provide a very easy caching mechanism, arguably better than WordPress’, through which you can boost you application’s performance.

Templates

WordPress Templates deal with presenting your content. If you are familiar with the MVC architecture, you can relate templates to views. One page can be assigned multiple templates. So even if data is same, the styling will vary.

Considering other frameworks, Laravel and Phalcon have amazing templating engines built in, while other frameworks have their own solutions as well.

What about MVC ?

These were all the major features that make WordPress a complete web application development framework if we compare it to the other frameworks on the market, but what about MVC? Almost every web framework nowadays follows the MVC architecture. Indeed, WordPress does not follow this architecture due to dedicated support for backwards compatibility with older deployments. In spite of this, efforts are being made to make WP follow the MVC pattern – you can check out WP MVC and Tina MVC.

Conclusion

WordPress is by no means a drop-in replacement for other frameworks, but makes for a decent alternative, providing most, if not all features covered by already popular frameworks. One thing to be worried about is its performance and overhead due to functions you may not exactly be needing for your particular app, but as far as developing functionality in it goes – WordPress can indeed rival some of the best frameworks out there, even if it is “just” a CMS.

Hope you enjoyed reading the article. Comments are welcome!

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://plutov.by/ plutov.by

    Procedural framework? It’s hardcore!

  • Madara Uchiha

    Yeah…. No.

  • http://ocramius.github.io/ Marco Pivetta

    Wow… Just wow… Really?

    No, WordPress is not a solid “framework” for building software. It’s like trying to raise a bacteria colony by splatting agar on my hand – you just can’t know the outcome.

    • http://www.madblogger.in/ Chirag Swadia

      Can you elaborate on what do you mean by a “solid framework” ? It will be better if you provide valid points rather than just saying it without any proof!

      • http://ocramius.github.io/ Marco Pivetta

        “SOLID” has a very specific meaning to developers. WP, being a procedural blob, can’t even aspire to become it.

      • JamesMallison

        If you don’t even know what SOLID is, then you’re right – WordPress is for you!

      • frostymarvelous

        SOLID = Simple | Object-Oriented | Light | Intuitive | Documented

        Lol! I can’t believe I just came up with that!

  • Steve Müller

    Seriously? oO

  • Matt M.

    “WordPress is by no means a drop-in replacement for other frameworks, but makes for a decent alternative, providing most, if not all features covered by already popular frameworks.”

    Sounds like he’s just trying to show that WP is an option for certain projects.

    • http://www.madblogger.in/ Chirag Swadia

      I have clearly mentioned that we can compare WP with other frameworks out there. There is no framework that says that “I am only best for X type of application and not for Y type of application”. It all depends on the users and what they what to develop on!

  • ElDerecho

    If you have primarily designers on your staff who dont have a lot of experience designing entire applications, by all means. If you have developers on your staff, making them fit an app into a CMS like wordpress is effectively tying their hands behind their backs.

    • http://www.madblogger.in/ Chirag Swadia

      If a framework provides me rapid development along with maintaining robustness of the application I am developing, I would really have no complaints.

      • ElDerecho

        It will get you a bare bones site up and running quickly, sure. But then everything you try to do after that will take 3 times as long because you’re trying to force your application to work the way WordPress wants it to work, rather than using an approach that’s optimal for your application. That’s why I say its good for designers who don’t really know how to architect a full system, but not for developers who can architect a system tailor-made to the specific needs of the application. The latter will be much more flexible over the long run.

      • sidscorner

        That is such an uninformed opinion. Have you really used any other frameworks out there? It seems you are defending WordPress because that’s the ONLY thing you know. If you want to grow as a developer, try to move forward out of this mindset.

  • Jeff Madsen

    I think you did WP an injustice when you essentially skipped over the work being done in the MVC area. It is dead simple now to create a MVC framework inside your mu-plugins dir & use composer to include any components you would like to – thereby combining the strengths of WP Core with the “better coding” (because it is better) of proper structure & classes

    • http://www.madblogger.in/ Chirag Swadia

      I certainly missed this part. Thanks for reading though and pointing out :)

  • http://www.fadamakis.com/ Fotis Adamakis

    Totally agree. Knowing wordpress well enough enables you to work in a lower level and use it as a CMF. And of course for users the familiar dashboard is a huge advantage.

    • http://www.madblogger.in/ Chirag Swadia

      Absolutely :)

  • joshuapaling

    “WordPress can indeed rival some of the best frameworks out there” and WordPress provides “most, if not all features covered by already popular frameworks”??? Which other frameworks are we talking here? Certainly not any I’ve used.

    • http://www.madblogger.in/ Chirag Swadia

      Why don`t you compare WP with your own favorite framework ? and according to you, what make you think that WP is not in the league of other frameworks out there ?

      • JamesMallison

        Because WordPress is a clusterf* of spaghetti code for a common purpose – a very simple blog or blog disguised as a webpage. Real frameworks give you abstractions for your Request, Response, (we’re talking objects here, yes, OOP, google it), you’ll use an ORM, Dependency Injection, Inversion of Control. They use MVC, the model of which is a LAYER consisting of domain objects, data mappers and services. Your concerns are separated, easy to modify. Your code becomes testable, and you can be proud of it.

        WP is NOT a framework. Again, it’s a clusterf* of terrible code with a horrible UX cobbled together to provide re-usability only within itself.

        Why don’t YOU compare WordPress with other frameworks and do your research before claiming how great it is? It was your job to educate users about the best tool for the job, not the only one you know!

        • http://www.bitfalls.com/ Bruno Skvorc

          Actually, that was not his job. His job was to argue his views and present his opinion of WP as compared to frameworks that have the same or similar *features*. Far be it from me protecting WP – I share your sentiment about its quality – but he did name features he’s looking for, and did note they can be found in WP. If you’d like to write a counter article and *calmly* explain why you disagree with the notions presented here, or with WP in general, I’d be more than happy to publish it. But this flaming approach of yours to the discussion is not something I appreciate – please tone down your aggressiveness in the future.

          • frostymarvelous

            I think the issue many including me have is with referring to it as a framework. We understand that it is an opinion article, but one too at odds with a majority of opinions out there.
            It should be no surprise that the comments are laced with hostility.

          • http://www.bitfalls.com/ Bruno Skvorc

            The title is “WordPress *as* a framework”, not the “WordPress framework”. “As” indicating something serving as an alternative to something else, and looking at how well it does that. “Tshirt as an umbrella”, “Cups and string as phone” or “Business cards as filters” not “Tshirts are umbrellas”, “Cups and string better than phones” or “Business cards are filters”.

            If hostility is coming from that source, it’s coming from the wrong one, and is directed at the wrong things for the wrong reasons. Like I said in another comment, I’d happily publish a “WordPress not to be used for anything” article if it was well written.

  • http://www.bitfalls.com/ Bruno Skvorc

    But can this “proof of concept” then be scaled to become a proper app, or will you end up with bloat on top of bloat? My money is on the latter. Proof of concept can be developed with anything, really, and there’s plenty of frameworks that provide a starter backend API app which you can configure to suit your needs.

  • Ivan Panfilov

    Just compare wordpress community solutions and your examples,
    Wordpess is not only blog platform – it is CMS and became RAD framework like Ruby On Rails.
    And there are no reasons for making another yet “simple blog” systems. While exists Jekyll.

    • Miles Johnson

      The fact that you compared WordPress to RoR, and considered OOP/MVC
      outdated means you have literally zero idea on what you are talking
      about. Please refrain from ever posting again, thanks.

      • Ivan Panfilov

        Hipster kid trying teach me. LOL
        RAD frameworks is not about MVC/OOP bullshit. It’s about rapid creating web sites and applications and making money on this

        • Miles Johnson

          RAD, also known as Rapid Application Development. Throwing up a WP install (not an application), installing plugins (not development), and setting a theme. (omg so hard). I developed WordPress for years, I know what it takes, and the only thing RAD about it is getting a terribly crappy website out fast. Well guess what, that’s the damn point about a pre-built CMS. Stop acting like its anything but.

          • Ivan Panfilov

            Huh, and development not means writing code.
            In example, when you develop java web application u can just configure xml files.

      • Grant Wesley Parks

        MVC *is* outdated (like 30 years). It’s a Smalltalk paradigm, existing long before the Web, that had its meaning removed years ago by framework junkies.

  • Ivan Panfilov

    any framework adds some bloat to the application

    • http://www.bitfalls.com/ Bruno Skvorc

      It all depends on *how much* bloat, though.

  • Nemke

    “User Managment” in WP? Who, the hell puts user profile inside of ADMINISTRATION folder (wp-admin) ???? What the hell was guy who did that was thinking????

    • http://www.madblogger.in/ Chirag Swadia

      What is the problem with that ?

      And by the ways, by “user management” I actually mean activities such as user profile, user login and session management, user security and various other factors are managed by WordPress.

      Since user management is part of almost all applications, why to reinvent the wheel if you are getting it ready to use ?

      • Nemke

        Ok, let’s get real here, putting user profile in your administration folder it by THE worst security flaw I have seen on any cms. And yes I have used quite a bunch.

        First thing that any system admin will do is password protect and IP protect admin folder, because in a case of public disclosure of some vulnerability of any CMS he will at least a bit safer.

        Also by protecting wp-admin, most admin would circumvent those slowloris/DDoS attacks against it.

        Are you finally starting to see why I’m saying that is the worst decision that makers of WP has made considering security of WP.

        • http://www.madblogger.in/ Chirag Swadia

          Regarding security what you are saying is absolutely correct. WordPress powered sites are most vulnerable to constant brute force because of the points that you have mentioned.

  • Taylor Ren

    I used WP as my blog. Frankly speaking, I have never thought of using WP as a CMS, let alone a framework. I do use its XML-RPC APIs to grab a few things out of the WP to make my homepage’s index more dynamic.

    For larger and content rich pages, I will use WIKI software instead.

    • http://www.madblogger.in/ Chirag Swadia

      You yourself said that you never thought of using WP as a framework. Give it a shot and then put forward the points that you do not like while using it as a framework!

      • sidscorner

        You don’t need to use something to figure out it’s a bad idea. If I say I don’t want to smoke, are you going to say “Hey, try it first and tell me why you don’t like it”??

        People who use modern frameworks like Symfony 2 will ABSOLUTELY say NO to your opinion. Don’t be surprised by it.

        • http://www.madblogger.in/ Chirag Swadia

          Everyone has their own opinions. I am not saying other frameworks are not good. I have worked on Yii and CodeIgniter too and know what is good in them and what is bad. It is just about personal opinion buddy :)

  • kcwierk

    Stopped reading Sitepoint by now. Goodbye.

  • Mohammad

    It is very funny & comic!!!

    Why you think can use php as a framework???

    • http://www.bitfalls.com/ Bruno Skvorc

      He just explained *why* in the post above. His arguments are right there, and if you disagree, say why instead of just mocking.

    • chiragswadia

      Why you don`t think so ? Just let me know one of the things you feel that some other php framework can do and wordpress cannot ? I will be glad if you enlighten me!

    • http://www.bitfalls.com/ Bruno Skvorc

      You have just been banned. I won’t stand for these types of comments.

  • Simon

    Sorry i dont agree. WordPress is not a framework because its requires a lot of work to use all of the described things above. Its perfect for Newsheavy content and thats it!

    If you want a real combination of a Framework and a CMS check out PROCESSWIRE . The Backend consists of normal page which interact via the API with the CMS .

    • http://www.bitfalls.com/ Bruno Skvorc

      Thanks for the heads up, processwire looks interesting.

      • Simon

        It definetly is! The API gives you super easy access to all pages and users. Plus you can add individually configurable Fields for every page as you need. Building Webapps etc is so easy and you practically need no lightbox,slider or any other plugins . You can build practically everything with only a vast knowledge of PHP. You have no restrictions how to build your site. Wether you want JSON,HTML or whatever. iF you like the WordPress-Style of building pages, then do so. Its just plain awesome!

        Only thing is that default admin is not very suited for businessusers. But there are other admin themes better suited for such purposes. Also its really not that much of hassle to build your own one because the API is where the magic happens.

      • CrashNBurn71

        ProcessWire was the first CMS that I was actually excited to develop with. On their forums I read a very precise description of what PW is, “The most robust data-modelling tool”. Compared to the big three of CMS’s Joomla, WP, Drupal — development in PW is almost headache free.

        Of course, I have to wonder if I will stick around myself, unlike a few trolls complaining about the article itself… SitePoint is bringing my browser to a standstill. This single tab is using(on average) 30% of my CPU (and peaks at 80%+). If this is what “Disqus” does to a website I want nothing to do with it on any of the sites I deliver. When I disable JavaScript this tab drops to 0%. Open more than one or two SitePoint pages that have Disqus and my whole QuadCore 24GB system screeches to a halt.

  • Simon

    You should have used Processwire. That would have been a lot easier!

  • kcwierk

    Lmao.
    With all due respect, WordPress is a piece of code garbage and assuming that it would be *fine* anyhow as an application framework just proves the ignorance of an author. There is absolutely no chance that any serious developer (and I mean an engineer, not “learn php in 24 hours” guy) will consider building solid software with this ridiculous, kiddy-conventional, patternless blogging system.

    • http://www.bitfalls.com/ Bruno Skvorc

      Please tone down the mockery. Where is the “respect” the beginning of your comment mentions?

  • http://ahmadmilzam.com/ Ahmad Milzam

    The best feature that wordpress offer than any major or popular framework out there is.. WordPress media library, it’s awesome! the others just, NO

    • http://www.madblogger.in/ Chirag Swadia

      Media library and user management are one of my favorite :)

  • ankurgupta555

    Sorry i dont agree.

  • rrcatto

    My problem with WordPress is that the code is garbage. And that’s ironic because Matt has this slogan “code is poetry”. Problem was he didn’t write WordPress from scratch. He forked b2 so he inherited their programming methodology which used neither OOP nor MVC.

    Although it’s possible to extend WordPress via plugins and themes and do some fancy publishing with it, I wouldn’t use WordPress as a development platform because its underlying methodologies are at odds with mine.

    I would like to see a complete rewrite of WordPress using their own framework developer tool which they make available to us all as well. I view WordPress as an app that can be extended, not as a framework. Most PHP frameworks are not geared towards creating a blog or cms, so it would definitely be a great tool to have, Their framework would make creating plugins and themes easy and possibly blow away competing theme frameworks such as genesis.

    From a user point of view, WordPress is awesome, but from a developer perspective, it is a nightmare of procedural spaghetti code.

    • http://www.bitfalls.com/ Bruno Skvorc

      Excellent feedback, thank you, and I’m not just saying that because I agree.

      • rrcatto

        I thank sitepoint for providing such a great forum for discussing developer related topics. This post in particular is very welcome. It would be great to get the attention of the WordPress developer community and spur them onto creating a framework dev tool and re-engineering WordPress. I would actually find a use for this tool, because I have a personal interest in developing a blog feed aggregator with blog rankings etc. A WordPress framework should provide all the tools needed to quickly develop such a system.

    • frostymarvelous

      I don’t even bother if I see “WordPress Developer” in a job description!

  • Chris

    I like the way you signed off your post . “Don’t let WordPress breed you into an incompetent developer.” This really rings true for me, as I had to work as a freelancer for a while, and the majority of the time I was fixing other peoples mistakes in WordPress websites. It would amaze me what some people can come up with…

  • http://www.bitfalls.com/ Bruno Skvorc

    Not everything is in the stats. WP is the oldest, and thus the most popular one. Most PCs use Windows, and most people still don’t consider the OS a good one.

    • http://www.madblogger.in/ Chirag Swadia

      Totally agree with you.

  • http://www.madblogger.in/ Chirag Swadia

    This is the same way as I think. WP applications can be rolled out more quickly than any other. This might not be the case for all but still I personally feel so. Thanks for reading though :)

    • sidscorner

      If “rolling out quickly” was the only benchmark for an app, then most would fail. What about maintainability and security?

      • http://www.madblogger.in/ Chirag Swadia

        “Rolling out quickly” means that you have a foundation to build on. You do not have to write everything from scratch. As far as security and maintainability is concerned, it depends on how you code the application on top of WordPress platform.

        What you are saying it right in a way that in other frameworks you have everything in your hand and in WordPress you have to do it the WP way

  • http://www.madblogger.in/ Chirag Swadia

    Great resource Ryan :) I just love the way they have presented a complete iPad and Facebook app developed on WordPress platform.

    • sidscorner

      Alternatively, don’t be scared to grow out of your WordPress world. If you aren’t familiar with modern frameworks – LEARN. Depending on just WordPress for everything limits your opportunities.

      • http://www.madblogger.in/ Chirag Swadia

        Yeah I totally agree with you :) Learning other frameworks or technology is equally important. My point here is not to prove WP is “best”, what I am saying is that there is a different angle of viewing it too.

      • Ryan Ball

        I agree – and if I had the time to learn another framework (I already split my time between dotNET and WordPress development) I would certainly like to sit down a take a stab at it. But there are times when, due to project timeframes and budgets, its just not possible and you have to go with what you know. It may not be perfect, but I still think WordPress is a strong contender as a starting point when developing a web-based app.

  • Peter Nijssen

    I just cannot imagine, using wordpress as a framework.

    While reading the article, I also noticed that there were a lot comparisons with old tools. Like a CI admin panel which hasn’t been updated since 2011, a media uploader for Symfony 1.x. Etc. I wonder if you would compare it with more modern tools, if you still believe WP has on some parts, advantages.

  • http://blog.blacksonic.info/ Blacksonic

    Is it a joke?

  • Pierre

    You’re kidding right…

    Articles like this one is why the myth of WordPress as the all in one tool persist. It’s code base is a nightmare, it lacks any MVC, ORM, Active Record implementation, composer linking, etc… I could on and on and on. Next someone will say “it powers 17% of the web. Sorry, just because something is popular, doesn’t mean it’s good. (Justin Bieber is proof of that theory). And it’s plugin environment, while extensive is so low in quality you can waste hours finding that “perfect” plugin.

    But don’t take my word for it, here’s a quote from another SitePoint article, by Bruno the very editor of SitePoint, telling you how to become a “PHP Professional”.

    “‘But, WordPress is procedural!’ To be frank, and this might sound harsh, “WordPress developers” are no more PHP developers than people with Instagram are photographers.” From:

    http://www.sitepoint.com/becoming-php-professional-missing-link/

    It’s bad enough that sites like SitePoint and Smashing mag insist on consistently plastering wordpress on their front pages. Only contributing to the constant belief that WordPress can solve all that ails the web. SitePoint says one thing and then does another.

    • http://www.bitfalls.com/ Bruno Skvorc

      I’m well aware of what I said, and I stand by it. I’m not going to censor an article just because it disagrees with my own preferences. This is Chirag’s opinion, and he did his best to argue for it. This is not my blog, I don’t want to use it as a channel to propagate my stance and my stance alone. Conflicting articles *will* happen, and it’s up to the community to provide feedback on them.

      I agree that just because something is popular doesn’t mean it’s good, and I agree no one should use WordPress for anything, but you could be nicer.

    • http://www.madblogger.in/ Chirag Swadia

      To be honest, I agree with few points that you have put forward and I am not saying that just because something is popular, everyone should use it or praise it as a Framework or CMS.

      I have clearly mentioned that WP is not following any concepts of MVC or ORM, this is because it was initially developed as a blogging platform which evolved into a CMS gradually. But you never know that next version of WP comes out to be following the MVC pattern or even something new.

      I personally do not think that this post is conflicting with other posts which are for PHP developers ( and not WP ) because this is just my personal opinion and I have put forward all points that I find in WP if I look it as a framework.

      No offences for other frameworks or technologies. I love technology and I`m not limited to loving WP only :)

      • frostymarvelous

        Honestly, this article is rubbish. I am not against the writing or anything, that is sound, but the opinions expressed are simply wrong.

        First of all, you want to talk of a CMS not framework. Why do I say this? To quote you: “Who wouldn’t love their application having an easy to use admin panel through which the front-end content could be managed?” Any CMS that doesn’t provide all what you listed is not worth its salt. and wordpress is not even a proper CMS.

        IMHO Bolt CMS is a way better alternative. It simply gives you the basics you need to manage your content and roles while staying out of your way. Also, it is built on a SOLID framework (Silex) with proper composer support.
        In fact, I think I will be writing about it as a full article.

        • http://www.madblogger.in/ Chirag Swadia

          What if I say that “Bolt CMS” and “Silex” are rubbish and grabage ?

          Well I`m not saying this cause I have not worked on it before. But what your are saying is your own opinion, Similarly what I have written is my opinion and I`m not forcing anybody to think the same way.

          So It is always about personal opinion.

          • frostymarvelous

            I only questioned your views in this article. Opinions are like butts. Everyone has one, that doesn’t mean they should be out in the public.

            If you take an application that was designed for blogging and then later CMS capabilities patched on top, and try to promote it as a dev framework, you should expect strongly opinionated and snide comments aimed at mocking that view.

  • MorgBoer

    It’s about choosing the right tool for the job. We always weigh up pros and cons first. If anything starts looking too intricate, we go with the proper framework option.

    For content heavy sites (news/blog), portfolios, brochure ware sites and your average “small business wanting to get selling online”, WordPress is ace. Things like Woocommerce really makes WordPress appealing. It’s a right sight more pleasant to use than Expression Engine or Droolpill (Drupal) and not everyone codes like engineers (Yes, you guys are the minority – sorry.).

    Theme repositories makes it affordable for people to get online and have a fairly impressive presence. The vast amount of plugins make it a treat to work with, and if it doesn’t exist, you can cobble it together (up to a point, of course). Occasionally a website client will want something custom built and we’ve always been able to make it work within WordPress. You can easily integrate jQuery effects etc. into your theme and it’s awesome that the rewriting is happening so effortlessly. Users love it, script kiddies love it and most of all sensible (read grown up) developers love it.

    • http://www.madblogger.in/ Chirag Swadia

      I like the point you have made initially in your comment “It’s about choosing the right tool for the job”

    • JamesMallison

      “sensible (read grown up) developers love it”. >> Apart from the obvious condescension there, those “sensible, grown up” developers who love it simply don’t know any better – clearly they’re the ones who focus only on getting as much money in as short a space of time as possible; might as well be in sales. I’d rather enjoy my work and be proud of my code.

      • MorgBoer

        The point I was trying to make was that there’s a time and place for everything. There’s a time for writing that piece of code that just blows all other code out the water.. and then there’s the time for getting the job done, in budget, and the bills paid.

  • http://www.bitfalls.com/ Bruno Skvorc

    Now this is excellent feedback, thank you. I’ll definitely keep everything you said in mind as my editing career progresses.

  • Miles Johnson

    Stats does not equate to greatness. The architecture alone in the alternatives already places them higher than WordPress. WP is garbage, stop defending it and learn to actually code.

  • gggeek

    It takes balls to publish this article, and thinking outside of the box is something to applaud.

    Still, I’d not consider comparing WP against “pure-framework” solutions, but rather against other CMS-cum-Framework stacks.
    The idea is that the extra time the developer spends learning to use the framework-part of the cms and overcome its quirks and limitations is more than offset by the productivity boost they get for the part of the website which is just editorial content.

    If yo take f.e. eZPublish:
    – historical version 4 has all the “framework features” you mention, plus proper mvc and oop, and then some
    – new version 5 is built atop Symfony (full stack). This makes it even easier for developer to reap the best of both worlds: modern coding styles and techniques, maximum reuse of their knowledge for both sides, access to a lively vast community and documentation

    • http://www.madblogger.in/ Chirag Swadia

      Thanks for your valuable feedback :) eZPublish looks interesting though!

  • JamesMallison

    Speed isn’t everything. Cake has some awful architecture behind it that promotes very poor practices. Even some of the better frameworks like Symfony / Silex favour things like service locators (anti-pattern) over full root style composition with a real DiC (I digress)… If your only concern is “rolling out code quickly”, and not being truly proud of your own clean, re-usable, testable code following the SOLID principles and best practices, then sure, WordPress, Cake or CodeIgniter are for you. However, slow and steady wins the race…

    • Chris

      I said there was a time and a place for WordPress. I didn’t tell you that if you need “service locators” you should use WordPress. Just calm down..

  • JamesMallison

    Ask people *who genuinely know what they’re doing and are more software engineers than webdevs* about WordPress. 99% of them will tell you you’re better than that.

  • Miles Johnson

    Yeah but none of those applications *should* be written in WP. You’re developing yourself into a corner where too many issues can arise as you do not “own” the codebase. You’re also extending WP to do something it wasn’t built for, and in the end you end up with a gargled mess.

  • Mark Poelstra

    Well, if you want a solid framework for building software, don’t use WordPress. Do you want a content rich, news, blogging, company website/application than WordPress is an awesome tool to build it with. Besides, you don’t need many plugins for a complex WordPress site, my advice is to keep the use of plugins at a bare minimum (because most plugins are crap and buggy). Just make your own theme, make your own custom post types in code en use the ACF plugin (best plugin ever) for the configuration of your special custom fields. With that you’re all set to build awesome responsive websites/applications with awesome frontend coding techniques.

  • dojoVader

    I really find WordPress depressing to develop for, as a ZF2 User am used to a clear structure or MVC, but in WordPress, its just pure spaghetti codes, even looking at codes in the templates, Logic and View tied together. arrrrgh

  • seba

    WordPress clearly violates all best design patterns and concepts, even worse than drupal (pre 8).

    However, 99% of the use cases for my clients I can accomplish way faster with wordpress than with Symfony or another framework. If I had the time I’d do it in Symfony. I would feel good for myself, knowing I have clean code base which allows for modifiability afterwards. However, in reality, I use the tool that gets the job done as fast as possible.

    Btw, Somebody here mentions it is missing stuff like active record. That’s funny, as active record is an anti-pattern violating separation of concern. Yet, I find an active record system (eg. Propel) way more useful than an implementation like Doctrine. Same thing with WordPress. An extremely useful piece of garbage.

    I’m happy with this article as it makes me reflect on my coding habbits. Actually, I often think I’d got things done faster when I was writing procedural code in the php 4 days than when I use well-engineered tools like Phalcon or Symfony these days.

  • Jason Witt

    I agree that WordPress core should be updated to MVC. In theory the WordPress core can be reworked as MVC and still support older themes.

    But putting WordPress core aside there’s nothing stopping anyone from using MVC for WordPress development. All by itself WordPress doesn’t do anything until you write the code for the project. WordPress core is just a bunch of functionality that you can use for building your project like user management, media management, etc.

    Install WordPress and remove the default theme and what do you have. On the front end literally nothing, and on the backend a highly customizable Admin interface. Just like every other framework out there.

    Yes, WordPress core is a total mess mixing procedural and and OOP code and the structure of the the directories and way to simplistic. Leaving it open to attack, but there are great advantages that WordPress has over other frameworks.

    The one that comes to mind is the UI in the admin. It’s got to be one of the best around. Completely customizable and when it come to ease of use, especially for none technical users. I’ve yet to find anything better.

    Not to mention that the WordPress community has got to be one of the best and most active communities ever. WordPress is in constant development and even developers not part of the core development team help to make improvements that’s continually pushing WordPress forward.

    WordPress is a tool just like any other framework. To totally dismiss it is just wrong. There are instances where WordPress is the best choice and there are instances where WordPress isn’t. As a developer I choose the right tools for the job and I don’t pigeon hole myself into one tool just because of personal preference.

  • Christian Bonato

    WordPress is something that allows a serious dev to buy some spaghettis inbetween serious projects, when the money becomes scarce. It brings a few dollars to fill the fridge, nothing more.

    The thing is so absurdly poorly built that the only solution is to hack : who wants to open include after include, and then some incomprehensible core component, only to display/hide some UI element ? I have seriously evaluated WP with woocommerce at the beginning of 2013, as a possible candidate tool for growth. But coming from Codeigniter, when I unveiled the pasta horror, there was no way you could convince me to go back to procedural code (especially this kind of code).

    Once you get a grasp of MVC, ORM, (RoR, CodeIgniter+ORM Datamapper, Laravel and others come to mind) and front-end beasts like (thank you Lord) the almighty AngularJS, you just let the sophomores make a few pennies out of small businesses ignorants, and develop with a smile.

    With Shopify (yuck), Winx (yeeech), and other premade stuff available out there for $4.99 a month, it’s not even certain that you’ll be able to make money out of WordMess in the next couple of years.

    They got lucky, as Daft Punk would say. It only proves there’s an army of slackers out there who thought that being a dev and make a living out of it was as simple as to grab a php tutorial here and there. It has a big ecosystem, sure, only it is filled with incompetent people. But it’s a one-click install, oh my god, stop the press! It has plugins! Wow! Themeforest should be renamed “ThemeJungle”. The WP.org forums are filled with lazy punks who, judging by their questions, one day bought “HTML for dummies”, read the first twenty pages, and got the illusion they could make a hundred grands a year.

    I know what I’m talking about, I spent my first years cooking PHP/HTML/JS spaghettis for a big B2B portal project, and the end result is not so distant from WordPress. Procedural is good in the days of youth, because it means coding in debug mode, you spent a lot of time echoing and printing out stuff, and even without an enginnering background, you start to understand how a software works, and you have an epiphany when your first complex script runs smoothly and brings you (finally!) some customers.

    I tend to be less harsh on the admin, but we’re talking UI here, not software. But still, grab yourself an admin theme on Wrapbootstrap, wire it to Angular, wire it to Firebase, MongoLab, or your very own RESTful system, and you can make a huge, scalable intranet machine full of UI gizmos in under a month, that is if you’re curious enough to learn about :
    – Agile Development,
    – preprocessors,
    – package management systems,
    – DRY and REAL frameworks.

    And in the end, my friend, you’ll make less customers, sure, but much more serious than the pizzeria at the corner. And they will pay you much much more for your code, if this is really the only thing you care about. And if one day you get tired of being an independent worker, you’ll be sought after by serious tech employers.

    Last but not least, every new project will benefit from the previous ones. Not only will you be paid more, but you’ll spend half of your billed workdays taking sunbaths.

  • Christian Bonato

    Ah ! I got the virus from Kevin Yank too ! May he be forever blessed.

  • ravin sharma

    I use WordPress for my clients and personal use, I must say its code-base is a mess. The action, and filter way of writing code is good for extending, but quickly one can realize this is crazy to maintain when your custom code increases rapidly. I do like WordPress high usability, its friendly user interface is preferred by my clients. Big thumbs up for end users, big thumbs down for developers.

  • Charles Bryant

    Wow there are a lot of comments here! Thought I would wade in a drop my thoughts on the subject.

    I don’t think anyone should be encouraged to use something for which it is not intended, it might start off being a good idea, but it will soon get you into trouble, I speak from experience. Different tools for different jobs.

    I hate word press and everything it stands for, the code base is an abomination, it makes my skin crawl, but on the other hand I love using word press to manage a site, what user interface is better?

    I think the bigger question is: Why is there no decent CMS solution built in php? I have used so many different packages over the years I can not say I really like any of them. I do however love Magento, as it really encapsulates how software should be designed and built.

    Why is word press not concentrating on building a product that merges the amazing user experience with a solid code base, if they do not do this someone else will.

    • http://www.madblogger.in/ Chirag Swadia

      I agree with you Charles. The WP code is not as per the current programming methodology and it does not follow concepts of OOP or MVC.

      Magento`s code follows a good programming pattern and something of this kind should be followed in WP too.

      Thanks for the nice feedback.