PMPro Code Gist #2

Recently,  I was privileged enough to help another customer with a simple but effective code recipe (that is what we call a snippet of code, also known as a code gist).

This particular coding recipe will enable you to disable certain features of our Capture Name & Address for Free Levels or Off-Site Payment Gateway Add On.

In this particular case, our customer wanted to use this Add On to capture billing details from his members when checking out with the Off-Site Payment Gateway – PayPal Express.  But, wanted to disable the billing details for his Free Level (the Add On above would have inserted these billing fields into both the free and premium levels).

 

There is something deeply satisfying with Code and the ability to form, mold, hack and debug your way to a solution. Especially a solution which produces desirable results that turn into awesome reviews!!

Customer Support Review


In an online video, not so long ago, I heard a quote that went something like:

The Programmers, developers and coders of today are the modern Wizards and Rock Stars of our age. – Will I Am (I think..)

Back then, I thought: “Well that was a bit much.”

But I have to admit, there really is something quite magical about turning some lines of seemingly odd and encoded digits and figures into solutions that help make peoples lives better.


If you want to learn to develop cool, new things why not try:

  1. Treehouse – Great guided video developer series.
  2. FreeCodeCamp – Learn to code. No Videos but it’s free and easy to get started!
  3. Allessandro Castellani (YouTube) – One of the best, if not the BEST YouTube instructor I ever had!!

By hook or by crook

Recently I wrote my first ever coding gist from scratch! I know, it really isn’t such a big deal but for me it was really nice to experience some progress being made of my developer skills.

I have tinkered with pre-written gists, made edits to some to suit my own preferences but never have I made one from scratch.

In the below gist, I basically hook into the a part of the Paid Memberships Pro code that handles the different currencies of the plugin and adjust the layout of the Danish Krone. This was inspired by one of our members who needed the layout of the currency to look a little different to how (PMPro) handle currency layout by default.

Creating this gist involved me, looking for the location of the currencies, figuring out where to hook into the code and then of course, writing a function that will ultimately change the default currency layout to that of our client’s request.

One happy client

No big deal, right? Sure. If you are a developer!

Perhaps, this calls for a bit more of an in depth step by step guide on how I did this and the process I followed? If you think so, let me know in the comments below.


Want to learn more?

I would highly recommend checking out Alessandro Castellani and specifically his WordPress 101 for beginner developers.

 

Happy Coding :)!

Snippets of the day #2

Previously, I posted a “Tweet of the day” blog post. The idea here was to share some cool tweets that stood out for me. Since the web extends far beyond Twitter (surprise, surprise). I decided to include stuff I come across, like articles and videos too!

    1. Tweet of the day – Hugh Lashbrooke giving some insight on some of the stereotypical working conditions in the “dev” industry and how things turned out for him once he left.


    2. The ONE THING holding developers back by Jarvis Johnson – I see a blog post coming up. 


    3. How much is enough? – The Ground Up Show by Matt D’Avella


 

Consistency is key.

“We are what we do repeatedly. Excellence then, is not an act, but a habit” – Some book. Read by some guy on YouTube.

In order to do things, to live life to the full, to move forward. We need to do just that, move forward. Little by little, day by day. “We are what we do.”, “Repeatedly.”, these are some of the simplest and most thought-provoking words I have ever read.

Whatever you want to do with your life. Break down the biggest part of it into little, habit-like tasks that you can do daily. Here are some that I am currently doing.

Learn Norwegian – 1 or 2 Duolingo lessons per day.

Run like a champ – Aside from my cycling and weight training every now and then, I run pretty much every day. Even if it is just one kilometer.

Read more books – A couple of pages each day, either in the morning or just before bed.

Learn to Code – I aim to do a couple of lessons per day with FreeCodeCamp (working my way towards becoming a Frontend Developer).

Blog more – aside from this last four weeks I usually aim to push out a blog at least once a week, why? I want to practice writing, sharing and communicating and you should too! Start your blog today.

Design – this one is a new one. I plan to design or create something daily. No need to spend hours doing so, just find something simple online and recreate it. Will start this tomorrow. I think I will start practicing my illustration techniques 🙂


It doesn’t help if we climb halfway up the mountain in a day and remain there. It is far better to climb it one step at a time daily but reach the top.

Side note, if you can sprint up the mountain and stay there, well, then.. Well done!

 

How to become one of those people that run (for fun) on the weekend.

Believe it or not. It does not come naturally to want to wake up early, get dressed and go for a run in the early hours of the morning. Especially weekends. For fun. I know…

As an adult, there comes a point in your life where you want to improve your overall health. Maybe you want to lose a couple of pounds or just stop getting winded climbing a few stairs. Whatever the case, here are a couple of tips that helped me become one of those early rising, active types that run on weekends. Trust me, this was not always the case.

  1. Start small – not that long ago a victory for me, consisted of waking up and going to the gym. Even if it meant walking at a snail pace for 10 minutes on the treadmill or even just sitting, reading a book in the gym lobby waiting for my friend to finish training. As time goes on, increase the intensity, speed, weight or length of the activity you have chosen. If you are like me (a millennial) you have to fight the urge to want to become a triathlete, overnight, just because you thought it would be or look cool. One training session will not result in your looking like The Rock or taking on the Tour de France.
  2. Be consistent –  Slow and steady wins the race. Walking every single morning for 20 minutes for a month is better than running a 5km once a month.
  3. You cannot out-train poor nutrition – Surprise, surprise. No matter what activity you are doing. Try running a car on mud and it will break down.
  4. Find a gym buddy or running partner – find someone who you enjoy being around,  someone who is in better shape than you and can help push you past the point of what you think is possible. Remember, we become like those we associate ourselves with. Unless you are really self-driven and disciplined, I would say having a gym buddy is vital. I would often throw myself out of bed in a spin at 5 am running out the door to go train. Just because I knew my training partner was downstairs in the car waiting for me.
  5. Find a diet, eating plan, lifestyle (eating method) that works for you – Keep trying until you find something that works for you, you can keep it up long-term and it doesn’t make miserable. Slow and Steady. We in this thing for the long haul. What worked for me was intermittent fasting – OMAD (one meal a day)
  6. Do something that you like – try to find an activity that you like. I hated going to the gym and running. So I would cycle, walk and play squash because I found those to be a lot of fun. After 45 minutes of any of those activities, I would be dead tired, sweaty but had a smile on my face.Now that I am fitter, I actually like running (and gym), I feel better about myself, and can run for more than 2 minutes (not kidding) before it feels like my legs were going to break right under me.
  7. Doing something (even the tiniest amount) is FAR BETTER than NOTHING – I know this is basically point #1 coming up again but it is true. You might be tempted to think that if you can’t get out of bed and run for 20km, there is no point. This is false (thanks Dwight). Keep at it. Waking up turns into walking. Walking to jogging. Jogging to running. Before you know it, you are finishing races and waking up early on a Saturday to go running and there is nothing else you would rather be doing. Not even sleeping.

Whose with me?