Update elasticsearch.php

Fixed two issues that I experienced with WordPress 4