Ecolink Door Sensor Z-Wave Shenanigans

Problem: Door Sensor won’t connect to Z-Wave Network

Model: DWZWAVE2.5-ECO

At our office, we have a small Z-Wave network setup running a Raspberry Pi and Home Assistant, specifically Hassbian because at the time of our purchase the newest Pi 3B+ was not supported for Hass.io.

On the Z-Wave network we have a single door sensor on the front door that theoretically notifies us when someone enters the office. Long story short, we had it setup remotely and after 3 days of shipping via USPS, it didn’t work at the physical office. Bummer!

Now, a few months later, I’m here to troubleshoot in person while in town helping out with other things. I set the thing up in the first place so it shouldn’t be too hard to fix right? Wrong again!

The EcoLink Door Sensor seems to be a decent product. It has pretty good range; ours is located about 30 feet away from the controller. The controller is inside a giant metal server rack and behind a solid wall. Not the best conditions for sure! The manual however is complete and total garbage. Below you will find the steps to completely remove the device and re-add it to your network.

Reset the Device

To properly “reset” the device you must first determine if it’s currently connected. In my case, the sensor actually thought it was still connected to something. Placing a magnet against it would cause the green LED to give one long flash. In this case here’s how you fix it.

  1. Check that your battery is not dead. If the sensor has been unconnected from a Z-Wave network for a while, it’s likely tried to pair itself continuously and drained the battery.
  2. Navigate to your Z-Wave controller software and initiate a node removal. In Home Assistant, there is a button called “Remove Node”. Press it.
  3. Remove the cover and battery from the device for 5-8 seconds. Do not wait too long though or the node removal will time out. Within 20 seconds of initiating the node removal should be fine.
  4. Plug the battery back in with the cover removed. The LED should flash continuously if it was successfully removed. (Note: these steps will remove the device from any Z-Wave network it was previously connected to)
  5. Click the “Add Node” button on your Z-Wave control software while the LED is blinking.
  6. Remove the battery for 5-8 seconds and then replace the battery. The LED blinking pattern should change and stop soon after pairing.

At this point, you should see confirmation of the added node in your controller software. To complete the process, run a network heal to make sure everything is communicating efficiently.

Now you should be able to monitor the state of your sensor in Home Assistant.

If you have any questions, leave a comment or shoot me a tweet @DaronSpence

What the Funk

Life is full of change. Sometimes this change can be great! Getting married, having a kid, going on a nice vacation; all great things. Sometimes those changes suck. Sometimes they cause a little bit of funk.

I was browsing Twitter and came across this tweet from an independent film maker I follow. In an effort to make myself more transparent, I’m going to write about some of the funk in my life. Everybody has funky days and I think it’s a good exercise to put some things out on the table every once in a while and lean on your friends and colleagues for support.

Below you’ll find a few outlines of how I feel in various parts of my life. I hope they help you as much as writing this will hopefully help me.

Work

My boss doesn’t read my personal blog (if he does, hi Blade!) but even if he did I would still write this stuff.

I’ve personally felt very unchallenged lately. I’ve had talks with my boss about this since we’re a small company and a few weeks ago I honestly didn’t know what to say. I hadn’t thought about it. Now that I’ve given it some thought, one of my biggest disappointments is the lack of variety in my work. Over the past 4 years, while things have only gotten better across the board in terms of pay, project timelines, and workflows; my personal drive for new and exciting doesn’t always line up with the projects on the whiteboard.

Part of this is business oriented. I work for a marketing agency. We build mostly marketing websites. They all follow a similar formula and I think it’s a good thing that they do. It doesn’t make sense to buy a McLaren racecar when the requirements for your daily transportation include a 7 mile commute on 45mph roads in suburban Kansas. Making things more complicated for the sake of complexity to appease my mental boredom is obviously a bad idea.

I would love to build something more complex than marketing sites. However, that responsibility comes with huge risks for my employer and colleagues. Failing a 6 month experimental development project would cost my employer tens of thousands of dollars in salaries as well as the lost revenue from a failed project of that size. We don’t run a VC backed venture. Failure to deliver on that kind of project would be a disaster for all parties involved. Not to mention that our team is currently made up of people who specialize in marketing. Creating bespoke software comes with its own challenges that don’t necessarily make sense when you don’t have cash to burn on the inevitable mistakes.

