This is a quick overview on running a PHP file via the command line, bootstrapped within the WordPress ecosystem. This sounds like a mouthful, but it’s a fairly straight forward concept. Let’s suppose you have a requirement, where you need to run a PHP script as a one off, or even regularly as a cron job (let’s forgot about WP cron for a moment). The specifc use-case I find arising again and again, is where I need to import data from another source into WordPress. Perhaps the data I’m getting is in a really weird format, from a legacy system, needs to go into a custom system, or a host of other reasons why imports may not already exist for your use-case.… Read the rest
Category: How To
Installing Laravel on an AWS AMI
Today I decided to install Laravel on my AWS instance to have a bit of a play and see if I can’t create something fun. The Laravel website provides incredibly good guides which contain most of the required details:
- http://laravel.com/docs/4.2
- http://laravel.com/docs/5.1
Upgrading packages
I am using an Amazon Linux AMI for my instance, which uses PHP 5.3 as it’s standard PHP version. Laravel requires PHP version 5.5.9 or above, so first things first, install PHP 5.6:
sudo yum remove php* httpd* sudo yum install httpd24 php56 sudo yum install php56-mysqlnd php56-gd php56-mbstring service httpd start
This removes the old versions of PHP and Apache that are installed, installs updated versions of both, and then will install some extra PHP packages that are required, and finally starts Apache back up.… Read the rest
Development Processes – Making WP Config Generic
My Process
When developing a site it’s good to have levels of separation between your development environment and a live production server. I normally have three levels when creating a site:
- Development
- This server is mine, I can do what I want on it and destroy what I please. Clients and users will have absolutely no visibility of it. There will be frequent changes of varying size and complexity.
- QA
- This is where clients start to come in. Using this server they can view major versions that I release from Development when they are ready. This should be a stable server but will have well controlled occasional changes.
Renaming a theme and its folder
Considerations
Sometimes you are going to want to rename a Theme. Maybe you’re utilising a free theme to base your development work on. Perhaps you’ve just done a huge rewrite on an existing theme. Or even you just think your theme needs a new name. If you want to modify your theme you may as well do a thorough job, as there are some annoyances that’ll show if you don’t. Below I’ve included the considerations you’ll need to account for:
- WordPress Admin – Appearance -> Themes
- The theme selector – all of the theme information will be displayed here. You’ll also receive update notifications for themes here.
Test Data
Making a brand new site is great! You get to start from scratch and completely re-imagine and refresh the design. However this can at times leave you with a problem. The new site looks bare! There’s nothing to look at, you have no idea how it’ll look once editors start using it and populating it with data. This is unbelievably important! You can often be surprised at how many bugs and issues spring up when you can’t thoroughly test your new site with data, text, images, and strange editorial practices.
Some of these you can account for, unfortunately it’s not the editorial practices.… Read the rest
Character Encoding Woes
Recently I’ve been plagued with character encoding issues everywhere I go. Inevitably people just do not plan for special characters on their website. English does not generally use them, so it can often slip the mind of developers. Unfortunately special characters are extremely important and if you do not cater for them your website can look unprofessional or just plain bad. This is especially true if you have a team of editors working on your site to provide content – content copied from word processors/publishing software can unintentionally contain special characters such as curly quotes ( ‘ ’ “ ” ) and long dashes ( — ).… Read the rest