Drowning in code - why WP2.7 will be a journey for me
Someone sent me a message saying that the options page doesn’t update on CommentLuv for WP2.7b3 and it’s set off a small chain reaction in my head.
I checked another plugin that does work for the options update in 2.7b3 and compared it to my code and that’s where the kerbumph happened in my head…
My wordpress plugin code needs a complete overhaul! you see, it has grown organically (as in like wild weed beds) since it’s inception as a simple one file plugin to what it is now which is a large bit of code with functions calling functions and some (I admit) messy solutions to problems.
Not my fault though! These messy solutions were made at a time when my coding knowledge was expanding (which is always). My coding knowledge is pretty much down to writing this plugin and it’s support site so it’s only natural that code I wrote just 2 months ago could have benefited from my brain of now.
Not a problem… this just means I need to rewrite the whole plugin and add some things I have wanted to do for a long time but I didn’t know how!
Here’s a list of things I have in my mind for it (more for my own sake when I come back and stare at old posts for inspiration)..
- Move the options page to a separate file
This will make it easier to update options and be compatible with 2.7 - Fix so no config for form fields required (done)
This came to me while thinking about eggs. go figure! - Use external javascript file for CommentLuv and heart box
I wanted to do this a long time ago but didn’t know if my server could handle it, turns out it can and it has the advantage of me being able to change the way commentluv functions at one place and everyone that uses it gets the update immediately. no more relying on people to update their plugin! - put a refresh image next to the last blog post so someone can refresh their link
This is so I can simplify the code of the javascript for speedier running and compatibility - add alert function so remote script can send back an alert to the user if they’re commenting too fast
- make all platform versions look the same (blogger done)
- retrieve commentluv member id from options page via ajax
- automatically detect if blog is using ID commenting and take appropriate action so commentluv still works
There’s a lot more I imagine but the most important thing for me is the options page and remote javascript instead of included.
The house will be busy this week and the contest is going mad so when all that’s over, I’ll see if I can go to a quiet place and be out of contact for a week while I make the changes. oh gwd, I see a large growth of chin whiskers happening…
Filed under: Blog News, Code | Tagged: Code, commentluv, updates