What I’ve Learned My First Week Of Plugin Development
When you develop your own Software/WordPress Themes/WordPress Plugins, and they are only going to be used by you, you can release new versions when you feel like it. Forgot to change that < to a >? Update. Need to update your wp_query to pull a custom post type? Update.Want to update jQuery from 1.10 to 1.11? UPDATE! OK, you get it. What I’m saying is that it’s easy to just open an IDE code editor, make your changes and there you go. Bob’s your Uncle. You simply recognize the problem and update when you solve the problem. If you break a site, who cares. You’re the only one using it. Man, does this not fly so well in the Plugin Development world.
Enter in my new plugin. Gravity Styles. It’s a plugin to help you style your Gravity Forms Easier. When you develop your own stuff, stuff meaning themes and WordPress sites, you just simply drop any styling into the child theme css and move on. Well, this way now, you can just use our plugin and keep your forms looking good no matter what theme you use. Again, you just update your site and theme when you feel like it’s ready. There’s no need to alert anyone that an update is coming or has already happened.
SO I released the plugin to the world via twitter on February 3rd, 2015. All the plugin did was activate 5 class names and style a form to look like the 2013 – 2015 theme from WordPress. Not a huge contribution to the WP community. It’s a start according to Suzette Frank. I love her by the way. She’s super cool and just the nicest person you can meet at a WordCamp. After that, I dove into something that I was not ready for.
My First Plugin: Gravity Styles http://t.co/nvrzct26aK
— Russell Aaron (@KrashKartMedia) February 3, 2015
First things first
I knew right away that the plugin I was creating needed to update when I made a new release on Github. Oh yeah, my plugin is on Github. I found a way to update the plugin in the wp-admin by using WordPress-Github-Plugin-Updater. What I didn’t know is how the update worked. I just thought that you had to push the new code to the repo and WordPress would tell you there is a new update. So I did that like 500 times. Nothing happened. So I found a couple more tutorials that told me there had to be a GitHub Plugin URI link in the Plugin name. Then the updates would happen. So I did that. Nothing still.
I find this amazing tutorial on codetuts, that shows me an older way to update plugin in WordPress from Github. I change out all my code and use that. Again, nothing is done. At this point, I’m about to offer anyone $200 bucks to help me with this. I reinstall the WordPress-Github-Plugin-Updater into my plugin. I try uploading to the repo about 2000 more times. Still nothing. At this point, I think there is something wrong. Then I find, yet again, another tutorial that says you need to have the updater plugin and another plugin to update the plugin from Github. So I install my plugin, and this other plugin. Push up code to the repo and…..NOTHING!
That AH-HA moment in plugin development
I have a huge problem with WordPress tutorials. Not the way that they are written or anything. My problem with WordPress tutorials is that a tutorial never tells you what version of WordPress this tutorial was written for. Unless you look at the date that the tutorial was written, you never learn that the tutorial advice is from 3.8 and we’re on 4.1.
Anyways…. After installing my plugin, baking in an updater plugin and installing another plugin to help update my plugin, I am finally able to see my plugin get updated in real time. What I was doing is updating all of the information in the plugin name and comments. I was updating the version from 1.0 to 1.1. But I was not updating that in the Read Me file. So my plugin was not updating. Just like that, I had to release a new version and update everyone on what was going on.
Someone tell me what I’m doing!
I update a post in Facebook that alerts everyone on how to update my plugin by adding in another person’s plugin. After two hours, I get a notification on Facebook saying that I did not need to have the second plugin installed to update Gravity Styles. I look at the source of the comment. It’s the developer of the second plugin, Paul Clark. He tells me that I shouldn’t need to use his plugin. My code looked fine.
I uninstall his plugin. I push an update and create a new release. I log into wp-admin and… nothing. There’s no update for the plugin. I just released a new version. I know there should be an update. I refresh. Nothing. I tell myself that I’m going to wait a half hour. Then I refresh again. Nothing. I refresh one more time. There it is. An update informing me that my plugin has an update! WHOOOO!
Happy Dance Freak Out Party
SO now my plugin can update when I release a new version. It take a few minutes. But the update comes in. So I decided that I needed a good way to test my plugin, to really see if my updates were coming through. I go home and I style about 5 more forms. I make a special one for a friend’s business. I was going to do that anyways. This way, I knocked it out in two places. I push up my code and make a new release. I get super excited. I go load my Hookah and come back. I refresh and… no update.
I know the plugin updater works. I’ve done it a time or two already. SO no what’s the issue. I go back into Github and look at the releases. I then realize that I used the wrong words in my release. I used required instead of requires. I make my change and push the update. I log into wp-admin and check for the update. There it is. Man. No Way. It Worked. Now there are 10 styles available in the plugin.
What have I learned, Exactly?
I learned that you need to update as much as possible before committing your changes. Instead of releasing 200 updates, you should build everything that you want first, and then push the commit and make a new release. As a WP user, I don’t care when an update is available. Some people really do. They would prefer to use a plugin that only updates once a month, maybe a week. Not this every 20 minutes thing. I learned that you need to verify before you inform. It’s better to know what’s going to happen instead of selling tickets and praying for the best.