How to forward catch-all email after canceling Google Apps subscription

I am doing some digital house cleaning and I’ve wanted to cancel a Google apps business account for a while now but the ease of using the catch all domain names has been great and I didn’t want to give that up. Plus the interface for Gmail isn’t that bad.

I know there are paid services out there that offer similar functionality and I was ready to buy one until I came across this!

Enter https://forwardemail.net/ 🎉

It’s an open source and free email forwarding service that can handle catch all addresses. Setup is simple. Add some MX records, then add a TXT record with a forwarding address. This does make your forwarding address public but since I use Hey I have pretty good control on who is allowed to email me thanks to The Screener.

Just in case, I did change the few accounts still using those custom domains, but I’ve tested it and so far within about 20 minutes things seem to be propagating nicely. I’ll be keeping an eye on it over the next few weeks but an hour in and I’m pretty happy!

Check it out!

Health update – March 2021

Been a hot minute since my last update! To those of you that reached out to check on my progress, I am very appreciative and touched that you take the time out of your day to think of me. It’s encouraging to my soul. ♥️

Since my last update in January, things have been pretty a-ok. I’ve been seeing a therapist since that time and while I don’t feel that I’ve come to any sort of dazzling revelation, I keep scheduling appointments at the end of every session. I think part of what I’m latching onto is the accountability of talking to someone. I pay this person $100+ a month to listen to me give progress reports of my mood and feelings, and my physical health obviously plays a big role in that. Maybe I would do just as well with one of those gambling apps where you put down some money to accomplish some task and if you fail, they don’t give it back?

Exercise

My Apple Fitness workout history

As you can see from the picture here, I’ve gotten into working out a little since the end last week of January. 95% of the time, this is riding the stationary bike in my building’s gym, but sometimes I’ll go for a long walk up and down the parking garages’ surrounding my house (it’s been cold though!). It’s light exercise by any standard; very low impact, and I usually stop soon after my exercise ring closes; about 30 minutes. In that time, the bike says I travelled 6-8 miles, depending on my pace.

The biggest break was the week of February 15, where Texas had the snow-pocalypse that cut power to millions of people and dozens died of exposure, indoors. While I won’t go into the politics of it all, needless to say that week was weird. My partner and I went to my parents house on Monday night and were there most of the week. My parents don’t have a gym and I didn’t want to go trek in the snow just for a workout so I stayed inside.

I can’t say that the workouts are providing a lot of physical benefit. My weight hasn’t dropped drastically (as will be evident soon) but I cannot definitely say there is no benefit at all. This past week I’ve been working out later in the evening, around 10-11pm, and largely have been motivated to that thanks to the support from some colleagues at work. A few of us have Apple Watches and getting the notification that someone closed all of their rings for the day is a surprisingly effective motivator. The fact that I am responding to that pressure in a positive way is probably a good thing. I can easily think of times past when I would have laughed at those notifications and went back to watching TV and eating an entire bag of Doritos (…now I want Doritos…).

As the weather begins to warm up here in Texas, I want to try taking my rides outdoors as I have acquired an actual bicycle from a friend. I’m interested to see how that goes over the next few months.

Diet

My diet has been generally the same as before and I’ve done a decent job of sticking to my targeted macros. In the past two weeks, I’ve fallen back into my Wingstop habit, which is not sustainable calorically or financially, but the dopamine hit has been undeniable at times.

My go-to dinner has become a large salad with 4-5oz of greens, an ounce or two of goat cheese, fresh strawberries, and a handful of nuts with some sort of low carb dressing. I pair that with some protein, usually chicken of some variety, about 6-10 oz if I had to guess. Chicken thighs are my favorite though.

When I do get Wingstop, I’ve now transitioned to only ordering chicken (without my usual large side of fries). That alone is a reduction of close to 1000 calories and 100 carbs when y0u factor in the ranch dipping sauce. If I have the ingredients available at home, I will first make a salad like I described above, eat that, then eat the wings. The greens soak up a lot of the grease and upsets my stomach less, while also helping me feel fuller. I noticed this last night as I finished eating around 8:30pm and didn’t feel compelled to eat more the rest of the night.

At 10pm, I noticed the time and thought I wanted to get a snack, but managed to talk myself into drinking a big glass of water instead. My usual after dinner snack can be 500-800 calories of roasted nuts so great calorie savings there.

