Use wp_json_encode

Replace occurrences of`json_encode` with `wp_json_encode`
http://pento.net/2014/12/19/json-encoding-in-wordpress-4-1/