The global variable $IP should be replaced by a global constant MW_INSTALL_PATH. The advantages of the constant over the variable are not huge, but I think still compelling:
- The constant cannot be changed (while the variable shouldn't be changed, but could)
- The constant has a better name ($IP is obscure and may easily conflict)
- The global keyword should be avoided (eventually we'll want a linter rule to flag usages of global)
- Using MW_INSTALL_PATH is analogous to using __DIR__ to locate files.