I still have a weakness for snacks, which I tend to eat after dinner but I think I’m doing better. For instance, I’ve started eating fresh strawberries as a snack which is surprisingly less bad than I originally thought. A pound contains 150 calories and 22g of carbs with about 8g of fiber. Those aren’t keto macros, but I can often feel stuffed after finishing a container. Satiety is my biggest goal when eating so that’s fine by me.

I’m still taken with how my tastebuds have changed in reaction to my decreased sugar intake. The strawberries now taste so sweet to me, it makes one part of my brain think that there’s no way they’re healthy, but they are! A few weeks ago I got a craving for a shake from a fast-food joint and it was insanely sweet. I still drank it, but I honestly haven’t had the craving since and writing about it now, I am unfazed.

If I had to rate my diet since the last entry to this series, I’d probably give it a solid 7/10. Not perfect, but not a total failure either. C+

Weight Loss

The graph tells most of the story, but I’ll elaborate. I’m not sure if I put numbers out there, but then end of 2020 was rough. As you can see, I gained 20 pounds in about 2-3 months, despite intermittent fasting 16+ hours a day during that entire time.

Since January, I’ve been back to my 5 meals a week eating schedule and making progress in a positive direction. At the end of January, I purchased a new bathroom scale which has been encouraging and like I mentioned earlier, I’m now also working out every day. My body fat percentage has decreased by about 4% in that time, which feels good to me. I’m currently just under 38% body fat, which is still a lot, but it’s miles better than the high 40s I was rocking in 2018.

February was basically flat in terms of weight loss for the entire month, with some ups around when the storm hit. Considering one night that week I ate an entire large pizza by myself, probably not the worst outcome! March has been better, though we’re only 6 days in.

Tonight is my dad’s birthday and we’re going to an all-you-can-eat steakhouse and I’ve already resigned myself to indulging on some mashed potatoes and likely a full pound of meat, but honestly, it’s probably not that big of a deal. This month, I’d like to try and focus on mindfulness when it comes to snacking as that’s where I believe the bulk of my hindering calories come from. The roasted nuts especially.

If I can get under 250 by the end of the month without immediately fluctuating above that number in April, I’ll be really happy I think. That’s 1 pound a week which should be totally doable and sustainable. If I can keep that up for a year, I’ll be entering 1-derland in time for Summer 2022. That’s exciting!

I think I mentioned this before but I’ll say it again because I’m thinking about it. Winter 2020 was huge bummer for me because I had done so well in 2019. I bought new clothes that I was excited to wear, especially the following winter, that I ended up not being able to wear comfortably at all without risking damaging them. That fucking sucked. If I have one goal for 2021, it’s to be able to wear my new coat comfortably all through next winter. No bulging buttons or getting too hot that I need to take it off after less than 5 minutes indoors.

Final Thoughts

Thank you to everyone who has supported me over the past few months. Thank you to my wife who doesn’t complain when I suggest Wingstop every time a discussion about dinner comes up. Thank you to my parents have been supportive of my lifestyle changes and don’t pressure me to eat when I don’t want to. I know there are a lot of people out there who have differing views on fasting for weight loss, and my thoughts are with them as we all navigate this rocky journey to better health together.

If you want to chat about how your life is going, food related or not, hit me up on Twitter. My DMs are open. Talkin’ to new people online is really fun for me and I’ve been told I’m an excellent sounding board.

✌️


Photo by Dovile Ramoskaite on Unsplash

January Update Pt 2: Fasting Boogaloo

Well, here we are a week later and I have to admit I feel better. I’ve overloaded on fasting propaganda from across the internet, though primarily YouTube and Reddit.

I’ve gone back and listened to a few lectures by Dr. Jason Fung. His “The Aetiology of Obesity” series has been my sleeping playlist for a few nights now. It’s a 6 part lecture series, each lecture running about an hour, discussing theories on why humans become obese and the different factors that can contribute. Overall just interesting stuff, plus he has a pleasant voice (IMO) and he’s very easy to digest (heh).

Practically, not much has changed re: my diet compared to earlier fasting cycles. Tuesday, I broke a 44~ hour fast with a burger patty topped with a fried egg, a half pound of salad with strawberries, feta, walnuts, and a few spoonfuls of a ranch-like dressing. I followed that up with some popcorn and a few slices of bacon.

