Migrating your WordPress site to SSL

There are two steps to migrating your WordPress site over to SSL (https instead of http) after you have set up your certificate and web server configuration.

The first is relatively easy: update your Settings > General and change the WordPress Address (URL) and Site Address (URL) from http to https.

The second, part is a bit trickier.

Basically for SSL to work correctly you want to avoid mix-mode content. This is where content is being served both via http (non-SSL) and https (SSL). When this happens your browser won’t show the site as being 100% SSL, and instead display different messages depending on your browser. Its enough to deter users from using the site if they are expecting the “green” secure padlock.

To fix this, you need to find and replace references to non-SSL content (hardcoded with http://) in two places — your code and your database.

For your code, the first place to check is your theme code and settings. Look for and replace any instances of http:// with https://

You can use your browser’s debugging/inspector to check for files that are not loading via https://. Note too these might be external resources and scripts (e.g. external Javascript libraries, Google fonts etc). This can also be an issue in plugins, particularly when authors start hardcoding the absolute URL with http://.

For your database, use a tool like Better Search & Replace to search your WordPress site for references to http://<yoursite>.com and replace it with https://<yoursite>.com.

Scanning Your Server for Malware

If you’ve been unfortunate enough to be targetted by hackers who have added malware to your web server, here are a few Linux CLI tools you can use to troubleshoot.

The first is maldet which can be paired with Clam Antivirus to scan for malware. Here’s a good guide on how to do that.

Note you can install maldet via tools like yum or apt usually too. The key is to make sure it is running together with ClamAV which you should keep up to date. You can also get it to alert you and automatically quarantine suspicious files.

Another tool, which is much better at finding hacked PHP code (which is usually encoded) is PHP malware finder. You’ll notice that hacked PHP files aren’t plain PHP code, but have instead be encoded (e.g. base64) to make them unreadable without decoding.

This can be cloned to the server and run from the CLI with PHP. Just a note it will pick up a lot of positives depending on your app (e.g. WordPress) and you’ll need to work through these yourself.

Don’t forget to also have something like [All in One WP Security and Firewall] (https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/) installed to lock down your WordPress site and also to scan for and alert you of any changes.

As a final measure, it helps if your application code is kept under version control on the server using a tool like git. This helps to see any untracked or modified files which you can then investigate and quarantine.

The Folly of Real Time Chat

Real time chat clients like Slack, Hipchat and Skype are becoming very common place in most work places. They let you communicate quickly with your co-workers and ask questions as soon as they come up in your work day.

That all sounds great but it means yet another pervasive distraction in your work environment. However, unlike email, real time chat still has the expectation of a near immediate response. This is the problem. Even the smallest distractions have a switching cost – the time it takes to bring your mind back to where you were before the distraction.

Such requests are almost always not urgent (if they are, they are usually followed up by other means like a phone call). They serve the requester well, in that they can get assistance with a problem they are facing in real time. But they have a high cost to whoever gets distracted by the request. Multiply this by the people in a group or channel for a group request and it becomes clear they are clear and present danger to productivity. A group/channel request is basically like walking through an office with a loudspeaker shouting out your problem. Is what you are asking really important enough to be doing that?

The usually quoted time to refocus after a distraction is around 15 mins. A few trivial real time requests can quickly build up to hours of distraction across the entire organisation because they are much more difficult to ignore (and the expectation is for them to be answered immediately).

Like all tools, real time chat, is just a way to communicate. It is up to the user to use the tools well. The first thing in adopting such tools is to drop the stigma associated with not responding immediately to a real time chat message. There is absolutely nothing wrong with that.

The second thing, is awareness. Realise what it costs to make such requests. Make it clear they aren’t urgent (they never are). Set the expectation to receive a message when the other party is ready which could and probably should be many hours after your request.

Simple Does Not Mean Easy

One of the first things I wanted to point out about this blog and life in general is that the terms simple and easy are often interchanged.

However in the world of self improvement and change, they are very different things.

You’ll find almost all self-improvement changes are fundamentally simple:

  • Focus on one thing at a time, don’t multitask
  • Eat healthier to be healthier
  • Do the most important thing first to be more productive
  • Exercise to improve your mind and body
  • Focus on what is truly important and ignore what is irrelevant

These aren’t hard concepts to understand. In fact they can be stated in sentence. Sure, there are details e.g. what is meant by “exercise” that
take more explanation, but the details don’t change the fundamental principles of each one of these concepts.

The problem lies in the fact that people confuse simple with easy. In many cases this couldn’t be further from the truth.

If it were easy to do all these simple things, there wouldn’t be a mass-market for self improvement media.

This is one of the core themes of this blog. Most of the principles you’ll come across are simple, or often just common sense. That’s not the
issue, just because you understand something doesn’t mean you do it (otherwise why would people choose to continue smoking for example?)

Take Control of your Time

A key principle in productivity is that if you don’t take control of your time, someone else will take control of it for you.

Every endeavour in self improvement requires establishing a habit, and a key part of that habit is allocating time to focus on that habit above all else. Considering a regular workout routine, or a habit of reading daily. To get these habits to stick, you first have to be the master of your time, and master is the correct word here. You need to be ruthless, and make sure everyone around you understands it is your time, and it is more valuable. Don’t let them make you feel guilty for it. When its all said done, what are the chances you’ll regret not clocking in more time for someone else? Remember, its an investment in your life, and interestingly, by ruthless in your time, you can come out of it all, more able to help those around you, because you put yourself first.

I find one way to make this stick is to remember the safety advice when you get on a flight:

“Fit your oxygen mask before helping others.”

Look after yourself first, so you can help others later.

Mindless is Pointless

Doing things mindlessly means the things you are doing are pointless. Whatever value you may gain for any endeavour has to happen while you are in the right state of mind.

If there’s a cornerstone to self improvement and productivity, its mindfulness. It allows your mind to reach a state, where other improvements can finally be brought into focus. Without addressing it, you’ll always feel like there’s something missing. You might be consistent in your habits, and reach some of your goals, but the overall structure of your day, your life, won’t quite seem to be in harmony. Mindfulness practice addresses that, by first making you see the fog of busyness, and distraction which permeates our lives. Everyone wants to have more time to get more things done, but productivity alone isn’t the answer you seek. Its not about getting more done, its about getting what’s important done.

Like all things, it takes time to undo the effects and you’ll have to work at.

If you don’t know where to start with mindfulness practice, try something like Calm

Consistent Like the Tortoise

Remember the story, the tortoise and the hare — slow and steady wins the race? My logically inclined brain spent far longer than anyone should on wondering what that story was trying to say, I mean, how could that really happen? The hare is so much faster than the tortoise it makes no sense.

In hindsight, the story is actually delving into behavioural psychology, that is, humans don’t behave the way you generally expect. It is a story about consistency, and it brings up an very important core concept. You see, when it comes to achieving anything, most people are by definition average, and most people are like the hare. They start with a spike of motivation, and get miles ahead of the tortoise. They then slow down, due to any number of factors, overconfidence, drop in motivation, external events, excuses, other bright shiny objects etc. So yes, in theory, if you kept up that pace, you would well and truly win the race. In reality (and hence the message of the story) you don’t keep up that pace, and you are kidding yourself if you think you will for anything non-trivial, and eventually you will be overtaken by the tortoise. Because that tortoise will have a higher average speed.

Worse yet though you probably won’t even finish the race. This isn’t covered by the story but it is the more important point. If you are like the hare, you probably won’t finish at all. Don’t worry about beating the tortoise, just worry about finishing!

The take home? When you start, go slow, slower than you want to. Because you need to build consistency into any new system (remember systems/habits are far better than goals). Some examples:

  • Learning a language? Start with just one word a day.
  • Trying to get fit? Start with a 5 minute walk a day.
  • Trying to lose weight? Eat one healthy item a day.

Too easy? Yes! That’s the point, it is meant to be so easy you can’t not do it. Then once you get going you can build momentum, but even if you don’t, you’ll still be moving like the tortoise. Slowly? Sure but still moving.

The Path of Least Resistance

Like most things in nature (water, electricity) humans tend to follow the past of least resistance. Another way to put it is that we tend to default to conserving energy.

Given the options, we tend to take the path that requires the least amount of effort/thought. Yes I’m saying we are all lazy. If you don’t believe it, consider whether you would rather watch a good TV show or clean the house. It isn’t your fault, blame biology. The tendency to conserve energy makes sense. What if there’s a tiger around the corner waiting to chase you?

One weapon against this is will power, which we all know is fairly limited but works. This is what stops us (well most of us) from just sitting around all day and not accomplishing anything. To take another physics analogy, we also follow the law of motion, which for this purpose can be paraphrased as :

“things at rest tend to stay at rest and things in motion tend to stay in motion”

That is, once you have some momentum, the path of least resistence often changes, and it is easier to keep doing the thing you are already doing whether that’s resting or moving.

So with some theory behind us, my suggestion is to always assume you and your future self will take the past of least resistance. People are over optimistic about what they think they will accomplish. This view point brings you back down to earth.

If you have 4 hrs left on a project, the optimistic future planner in us assumes we can knock that over in half a day tomorrow. But seriously, if we are to assume we will take the path of least resistance for the entire day on this project what is actually reasonable? Maybe 15 mins assuming we arrange that time in advanced? Better to get 15 mins in, then plan to get the full 4 hrs in and to do none (and then feel really bad about it!). At the end of the day you have actually progressed. This way of thinking is a real cognitive barrier. Because it goes like this:

(A) “I could have done 4 hours on this project but I didn’t do anything on it. I’ll definitely get 4 hours in tomorrow”. Or worse yet, “what’s wrong with me, why do I keep procrastinating? I’ll never get this done”.


(B) “I did 15 minutes on the project, yippee and now there’s only 3hr 45mins to go”. Perhaps better yet that 15 minutes has made siginificant progress on the project and now there’s only another hour to go?

Think about the difference in working week (5 days):

  • Scenario (A) means we have 4 hours left because we planned and failed to complete the whole project on any given day.
  • Scenario (B) means we have competed 75 minutes (5 days, 15 mins a day) of the project.

There’s a really important side effect of Scenario B. That 15 minutes each day is doing a lot things in the background that do not happen with scenario A, for example:

  • You are building the thought process, ideas, cognitive pathways to solve the problems associated with the project
  • You are thinking about the project outside of the 15 minutes you actively work on it (subconsciously) and you your brain is actually doing some background processing for the next day.
  • You are succeeding in small increments (not failing) and therefor eating the elephant one bite at a time.
  • You might identifier any blockers or additional items you need to do in that 15 mins that you can progress independently of the main project.

An impressive trick, considering that often you will find this approach will solve the problem faster than you anticipated, assuming it isn’t something that is purely time based, as most projects are a mix of creativity, work, and follow up.

One final thought. Remember that any estimate you have on the length of time to complete project, can often be optimistic. The 4 hour project might end up taking 10 hours. So scenario B (15 minute increments) will bring that to light a lot faster than starting the entire project in Scenario A and finding out the elephant is a lot larger than you thought!

Easy can also be Expensive

Taking the easy way out, always has a price. Often that price is hidden (or small in each instance), and in the moment, because it is the path of least resistance, everything is good, until you find you keep paying that price over and over and over again. Suddenly it becomes very high.

That all sounds a bit cryptic, take the classic issue of blaming someone or something else for a problem. This is the classic easy way out. The hard way, would be, despite the situation to take responsibility for the problem. Note this doesn’t mean taking fault, it means realising that the problem is something you and you alone need to deal with to build your character.

The easy way is to blame everything else but yourself, and shift the problem away from you. It works nicely in the short turn. It takes away the problem, the pain and any other emotion associated with it and puts it squarely on someone or something else. Done!

Except, over time, it depletes your character. You pay the cost of not being able to shoulder any burdens and over time, it means you no longer can. When a problem does surface that is clearly yours alone to deal with, now what? You breakdown because you didn’t build the strength and courage to deal with all the other preceding ones that would have helped you here. Now, that problem escalates into something that damages your core being. In isolation, the problem may be minor, but still you don’t know how to cope, because you’ve forgotten what it takes to deal with such a situation.

This is the price you pay for taking the easy way out, time and time again.