| Roughly in the order you should do it. Hopefully it's at least PHP 5.3 code: 1. Definitely get a PHP IDE:
https://www.jetbrains.com/phpstorm/ 2. Get a step debugger and hook it in:
https://xdebug.org/ 3. Fix the code style:
https://github.com/FriendsOfPHP/PHP-CS-Fixer 4. Run the code through some static analysis tools
https://phpstan.org/
https://psalm.dev/ 5. Upgrade the code with an AST fixer (might help you update to newer PHP version):
https://github.com/rectorphp/rector 6. Add tests to it:
https://phpunit.de/ 7. Run mutation tests:
https://infection.github.io/ The "0 budget" is rough, though. |
- Make sure you have version control. So easy to do these days, so often forgotten.
- don't think that the steps above must be done in order, right now.
- dkarlovi mentions tests. Start with 1.) smoke tests like simple selenium tests or something like that. You'll find lots of vate towards it if you look and I admit it has issues but for simple projects like this that doesn't change much it should be fine. Of course of you find something better use that.
- one of the most important things about a good IDE is being able to refactor confidently so you can rename variables to something reasonable as you figure out what they really are.
- the book "refactoring legacy code" might be the best programming book I've read.