Last night I ate again, this time getting lured into a chicken bowl with cauliflower rice from Chipotle. I walked over there and back home, proceeding to pile the contents of my bowl onto some low carb tortillas I already had at home. I followed that up with the rest of the strawberries, some more popcorn, and 3-4oz of pistachios. I drank 3 cans of sparkling water with dinner and by 9pm, I felt pretty full so decided to start my fasting timer an hour early.

Now I begin another 40+ hours until dinner on Friday evening. Sleep has been pretty meh, but that’s to be expected while fasting. I was tired earlier and managed to be in bed by 11pm, which is rare for me. I woke up around 6~ this morning and got out of bed around 7:30 to get some coffee and write this post.

I have a therapy appointment this afternoon, the second with my new therapist, and I’m tentatively looking forward to it. If the weather isn’t too bad I might try and walk over there.

Overall, this week has been a step in the right direction and I’m optimistic it will continue to trend in that way.

One thing I do want is to find some more fasting support from local friends. I don’t know what we’d talk about but it feels intuitively easier to stick with something when there is accountability, even if it’s unspoken.

My dad is kinda doing IF right now with his church’s new year resolution/diet/fast. He’s had good results so far but I’m not sure how he feels about continuing it after his church finishes the fasting period. I’ll text him later today and see how things are going.

As always, feel free to tweet me @daronspence or leave a comment if you have questions.

✌️

My Experience with Intermittent Fasting

Well, as usual it’s been a while since I’ve posted something here on the blog, but some recent life events have convinced me it’s time to share what’s been going on.

The Checkup

On February 25th, 2019, I went to the doctor for a checkup for the first time in almost a decade. I’d been secretly dreading the appointment because I knew that he was going to say some things I did not want to hear. Stepping on the scale it wasn’t really a surprise to hear him say I weighed 310 pounds. I was honestly expecting it to be a bit higher. Next, came my blood pressure readings, my resting heart rate, and a plethora of other measurements. By the end of the exam I felt worse than the week before when I had an upper respiratory infection.

We went back to his office from the exam room and discussed some more specifics. I was so unhealthy, I was/am practically a walking heart attack at 24 years old (the results of my blood work taken that day later confirmed that). I was devastated inside. I didn’t know what else to say other than, “Ok.”

Near the end of our time together that day, the doctor gave me some tips. He suggested looking into intermittent fasting; something my wife’s doctor had recommended to her to help her reach her goal of losing a few pounds. That sparked a small bit of hope inside of me. Even if I had to change my eating habits, at least I could share the schedule with my wife. While I was sort of correct in this assumption, I was also not expecting what happened next.

Research Phase

When I got home (after grabbing some Korean fried chicken from Bonchon), I started doing what any good millennial would do; research on the internet. I started on Reddit since I remembered seeing a /r/fasting sub, but that quickly led to /r/intermittentfasting where I was assaulted by pictures of people who looked a lot like me slimming down in record times. I was honestly skeptical but willing to try it.

I found my way to the Zero fasting app and jumped right in with an 18:6 fast (eighteen hours fasting, six hours eating). My normal schedule was already skipping breakfast most days and eating a late lunch. I figured a 2PM lunch would force me to eat my next meal with my wife after she got home for work around 6 or 7PM each night.

Over the next two days, I continued the routine. My diet was probably still sub-optimal. On my doctor’s advice, I was cutting out a lot of carbohydrates as well. Instead of fries with my chicken wings, I got coleslaw instead. By day 3 I noticed I was pretty much fasting for 20 hours a day from dinner the night before to the time my wife got home, so I decided to bump up my fasts to 20:4. Why not take advantage of the extra fat burning time?

This was where I began really diving into more information about intermittent fasting, especially around people who are seriously overweight. I soon discovered Dr. Fung, a kidney specialist who focuses on patients with complications from type 2 diabetes. I won’t go into too much detail here but I do recommend you browse through his YouTube channel if you’re interested in more.

Unlike other “celebrity” doctors, Fung has very few uploaded videos of his own, which indicated to me that he wasn’t creating content for the money. He does however, frequently appear on other YouTube channels and radio shows discussing his ideas and findings. I especially recommend his series titled “The Aetiology of Obesity”, a six part series that appears to be a collection of lectures he gave to other doctors. It’s a big commitment to watch, but the information really eased some of my fears and quashed some common misconceptions around fasting.

