Update functions.php

update preg_match
update file_exists