Part of me thinks that the only solution is to move on, but at this moment I can’t decide if that’s the best course of action. This is one area that definitely needs more thought in the future.

Home

I feel like this is one area I do okay in, where sometimes it seems like others have a harder time. My relationship with my wife is healthy. She’s very adamant about what she wants and that lends itself to good communication. We’ve been happily married for just over 4 years now. The issues mainly stem from things that we’re both not good at.

My apartment is not as clean as I would like. My wife and I both recognize this as a flaw that we share. Dishes piling up for a few days is not uncommon, floors that need to be swept, a load of unfinished laundry, etc. By no means are we living in a hoarders style situation of trash up to the ceiling or toilets that look like they came from an abandoned horror house movie set. Just a little dirtier than we’re both comfortable with paired with some sort of crippling aversion to permanently changing our habits. Often we’ll clean and be really happy with the results only to find that by the next week we’ve neglected to stick with the plan to our own disillusionment.

Part of “home” for me includes personal finances, which are a tough subject for some. I honestly don’t have any issues talking about them in public. If you want more insight feel free to send me a message. Out of respect for my employer, I won’t list them in this post. I’m happy to offer advice or just talk through any numbers with you personally.

Financially, we’re in a decent place for a pair of millennials. We have enough money to pay our bills but that’s pretty much it. My wife and I have over $70,000 in debt, the vast majority of that being student loans. She has a degree in engineering so I’m not terribly worried that we’ll pay it off, but for the next 2-3 years we’re throwing every extra dollar at it.

This kind of penny pinching causes a lot of stress about stupid things. One example is that we’ve been living in apartments for a while now. On paper, we make plenty of money to be able to afford a house, but to responsibly own a house, we would need to spend a lot more of our budget setting money aside for when things inevitably go bad. We live in Texas and when the air conditioner breaks, it’s a literal emergency. Hell, this months electric bill is shaping up to be $200 for a 900 square foot apartment where the unit can’t even keep the temperature under 80 in this extreme heat.

Currently paying rent is cheaper, but that comes with all of the little things that add up when you rent. Plus, it would add years to our plan to pay off our debt. Surprisingly, the impulse to buy big things that all of our friends have (houses, new cars, etc) is one area we both stick to without it feeling like pulling teeth.

Physical Health

An area that is more personal is my physical health. If you’re reading this and have never met me, you wouldn’t know that I’m overweight. Europeans would label me as grossly obese but I’m just normal obese to Americans and that’s plenty to make me feel terrible without adding anyone else’s opinion.

What really frustrates me is that I know it’s a problem. I know what I’m eating isn’t healthy. I vividly remember what it was like to be able to run for a couple of hours at soccer practice and not die and I yearn for that freedom when I think about it. Some days I really want to go out and do something physical, but then after literally two minutes my brain does a 180 and I start to loathe the thought of even stepping outside.

I’ve had asthma since I was a young child. Since I’ve become an adult, I’ve used it as an excuse to not work out. While I can’t run safely for more than a few minutes, I’m more than capable of walking as far as I want. I even have an air conditioned gym in my apartment building that seems to be empty whenever I peak inside. There’s nobody there to judge me.

Diet is much the same. When I go to the grocery store, often what I buy is pretty healthy. Since we’re on a budget, the grocery list often includes things like bulk rice and 3-5 pounds of chicken, which is prepared with some vegetables if I’m not too lazy or flavored with a bullion cube. I don’t drink except on rare occasions, and it’s usually in a social setting, so I save a few bucks there!

Then the depression hits.

For no fucking reason other than to screw with itself, my brain decides today isn’t the day to feel good. Probably because I hate healthy the day before. So what do I do the make myself feel better? Double cheeseburger and fries with a large Dr. Pepper please! By that point I’ve already given up on the day being productive and the rest of my meals follow a similar arc. Also, most of the budget for weekly meals was spent at the grocery store, so now I’m dipping into my limited “fun money” allowance to buy food. Now you start to see how this all intertwines.

