This test has been created to test coding practises for programmers. The intention is that this is a quick task-based test that will reveal how a programmers (you) write code and which considerations are made when building new code as well as fixing and replacing legacy code. The test has also been designed to test your understading of code and your ability to find and fix bugs.
Here is a short list some of the things that are wrong with the code in class-product-price.php:
- Missing code comments and DocBlocks
- HTML validation errors
- Wrong indentation
- Inconsistent and bad naming of variables, class and methods
- Deprecated function uses
- Does not work with PHP7
- Incorrect placement of tags
- Fatal PHP errors
Notes: Feel free to rename the methods in the class, but don't remove any of them. The test harder than it looks. Pay attention to the details.
Tip: Change as much as possible to make it represent your own code.
- Fix as much as possible and make the code readable.
- VAT does not work. Fix the setting of VAT and the VAT calculation.
- Implement a better way of setting extra product fees based on the last part of the price name.
- Make the code work with php7.
- (Optional) Create unit tests for the class
- Make sure VAT works (listed twice for emphasis)