What is PHP?
PHP is a scripting language that outputs a webpage by processing it on the server before sending it to the person viewing the page. How is that any different from a normal HTML page? Normally an average every day HTML page will simply be sent to your web browser for it to figure out how to display it, PHP thinks about things before sending your web browser the HTML. This means that it can process forms, access content from other sites, read a database, and many other things, before sending the web page to you! This unlocks a whole world of additional options when creating web pages.
How does PHP affect WordPress?
WordPress is written in PHP, this means that everything you are viewing is pre-processed by the server then spit out on your screen. This allows WordPress to use many theme files to build your page dynamically on the server, before sending it to you. WordPress could be loading 20 different PHP files right now, and what you see is 1 file on your screen(this page).
What’s so cool about that?
All of this happens in milliseconds! The database information is retrieved in fractions of milliseconds, the pages are loaded and processed in milliseconds, and the final page is sent to you for viewing in less than a second. That’s amazing. Think about the amount of time it would take for you to take 20 pieces of paper and glue them together, to make a somewhat readable, single page document. It would be ugly, and it would take much longer than one second.
What can I do with PHP in my WordPress site?
Well honestly, you’re not required to do anything, but you can use it to produce dynamic content that is always up to date for your users. Something I’m working on right now is a budgeting tool for people to work on getting out of debt, or start saving money. This is going to be a simple tool that the user types their information into, and it puts it in a database. Once the database has their info, they’ll be able to view it from a webpage that lays it out nicely for them, calculates how much they could possibly be saving each month, what weeks they should be paying each of their bills, and how they could be saving or investing money. You can check out how I’m doing that on this post.
How does WordPress contribute to my PHP scripting experience?
WordPress has many built in functions that make things a lot easier, when writing in PHP. It’s amazing how much I find out each time about the different functions that WordPress offers, when I would have normally written the PHP by hand. I’m focusing lately on not reinventing the wheel as a developer, it’s very hard to do – I feel like I should be writing my own code, not reusing code that’s been written for me. WordPress does an amazing job at providing things to make life simple for a developer, and I absolutely love it!
What brought you to consider PHP with WordPress?
What made you think about this? Do you need help? Are you stuck on a piece of code, and you’re not sure what to do with it? Feel free to comment, and I’d be more than happy to help you out!