It’s a self fulfilling prophecy on the worst kind of “positive” feedback loop. Eat shitty, feel shitty, which makes me want to eat shitty so I feel better just long enough to go to sleep where I don’t have to feel shitty until tomorrow. I’m fairly certain I have a caffeine addiction with killer headaches to halt all work until I get a fix. I’m a drug addict, except my drugs are unhealthy food instead of heroin. At least with heroin I might lose a few pounds!

When I write those words, I don’t feel good. I don’t want to be addicted to anything except something cheesy and nice like loving my family. But no matter how many times I try to change it, I fall off the wagon and I’m never sure how to get back on it.

Mental Health

I’ve alluded to it throughout this post. It’s kind of the point of my writing thus far. All of the things I’ve mentioned negatively affect my mental health. There are others things I didn’t mention that don’t have negative effects but this post isn’t about my dog (she’s the best).

Sometimes I just feel shitty. Sometimes I wake up and don’t want to get out of bed. It’s a struggle to move sometimes. Walking to the mailbox feels like pulling teeth. Things that normal people supposedly don’t have issues with.

To be perfectly honest with you, I don’t know if this is normal, because our culture is one such that things of this nature are never discussed. Especially among men. We’re conditioned by society to always “be a man” and to be tough and face all your problems head on. Obviously it doesn’t work like that for everyone. Instead some turn to drugs or alcohol. Some turn to Facebook and Twitter to get away. Some of us turn to food, even if we don’t need it.

Still, I’m not convinced that even if everything I’ve described changed tomorrow, that I would feel any different. Something still tells me that life is always gonna be a little shitty; that you’ll always have a little bit of funk.

The truth is that people are imperfect. Nothing we do will ever be good enough for everyone, and at a certain level we all crave the acceptance of others (obviously some people more than others). I’m having to learn to be okay with who I am as well as start the change to influence parts of myself to change to something I can be okay with.

On a more serious note, I’ve now known two people that were hugely influential in my life that I’ve lost to suicide. While I obviously can’t know exactly what they were thinking, a part of me really wishes I could have done something to help. Every day I spend in depression is another day spent contemplating those tragedies and my role within them, with more thoughts wondering how people would feel if I was the subject of similar tales of terrible news. (Note: I don’t want to kill myself, I promise)

We all have those thoughts though, even if only for a second. Even if we know we won’t ever act on them. I can’t tell you the number of times I’ve contemplated what would happen if I swerved into a concrete median on the highway. A Reddit thread from a while back included thousands of people with that exact same thought. It’s human nature to be curious of our own mortality. Some days it just seems harder to ignore those thoughts and focus on the life right in front of you.

Hopefully, this post is a step in the right direction. Maybe it will be the friendly nudge to myself to get my act together. To metaphorically clean my room (and a smidge literal as well). There are so many things that I want to do differently that prioritizing them all at once seems impossible. Just writing this sentence is making me anxious.

Paying it Forward

Despite all the self loathing in this now almost 2,000 word article, I have had some help in the past. My wife has always been incredibly supportive of my healthier habits and leaders in my church have helped walk with me through difficult times in my personal life. Now I want to pay that forward.

If you need to talk to anyone about a shitty situation or just want someone to vent to, I’m here to listen. I am 100% serious. If you want someone to help hold you accountable with your personal goals, I’ll be there to encourage you.

If you want to talk about your day at work or anything under the sun, reach out on Twitter, @DaronSpence, or send me a message here on my personal site and we can start an email conversation. Whatever makes you the most comfortable. You can talk as broadly or a specific as you like. It can be totally anonymous if you want. A throwaway email account only takes a minute to setup.

Everyone deserves someone to talk to. Personally, I could use someone to talk to as well. So do us both a favor and let’s chat. I look forward to hearing from you soon.

DIY Motion Sensor with Raspberry Pi Zero W and MQTT