The crux of his research and testing has basically boiled down to that fact that type 2 diabetes and many of it’s complications can be solved simply by fasting. Simply restricting the intake of calories (liquid or solid) tells your body to enter into fat-burning mode once all the glycogen (sugar, basically) is used up from your previous “meal”. I use quotes because sugary juices and sodas aren’t viewed any differently by your cells when it comes to absorbing nutrients.

Learning all of this really got me thinking. After a couple of weeks, I got the nerve to try a 24 hour fast (or one meal a day) for the first time, despite basically I having achieved that milestone a few times already. Some of my 20 hour fasting days had only comprised one meal, but I was afraid to start my next fast early in case I felt that I really needed a banana or small snack before bedtime. 24 hours was a piece of cake. I felt so good, I decided to try it again on the day leading up to my next doctor’s appointment. That would be my first return since starting this experiment with intermittent fasting.

The Checkup, Pt. 2

In the days leading up to my appointment, I was nervous. During these few weeks, I had purposefully stayed away from the scale so as to not get discouraged by fluctuations of water weight from day to day. Reddit comments always hammered that on posts from people seeing little progress after only a few days of intermittent fasting.

Arriving at the doctor’s office, I walked into the exam room and he ushered me to the scale. I could feel my heart pounding and wondered if it would affect my resting heart rate results later. The doctor plopped the largest weight over to the 300 mark, where it had been from my previous visit, and immediately it fell to the right; too heavy! Success! I had at least dropped 10 pounds in 24 days. The doctor gave a small smirk, seemingly surprised and pleased. He kept adjusting the weights and my eyes kept getting wider and my heart kept pounding faster.

When he was finally finished, the scale reported 289. I had lost 21 pounds in 24 days. Nearly a pound a day on a diet of chicken wings, beans, brown rice, chicken thighs, fish, and a cheat meal of Domino’s pizza while babysitting. I was absolutely ecstatic. I should also mention that I didn’t exercise at all, only doing my normal routine.

The doctor finished taking some other measurements, noting that my heart rate and blood pressure had gone down significantly since my last visit. I honestly think he was probably a bit surprised as well. I’m sure it must be nice to have your patients listen to your advice once in a while.

Back in his office, we discussed the results of my blood work taken from the previous visit. 3 weeks prior, I technically met the definition of a type 2 diabetic. My cholesterol was also very high, a side effect I later learned was due to inflammation caused by my body’s resistance to insulin. I was dreading the news that I would need to start on some sort of diabetes medication, but because of my results that day, the doctor said he was not going to prescribe them yet, dependent on my continued improvement.

I left his office that day with a prescription for some cholesterol controlling medication and a recommendation to work my way up to 4000mg of fish oil tablets per day; a common suggestion for individuals with high cholesterol levels. I was a bit disappointed, but I was also hopeful that I may be able to wean myself off of this stuff with continued results.

Following my appointment, I was now more determined than ever to see things through. I now had the validation that what I had been doing was working. I also had more confidence in myself and my ability to control my cravings and impulses.

Peer Pressure & Progress

Shortly before my second appointment, I discovered the LIFE Intermittent Fasting app. I was initially drawn to it after seeing the progress bar in the app, showing progress points within each fast of when your body has started reacting in a new way.

Upon downloading the app, I also learned of it’s built in social features; encouraging you to connect with other people who are fasting and share your progress throughout your fasting period. I quickly got my wife and a coworker on board and watching each of our progress bars advance was a great motivator when I was feeling hungry before my it was time to eat again. Reading stories on /r/intermittentfasting was also a huge motivator.

Diagram of progress chart from Life - fasting app
Look at at all of those cool progress icons!

A week or so after my second appointment, I decided to experiment with a longer fast of 48 hours. From the information I had consumed, there are a plethora of benefits from fasting more than 24 hours and I was excited to see what kind of results I could achieve and push my willpower even further. Worst comes to worst, I could back off and eat whenever, not feeling guilty at only making it 24+ hours.

The second half of my first 48 hour fast was brutal. The hunger pangs were intense when they arrived, not helped at all by my insistence to torture myself with cooking shows on YouTube. I discovered water was even more of a friend than I previously thought, filling my stomach with as much as I could when hunger reared it’s head. Eventually the rumblings would subside, usually within a half hour of drinking a lot of water and I was back to work or playing some video games to keep my mind occupied on something other than food.

