COVID-19 Calculator

DIY WordPress Plugin Tutorial – COVID-19 Isolation and Quarantine Calculator

Getting Started

Hey there! If you’re just stopping by, check out my previous WordPress plugin tutorial to see the base of this code that dates back YEARS. It’s so simple, but it’s a really awesome base that I encourage you to snag, slice, and dice as you see fit! (Full code available on GitHub at link after article.) Disclaimer: During the day, I’m a population health planner, health equity hero, and data nerd. I am not a doctor, and this is not medical advice – consult your primary care physician for that. This is just a project that someone asked me to try, so I thought I would document the process. All my own personal opinions, not representative of any agency or organization. Also, COVID-19 is really taxing our public health folks, so please take a moment to reach out to your local health department with a few words of encouragement. Many of us have been working tirelessly since February/March to protect our communities, and a few kind words goes a long way. ? Now, let’s get started!

Define WordPress Plugin Header Fields

Defining WordPress plugin header fields becomes super easy after two or three plugins. I often re-use my old code, and update it each time I’m deploying a new plugin header.

Create WordPress Plugin Options

Creating WordPress plugin options in the WordPress admin dashboard is actually way easier than you’d think – especially with tools like http://wpsettingsapi.jeroensormani.com/ that make it sooo super easy to generate WordPress options using the new-ish API. Change a few standardized variables, add a dashicon, and toss in a text area (we love the ability to customize plugin output), and you’re ready to roll on the admin side.

Create WordPress Plugin Function

This is where the ? magic happens haha. When I set out to make this project, I really thought it would be much more complex. Instead, I chose to make something simple that could be easily deployed, didn’t depend on any external libraries, and worked well on all devices – especially mobile phones. So yes, I chose PHP over js – sorry fanboys. ? This choice made it extremely easy to append dates with additional days, and allowed me to process the values using a simple form – totes easy. ?

Create WordPress Plugin Shortcode

Ok, I am someone who never ceases to be amazed when it comes to shortcodes. I love having TOTAL control over where my plugins deploy and where they can be active. Making the short code is just the icing on the cake. ?

Download the Final Plugin

That’s pretty much it. ? I continue to be a huge advocate on two fronts: re-use your old code (economies of scale and such), and don’t make things more complicated than they need to be. Right now, the world is spinning ever faster, and we need solutions NOW. I’d love to remake this in javascript with Tailwind or another smooth library, but people need this today. Just my thoughts. Please feel free to slice and dice my code – I’m a marketing nerd and health equity warrior by trade, not a developer, so I always appreciate ideas to improve my code. Thanks for stopping by! https://github.com/heyjohncorbin/iqcalc

Author

Marketing, SEO, + Web Development Based in Deep Creek Lake, Maryland, Morgantown, West Virginia, Pittsburgh, Pennsylvania, and Washington DC

Leave a Reply

Your email address will not be published. Required fields are marked *