@faishal should also `esc_attr()` these two `json_encode()`s as well, as if the JSON includes a single quote, it will break the markup.