At the end of the 48 hours, I was happy to eat again and proceeded to stuff my face with what was probably 3000+ calories in one meal. It’s important to note however, that my daily energy expenditure just from existing is around 3500 calories a day. So even gorging myself I was still at a deficit. I’m sure as I continue to lose weight that resting calorie burning rate will decrease, but whatever it is, I’m still far below that threshold on any normal eating day.

Feeling good about my progress, I decided to try couple more 48 hour fasts, sometimes coming up a couple hours short but not sweating it too much. 46 hours is still great and I would rather eat a nice dinner with my wife at her normal dinner time. I now have really come to internalize that intermittent fasting is about a lifestyle change that should work for you as an individual. I refuse to feel guilty breaking a fast early to socialize with friends or family, though I do admit I am now addicted to seeing the “Fast complete!” notification on my phone every night.

Every Friday I now weigh myself. I still don’t weigh daily due to water fluctuations and I know from previous diet attempts that seeing the scale bounce up and down every day isn’t good for my mental health. I figure a week is enough time to show a trend without worrying if I’m a pound or two heavier/lighter due to how much water I drank the day before.

As a side note, I’ve had a Fitbit Aria scale for a few years now and really enjoy it despite not owning an actual Fitbit anymore.

This Week in Fasting

After completing a few 48 hour fasts, I resolved myself this week to attempt a 72 hour fast. I started Sunday evening, made it through the obstacle course of snacks at my church small group meeting on Monday night, and was feeling good heading into Wednesday. I was already fantasizing about my dinner for that evening. As the time grew closer and closer though, I realized that I wasn’t really hungry. Sure, I could eat, but I had grown so used to the rumbling of my stomach and the mental feeling of hunger, that I started to wonder if I needed to eat at all? With another hour of contemplation, I decided not to break my fast, and instead continue for at least 24 more hours.

At the time of this writing, it’s now Friday. This evening I will break my fast seeing a movie at a dine-in theater with my wife after 120 hours of not eating anything and only drinking water, tea, black coffee, and a few carbonated waters (with only a small squeeze of lime for flavoring). I’ve made it 5 entire days without eating anything, all the while watching friends and family eat their meals while I gaze on, trying to keep up the conversation.

At my weigh-in this morning, I weighed 275 pounds. 35 pounds lost in 39 days. I know this kind of rapid progress won’t last forever, but I’m grateful for the results in the meantime. Overall, I feel better, more alert during the day, less tired when I should be focused, and look better to boot! I count all of that as a win.

I’m really proud to have completed a five day water fast. I’m not sure when I will do it again, but I can now picture a future where two day fasts are even more frequent. If my schedule with allow it, I would love to try an even longer extended fast in the coming months, perhaps 14, 30, or even 40 days! I realize that with extended fasting comes more variables to consider such as micro-nutrients and electrolytes, but I’m confident I can navigate those obstacles effectively.

Conclusion

If anyone is considering starting intermittent fasting, for weight loss reasons or otherwise, I would encourage you to at least give it a shot for a few weeks. You don’t need to drastically change your diet. Simply cut out all food for at least 16 hours a day and only drink water during that fasting time. For most people, this can mean an eating window of 12pm-8pm. Adjust that forward or back according to your personal schedule and needs.

If you have any questions at all, feel free to leave a comment, or reach out privately. My DMs on Twitter are open and I would love to chat about whatever you want, fasting or otherwise. If you want to join a circle with me on the LIFE app, you can click this link to be added instantly.

I look forward to meeting you soon and seeing how we all progress together!

Photo credit to Stas Knop and downloaded from Pexels.

Dealing with Depression

Somedays are better than others. Somedays just suck. Somedays are pretty good. Lately, I’ve been on the lower end of the spectrum. I’m not sure what it is, but the past few weeks have been harder than usual. The mental breakdown between productivity and laying in bed all weekend is a finer line than I would like. This might just be a little rant, but as I was reading through Reddit, I got the urge to write down some thoughts so I’m going to vent. Hello stranger! I hope your stay here is fruitful.

Maybe this all started with the celebrity suicides? I have to admit, while I did know of both Chris Cornell and Chester Bennington, I never really knew much about them. Sure, I listened to Soundgarden and Lincoln Park, but I wouldn’t describe myself as anything more than an extremely casual “fan”. Seeing the interaction though, watching how one person’s decision had such a profound effect on someone else; it’s made me think.

