Heartbeat control not working for posts

[ad_1]

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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer