Updating failed. The response is not a valid JSON response.

When

Occurs when adding a new shortcode in a WordPress Plugin.

Solution

Add the ob_start() and ob_get_clean() functions

function load_shortcode() {
    ob_start();

    ?> 
       <h1>test</h1>
    <?php

    return ob_get_clean();
}