Jimmy, the root of all problems was admin AJAX 403.
For an unknown reason, all ajax requests fail with 403 error. This problem is not related to HMWP as I disabled it and revert everything back and the problem exists.
This caused upload error.
This also caused replace problem because HMWP require flushing cache to see the result but as caching plugin uses admin AJAX Suman couldn’t flush it and see replaced source code.
It also caused the recent problem with cache. Again, for an unknown reason cache was flushed accidently when HMWP was enabled so HMWP does its work and change source code then it was disabled but cache was the same.
Admin AJAX is a wide used feature it’s recommended to fix this soon. I guess this issue was generated by a plugin (say BBQ or Anti-spam)