I’ve been really getting in to Home Automation lately. I don’t own a home, but there is a surprisingly large pool of things you can implement when living in an apartment. Most recently I’ve been playing with automating lights, starting first with the humble bathroom! I’m one of those people who needs a light to use the bathroom. Even if it’s the middle of the day, the sun is shining, I have to turn on a light. This has been an experiment to relieve my brain of that pressure, as well as make any late night excursions a little more pleasant.

This whole project can be done for around $20 to just make the sensor. For a DIY approach, it’s not bad! The nice thing is that it’s also a great platform to add more sensors too down the line for a small investment.

Things you’ll need

  • Raspberry Pi Zero W (RPiZW for short)
  • 8GB+ Class 10+ Micro SD Card
  • PIR Motion Sensor with headers
  • A few jumper wires (or loose wire to solder)

I decided to start with the hardware as this made the most sense. I picked up a RPiZW from my local Micro Center for $13 with header pins. I’m still relatively new to soldering, so it didn’t make sense to purchase the headers separately if I might screw it up. The price of headers with a bare computer also happened to be slightly more expensive. Win win for me! I also grabbed a cheap plastic case for around $5.

The next thing I needed was the motion sensor. I also picked this up from Micro Center, but at what I later found out was a steep premium. A 3 pack of these sensors can be found on Amazon for $5, whereas I paid $6 for one. If you want your homemade sensor to be multi-functional, a temperature/humidity sensor is a great addition for just a few more dollars.

Follow the directions to hook up your sensor to the Pi. In my case, the PIR needed 5V, a ground, and a data pin. I used GPIO 14, but feel free to use any open GPIO if you are adding this to an existing board. Using some extra female to female jumper wires I had laying around, it took all of 30 seconds to hook everything up. Now onto the software.

I used Etcher to mount Raspbian Stretch to the SD card. While I have the hardware necessary to setup the Pi using the GUI, it didn’t make sense considering I will likely never need to use it again, except to tweak a few values in a script file occasionally.  I followed a setup guide for installing the OS headless, got it connected to my network and SSH’d in. Once logged in, I needed to install pip using the apt package manager then I needed to install paho-mqttusing the newly installed Python package manager. I did run into an issue here with the library being detected, so I recommend doing a reboot just to refresh everything. Since the computer is basically empty, it takes maybe 30 seconds even on the low spec hardware.

After that, I adapted a simple Python script I found online to access the GPIO pins, and constantly read the data for the motion sensor. When the pin is pulled high (1 in my case), then motion has been detected. Whenever motion is detected, I fire off a very simple MQTT event using paho.mqtt.publish. While it’s technically not the most efficient way to send  data, it is much easier to read and the bathroom is such a low traffic area, the extra overhead to connect to the MQTT broker is not an issue. If you are potentially sending constant updates for temperature and humidity, it may be worth looking into the client method in paho.

To run the script on startup, I added a cron task on @reboot to start the Python script. I’m not an expert on the Linux startup processes enough to know when the network kicks in, so at the top of my Python script, it sleeps for a minute while the computer finishes booting and connects to my network. So far, this has worked fine and should continue to work even in the case of an ISP failure, since the Pi is connecting a MQTT broker on my local network.

With that working, I subscribe to the MQTT topic from within my Home Automation software, OpenHAB at the moment, and then everything else is connected there. For my own purposes I have a few simple rules. The bathroom light is controlled with wireless smart bulbs (IKEA Tradfri). Upon entering the bathroom, motion triggers the light to turn on. From there a timer starts for 2 minutes. If motion is sensed before that timer expires, it is reset back to 2 full minutes. This is fine for most bathroom tasks. Brushing your teeth or hair are very animated tasks that constantly trigger the sensor, which is positioned in the corner of the vanity, facing the door and whoever is standing in front of the sink. For other more, private rituals, two minutes can be a little too short if you like to read Reddit on your phone. Luckily a quick swipe of the arm or shake of the head will trigger the sensor again and turn on the lights.

For showering, I placed an IKEA Tradfri remote near the shower that can be used to manually turn on the light so poking an arm out is not required every few minutes. Upon exiting the shower, motion is sensed and the 2 minute timer is started. Unfortunately, there is no way to re-purpose the Tradfri remotes yet for custom events, otherwise I would have it be a manual override at all times. This way, one could press the button before getting in the shower and then press it again after they are done. Or perhaps manually overriding the timer for 45 minutes instead of 2. Plenty of time for a long shower or bath.

