startups and code

WordPress Plugin Upgrade

← Back to home

[CodeMonkey Blackboard]A few months ago, I wrote a blog about [WordPress Workflow](https://www.startupsandcode.com/posts/process. After doing that I learned some valuable information,

  • I don't always know what I'm doing
  • I can figure out a solution relatively quickly
  • I get better every time I do it

Creating a plugin was a very exciting thing for me, I learned a lot and realized I am not an expert, but I can accomplish the goal.  You need to consider a lot when you do it.

  • Code Structure
  • Asset management
  • Localization
  • What is it going to do?! :-)

Well, I handled some of it, my code structure could be refactored.  This time I created a new version of the plugin to make uploading an image easier and to fix a script error that could occur on a the admin dashboard.  Writing the code to do this was relatively easy, but figuring out my workflow to do it was much more challenging.

I strive to be efficient in everything I do.  Note the word: "strive", it does NOT mean I accomplish that goal.  For this update, I have my subversion (source control) repository from WordPress, I needed to create a new tag for the new version... but I should tag the existing version first.  Oh wait, I need to update the readme file too, oh and the header to match that, and make sure I tag the right stable tag in the comment, oh, and I need to....  Well, as you can see it is not as easy as right-click commit in tortoise svn and move on...

SO, I learned something... Here is an easier process for upgrading your plugin.

  1. If you haven't already, tag your current version with the correct version number
  2. Update your readme file (upgrade, description, upgrade notes, screenshot names)
  3. Update your header in your plugin to match the write code [php]/* Plugin Name: LotekMedia Custom Login Plugin URI: https://github.com/lotekmedia/WP/tree/master/Custom_Login Description: This is a plugin to customize your login page Version: 1.1.0 Author: John Mann [/php]4. Update your screenshots
  4. Update your assets in subversion
  5. Update your trunk code (readme, scripts, code, etc...)
  6. Tag your new version

Yes, I did not explain what tagging is, how to tag, or any of that... I prefer you read it straight from WordPress here.

I recommend using http://tortoisesvn.net/ for subversion.

All of that being said, after upgrading my plugin I now have over 200 downloads of a very simple plugin. Why? because it does one thing and it does it well. I can expand on it, but I prefer to keep it very simple and that it just works. My general rules of development can fall into something like this:

  • Keep it simple
  • Make it work
  • Make it beautiful

This is not an exhaustive list, but is a good starting point when I approach a problem.

Keep it simple

Make it easy to use for everyone, make the code readable, understandable, and organized.

Make it work

What does "working" mean. What do you want to do? What problem are you trying to solve? Is there something already out there that does it? If so, why not use it, what is it missing that you are fixing?

Make it beautiful

After years of writing "clean" code, I realized that the world is NOT full of developers. They want a UI to make it pretty to use. Beauty is in the eye of the beholder, so I learned that terminal windows aren't always beautiful to others. UI is an elegant art, a skill, a craft. Make it beautiful for your mom, your daughter, your wife. If all three of them can use it and aren't frustrated, then you are at least in a better position than a terminal window where you enter /h to identify on how to use it.

I didn't expect to write too much today, but I guess I had a little more on my mind than I thought.

My thought for this post is this:

Planning never generates a product, writing code does. Limit your planning, produce something, and update it.

Thanks for stopping by. (For those that were asking, yes, Susie created the illustration) :-)