Roadmap

Home » WordPress: Hacks vs. Plug-Ins

WordPress: Hacks vs. Plug-Ins

June 24th, 2009 Post Comment View Comments

WordPress is of course one of the most amazing open source projects out there for the blogging world, as I currently write this from my lovely little administration panel. (No I am not biased at all, I swear!) The problem with some of these open source ventures is that not everyone is content with the out-of-the-box features, which is ok. The lovely creators gave us the ability to install plug-ins which can further enhance our blogs and give us the ultimate functionality we are looking for. The problem though comes with those certain features some of us want that do not come all neatly packaged in a plug-in. So should we hack the core files, or dig deeper for the sake of reliability and safety?

I vote for safety seeing as how I enjoy many of the automated features that WordPress provides such as being able to upgrade my installation with a single click in the administration panel. Also having the ability to turn plug-ins off and on as I so desire isn’t bad either. The question though seems to be, ‘what is the problem with hacking core files?’ Well, simply put, hacking the core files means that in order to upgrade your installation ever, you need to download the newest version and then go through it and implement the same changes you had made to your original core files. As new versions are released certain functions could be swapped out or deprecated and the function you were previously altering may very well have moved within the source file, or be located in a different file all together. With that being said, you then spend more time trying to hack the new version, when you could be writing new content for your blog! Is there more you ask?

When you hack the core files, you also bypass the plug-in features which include the ability to enable or disable them at the click of a button. This proves to be particularly useful should you happen to install another plug-in which interferes with the hack you have in place. Perhaps this problem causes your blog to error out, while you are stuck in the airport without a computer and your neat little smart phone doesn’t have the ability to FTP source files back and forth from your server. Ok yes, that is a bit of a hypothetical but my point still remains; hacks are exactly what their name implies, hacking up the core files which always seems to create a lovely little mess. Enter the beautiful world of plug-ins.

Most anything you would ever need to hack your core files for can be done through the use of a plug-in. If a plug-in doesn’t already exist, then take a stab at creating one. WordPress comes packaged with the ‘Hello Dolly’ plug-in as an example of how to get started with creating your own plug-ins. It is also very helpful to download a plug-in from WordPress similar to what you are looking to do, and then study their source code to see how they went about implementing the functions. If all else fails, there is a massive community of WordPress fanatics like myself who are always more than willing to pontificate on the best method to accomplish this task or that task. Don’t forget Google either since, with its’ popularity, most WordPress questions have already been asked and answered before by someone. At the end of the day, if your custom plug-in fails, just click “Deactivate” and try again in the morning. This definitely beats having to upload entirely new core files over and over again because you hacked them to pieces and forgot just how many files you actually altered! Trust me… I learned the hard way back in the day :-)

If you have any questions, or just don’t really know where to start, you are always more than welcome to contact me. I always love to hear from my readers and am here to help.

  1. No comments yet.
  1. No trackbacks yet.