At Midnight, the bathroom light automatically changes to a very dim, but solid red. This is to help preserve night vision for those late night trips to the loo. At 6AM, the lights are changed back to a bright white, the preferred color of my wife and I for our lights.

Since it’s just the two of us, the 2 minute timer is fine to deal with. We’ve had it running successfully for 3 days now and haven’t minded the occasional shut-off. If anything it’s a reminder to hurry up since we only have one bathroom in our apartment! When guests come over, I plan to change the timer to a much more generous amount, most likely 10-15 minutes. I also plan to have the manually override ironed out by then.

In the future I may add a temp/humidity sensor to effect the timer, since even a moderately warm shower will raise the overall humidity in the bathroom. Adapting the script to read an extra GPIO pin or two should be straightforward as well.

Below is a short demo I recorded the night I got everything working. Over time I hope to add the script as well as some more in depth assembly photos. If that’s something that interests you, leave a comment or tweet me @DaronSpence and I’d love to hear your thoughts. I’m also happen to answer any questions about my setup.

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.

Converting a WordPress Plugin Store to HTTPS

A few weeks ago, I was experimenting with https:// on the site for my plugin, ACF Widgets. I added the SSL cert for my domain using Let’s Encrypt and the requests were being handled fine, but I was only enforcing SSL on the checkout page. If you hit the ACF Widgets site with https:// initially, everything worked fine, but my login rules were causing some issues with people logging in to the support forums.

After 4 or 5 people contacted me through other channels telling me they couldn’t log in to get support, I decided to look into it a little more closely. As it turns out, the login pages were trying to work over SSL while people were trying to login with insecure http:// POST requests. Whoops!

To fix this problem, I needed to convert the whole site to use https:// all of the time. This too worked out fine and wasn’t an issue. 3 lines in .htaccess that you can find on a million different blogs. Super easy stuff. What made things more difficult, was upgrading the URL for my plugin to check and receive automatic updates.

The problem with copying .htaccess rules

I think this goes back to a fundamental flaw with humans, in that we want results and we want them immediately. In 99% of the tutorials I found, most of them advocated for an .htaccess rule that looks something like this:

Generally, this will work, and it’s fine. Let’s go through it line by line.

  1. Turn the Rewrite Engine on. This tells apache that we’re going to do a rewrite so it can load the required modules.
  2. Set a condition. In this case, return true if the server is listening on port 80. (The standard port for HTTP)
  3. Redirect the request to the given URL and pass in the URL query parameters.

Like I said, for most sites this works fine. However, when I pushed the next update to my plugin, I noticed I wasn’t getting any update notices. Why wasn’t it working?!

Now, in my most recent plugin update, I updated the store URL to my new https:// domain, so after everyone updated, I know whatever weird issue going on would probably go away. I did some tests and sure enough, requesting the update using the https:// store URL triggered an update. So why wasn’t it working with the http:// URL? What was happening during the redirect that broke things?

Since I have almost 500 customers, sending an email asking everyone to manually re-install this new version of my plugin was unacceptable. I knew I could do better. I decided to dig-in to the inner workings of APACHE and HTTP a little bit to understand what was going on behind the scenes.

A brief history of redirects in HTTP

So from my understanding of reading numerous blogs, is that the original intent of the HTTP/1.1 spec, was that if no redirect status code was specified (ie. 301, 302, etc) that the client was supposed to treat it as the same method as the original request. So if I send a POST request to /my-api-endpoint/ , the client should honor that POST request and it’s data if I do not specify a status code. In APACHE’s mod_rewrite this looks like:

RewriteRule ^(.*)$ https://example.com/$1 [R]

Using the [R] flag with no options.

Somewhere along the way (I’ve seen both IE and Netscape blamed) browsers and HTTP clients in popular languages begin to interpret any missing status code as a 302. In the HTTP spec, a 302 request is for GET requests only. Herein lies the problem with our updates.

EDD Software Licensing Update Process

