It’s time to do another update on this project, particularly as in the past couple of weeks there’s been some changes and I’ve received a partial schooling on the limits of the WordPress platform for database stuff, and just how quickly this project has pushed up against them. As a result, the priorities for this project over the next few months have to change, away from adding new code and new abilities to making sure that the existing code and abilities are efficient and secure as possible.
As I’ve mentioned on Twitter, in the past few weeks I’ve been doing a bunch of coding in order to draw out information from the database about officer professional networks- or in simple terms, how many other officer each officer worked with. When I was looking at how many worked on the same ship, it was easy enough (albeit slow). When I moved to trying to find out how many officers had relationship by working on the same station, things started timing out. So much so that I could only pull up results for the latter four officers at a time (when there are currently 512 officers in the database).
I needed help, and so a friend had a look at some of my code. As some of you know, I started in computer science before switching over to history. Unfortunately, I left before I took the databases course, and it shows. Much of the work that is to be done has to do with making the database queries much more efficient (I’m sure that anybody who has used the database has noticed that it’s a bit slow sometimes)
Accordingly the tasks for the next few months are as follows:
- Divide the existing code base into several files, so that things can be easily located and updated (the existing functions file is 7300 lines long and needs reorganization
- Go through and make sure everything uses prepared statements for every task involving the database. (This isn’t about efficiency, this is about security
- Go through and for every where that I access the database, ask whether I can do a join instead of what I’m already doing (usually nested for loops- which is much less efficient)
- Figure out how to turn the ADM8 code into a plug-in so that it can be used independent of whatever WordPress theme the website as a whole upgrades to.
So we have some interesting (and somewhat tedious tasks) to accomplish over the next few months!