Last summer, my father in law killed himself. I haven’t really talked to anyone about it. Not my wife, not my mother in law. Not my own friends or family. My wife found his legs sticking out from the closet in the master bedroom one morning. I rushed over to their house outside the city and waited in the front yard as the coroner arrived and cops continued to waltz in and out of the house. As they wheeled him out in a bodybag on a stretcher, I asked to see him. Call it morbid curiosity, but at the same time, I felt almost an obligation to him. I married his daughter and she would never see him again, so maybe it was up to me to carry on that final memory, for her sake? In case she ever wanted to know?

After they took his body away, I was left at the house to keep an eye on things. A relative had paid for a hazardous waste disposal company to come by and clean up the mess he left behind. Someone had to watch them right? What do you do in that situation? I sat on the edge of the bed for a few minutes, staring into the pool of blood in the closet where he shot himself. He put towels down. Despite being dramatically intoxicated, he took the time to make it “easier” for whoever was left to clean up the mess. There was something respectable about that.

The waste disposal team finally arrived. Not what I expected at all. It was an older couple in their late fifties, with a big pickup truck pulling a plain white enclosed trailer full of cleaning supplies, power tools, and even a few sheets of sheetrock. It makes sense when you think about it. Everything with blood on it has to be cleaned or removed. They were nice people. They’d obviously been doing it a long time. It took them a few hours to comb through the clothes in the closet, remove the ones with blood, and then rip up the carpet and the subfloor after soaking the blood with cat litter. Then they were gone. I was left alone in a dark house, with an few square feet of carpet missing in the master bedroom closet.

Again, I mentioned at the beginning I wasn’t sure where this was going. I live in that house now. My wife and I moved in to help her mom with the mortgage and the bills. Sometimes it’s weird to walk past that bedroom and think about what happened; about what I saw. It’s a small thought in the back of my mind at all times. An ever present darkness. I feel like that’s a book I read somewhere…

So maybe it’s just that? You see all the shit on the news about all the terrible things that happen in our world and they remind you of your own dark thoughts. But that’s part of being human right? Knowing that all of this is temporary; that it happens to everyone. I find comfort in that I think. That someone, somewhere is struggling to find meaning in the same things that I don’t understand. Maybe that person is you.

If you want to talk, reach out to me on Twitter, or a leave a comment if I still have those enabled. I honestly can’t be bothered to check right this second. I don’t think I’m in a “dark place” right now, just a difficult one, and maybe you are too. I think I’m gonna take a trip down to the coffeeshop and try to get some work done, drink some tea, try to find something useful in my own thoughts. Let me know if you find something useful in yours.

Why WordPress 4.2.3 should have been a non-issue.

Let me preface the following post by saying this: I am sorry if your site was affected by the WP 4.2.3 update. I’m sure nobody on the core team wanted things to break and if they could go back in time and do things differently, then I think they would.

What happened?

So for the uninformed, on July 23, 2015 the WP core team released a security update that was installed to millions of websites via automatic updates. For a lot of people, this was fine and they weren’t affected by the change. However, another group of sites (some would argue a large portion) were broken due to breaking changes in the WP Shortcode API. This isn’t a post about the shortcode API or the vulnerability though. You can read about the update on the Make WP Core blog.

Why things should not have broken.

Take this section as a grain of salt, and recognize it as my opinion. You don’t have to agree, and I don’t expect everyone too. 

I have been developing on the WordPress platform for about 3 years now. I currently work for a small digital marketing agency in Northern Kansas as the sole developer creating websites for our clients. Before I started working here,  the previous developer had built a lot of sites using premium themes from Themeforest, which as we all know, usually include a bunch of shortcodes for inserting content and functionality across the site. After doing support for a few of these clients, I quickly realized that shortcodes were not a solution for displaying content for our clients. Not only were they messy and difficult for clients to understand (in some instances) but they created a dependency that I was not comfortable with on such a widespread scale. A client accidentally deactivating a plugin could remove some core pieces of content; it was something I just wasn’t comfortable with.

I started to build out themes for our clients using _S and designs from our in house designer. I jumped onto the ACF bandwagon just before the release of v5 and have been using the Pro version on all of our clients’ sites with great success (Elliot’s commitment to backwards compatibility is another post for another time). ACF allowed me to create highly customized interfaces for our clients, while utilizing an API that would work regardless of if ACF was activated or installed (check out Bill Erickson’s post about removing dependencies from ACF). Over time, I have migrated some clients over to a more customized solution when they would come to us after having difficulty manipulating shortcodes and they have loved it.