To understand why updates are failing, I also needed to examine the source code for the update script I was using. At the time of this writing, ACF Widgets is build upon Easy Digital Downloads and the Software Licensing Add-On. It works great! Though in my case, updating the store to https:// was obviously causing issues. Digging in to the code, we find this:

And herein lies our problem. EDD SL uses wp_remote_post() to send API requests to the URL of our plugin store, which is fine, nothing wrong with that. However, when our POST request to our EDD store encounters a redirect without a specified status code, cURL redirects to a GET request for the homepage with no query parameters. Since that’s obviously not what we want, the EDD SL update script fails silently (like it should) so we don’t clutter the users dashboard with errors in case our store is down for any reason. In our case though, we want to preserve that POST request and any data we send. So how do we do that?

Enter the Magical Hero Extraordinaire Status Code™, 307

According to HTTP Status Code Spec, a 307 code should behave thusly:

The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

Perfect! That’s exactly what we want! In short, this will preserve our POST request and any data we send. So now we can use this in conjunction with a normal 301 request to route all of our traffic through our newly secured domain.

So line by line, let’s go through this new .htaccess.

  1. Turn on Rewrite Engine
  2. Check for a request on port 80
  3. Check for the GET request method
  4. Redirect (via a 301 for SEO purposes) and ignore all other rewrite rules ([L] flag).

Now if we don’t have a GET request (maybe we have an API that uses PUT, POST, or DELETE) it will get routed through the second rule.

  1. Check for a request on port 80.
  2. Perform a 307 redirect, thus preserving our request method and data. Also, ignore any more rewrite rules ([L] flag).

Now for those of you worried about SEO, don’t worry. Google only cares about your visible stuff, AKA GET requests. You shouldn’t get a penalty for other request types (because Google won’t even know to access them).

As you can see, 307 redirects can be extremely powerful. With the correct caching headers, you can even instruct clients to cache the results while you update your API or tools to use your new secured endpoints, without sacrificing security.

So what next?

Since we now have a our store properly configured to redirect requests from plugins out in the wild, there isn’t anything else to do except wait. Customers will update the plugin to the new version which uses the new https:// store endpoint. If you have detailed stats about version usage for your plugin, you could eventually remove the redirect, though I don’t see a reason to for the vast majority of plugin stores out there. If anything, it’s a good catch all for anything you may add in the future and forget about.

Questions? Comments? Leave ’em down below. I would love to hear from you!

Modifying Custom Taxonomy Forms in WordPress

Today, I was working on a client project and needed to add a little snippet underneath a hierarchical taxonomy form that was registered on a custom post type. Unfortunately, after spending about ten minutes digging through core and googling, I couldn’t find an action hook to use. Luckily, after tracing the output a little further back, I found what I was looking for.

Continue reading “Modifying Custom Taxonomy Forms in WordPress”

Publishing A WordPress Plugin without SVN, Utilizing Ship

So just this past week, I submitted my first plugin to the WordPress.org plugin repository. Needless to say, it was an exciting (yet dull) experience! Since I’m still fairly green to professional development as a whole, there were some aspects of the .org publishing process that were confusing, so I’m writing this post in hopes that someone will find it useful. 🙂
Continue reading “Publishing A WordPress Plugin without SVN, Utilizing Ship”

Adding a custom style button in the WordPress post editor

So my title is a little misleading as what we’re creating is largely based on what your definition of a button. However, the point still stands 🙂

Here is an example of what we’ll be creating today.

Screen Shot 2015-09-21 at 5.01.02 PM
Continue reading “Adding a custom style button in the WordPress post editor”

Crafting Personalized HTML E-Mails with wpMandrill

Recently, I’ve been working on a new little side project called ToDo, a small SPA that allows you to create and manage a ToDo list. It utilizes the new WordPress JSON REST API and it’s awesome. You should definitely check it out!

Edit: ToDo in its current form has unfortunately been “closed”. While you may still find something at the link, I’m not doing anything with it, and will be replacing it with something new, hopefully, in the very near future.
Continue reading “Crafting Personalized HTML E-Mails with wpMandrill”