So the revamp of FitMonstr had started a couple days ago and some solid progress has been made. If you haven’t read the previous post, basically what is happening is that we are going through the entire system and updating it with new programming concepts and techniques. The reason that we are doing this is because, ultimately, this leads to not only a more dynamic and secure system, but it also makes the back end code much more readable. This, in turn, allows us to make changes to the system more efficiently and without the risk of breaking anything.
So first off, we had to change the very foundations of the system. FitMonstr used to use MySQL_Connect to connect to the database, but if you know anything about PHP, you will also know that MYSQL_Connect is deprecated. This means it is no longer supported as there are new, more secure and efficient methods to connect to the database such as PDO (PHP Data Objects) and MySQLi. PDO is what we are going to be replacing everything with. Not only does PDO implement the use of objects to connect to the database, it also allows for the use of prepared statements which helps against SQL Injection attacks. Pretty much every single query that is used on the system will have to be replaced with its PDO counterpart.
Once we had changed the foundations, we had to revamp the user system. This includes the login and register. The user system used to work by creating users in a procedural method. This means that the system went down the code and just completed everything in turn. Now we have implemented a user class into the mix so now users can be created as objects on the fly without having to do much at all. This is especially useful but we can also use this object on other areas of the website if need be (e.g creating a user via the admin area). This also allows us to change the users settings without needing to change it’s associated pages.
For the first stage of the revamp, we have made some pretty good progress transitioning the system to more efficient and stable methods but we still have a long way to go.