Now I know what you’re thinking, “But Daron, using ACF ties you to a theme and that’s bad if you’re a blogger who likes flexibility!” And you’re right. Tethering some clients to a specific theme just isn’t an option, but that isn’t an excuse to build solutions that are fundamentally flawed. One of the use cases that really blew my mind, was how people were outputting and manipulating URLs via shortcode. A much better approach would have been to use custom fields and post meta and then calling that data from the theme. Another alternative would be to build a custom plugin with a simple admin interface and some custom metaboxes.

In the Make WP post, Andrew mentioned how people were using the shortcode API in ways that it was never intended for. You don’t need to look any further than the default [gallery] shortcode to see what the core team was talking about. The gallery shortcode is completely self contained. It outputs it’s own HTML and any attributes needed to attach styling to. If you’re building shortcodes to output a link to an image or to a URL, then you’re fundamentally using shortcodes in the wrong way. Using actions and filters, you can display all sorts of things in and around the_content. If you need to link a background image, you should be using the customizer or a custom field/metabox. For one, using a custom metabox is a vastly superior UX as well as giving you the peace of mind that sites won’t break because of a fundamentally flawed implementation. The shortcode codex entry does not mention using shortcodes as a replacement for HTML attributes and it probably never will. If you’re site needs to be that customizable, you should be using custom fields and metaboxes.

If you want to remove the theme dependency from solutions like ACF and CMB2, use a hook and display that data programatically. This is a totally valid way to show custom content:

<?php
add_filter( 'the_content', function( $content ){
$extra_content = get_post_meta( 'extra_content', $post->ID );
if ( ! empty($extra_content ) )
return $content . $extra_content ;
else
return $content;
}, 10, 1 );

Just pop that into a plugin file and you’re off to the races. If you need more programatic control over where content is displayed, then you should look into developing a custom theme or using a more inclusive shortcode. Note, the $extra_content variable should include all of the HTML necessary to support itself. You can enqueue CSS as needed from the plugin as well.

Here is another example that was specifically mentioned in the Make WP article and a workaround that doesn’t require hacking a theme.

<?php
add_filter( 'the_content', function( $content ){
// Just pretend you have a custom metabox that saves the ID for you.
$image_id = get_post_meta( 'custom_image', $post->ID );
$image_src = ''; // instantiate variable
if ( !empty( $image_id ) ){
$image_src = wp_get_attachment_image_src( $image_id, 'large');
}
if ( !empty( $image_src ) ){
return "<div class='has-bg-image' style='background-image: url(\" {$image_src} \" );'>" . $content . "</div>";
}
// fallback for if there is no image
return $content;
}, 10, 1 );

Using the above snippet, you can wrap the_content in a div and apply a background image to that div. Using CSS you can further position the image how you want. You can even include that CSS in the same plugin, thus removing any theme dependency.

In closing

We as developers are responsible for when things break and it’s only in our best interest to use the tools that we are given to build applications and solutions that will stand the test of time. Hacking APIs is never a good solution to a problem and it’s up to us to use some common sense and read the documentation on the intended uses of the software that we leverage everyday. Sure, people will always find new ways to use software that the developers never intentioned, however, you do not have the right to be upset when you’ve implemented an unofficial workaround for a problem that is easily solved by utilizing other techniques and APIs. The core team did everything they could to avoid breaking things. Problem is, it’s impossibly to foresee every possible unofficial use-case for every API in the software. Stop giving them flack for your experimental implementations of the API.

I know this probably seems like a disorganized rant, and in some ways, it probably is, but I needed to get it out there and off of my mind. Leave a comment if you want to continue the discussion or you can tweet me @Daronspence

An Ode to More Blogging & WordPress 4.2

Like a lot of other folks in the community, I think the new year (ha! It’s April!) is a great time to make new goals in how we approach our daily lives. So in the spirit of the community, I’m going to try and blog more this year. I’m gonna shoot for a minimum of once a week, though I would like to make it 3+ times a week.

If you happen to be reading this, tweet me some encouragement! I would love to hear it 🙂

As a side note, I’m going to start running the WordPress beta plugin on this site. Should be exciting!