I think there’s an issue with the heartbeat control setting for posts (and pages). Even though I have set the setting to the max. 120 seconds, the heartbeat occurs at the default interval of 60 seconds.
The issue seems to be in the way you’re using the result of strpos( $_SERVER['REQUEST_URI'], '/wp-admin/post.php' ) to determine if the user is currently on that ‘location’. If WordPress is not installed in a subdirectory, the result of strpos() is 0, which results in false in an if statement. Therefore, the check_location() wil always fail for posts and the heartbeat settings are never modified when on /wp-admin/post.php.
This issue also applies to disabling the heartbeat for post editing:
You might save yourself some precious server resources by resolving this issue.
