Can a theme ignore heartbeats in functions.php without side-effect?
-
This is a theme design question not a bug that needs diagnosis.
As part of a theme optimisation process I noticed that the theme’s functions.php file is loaded on every heartbeat ajax call. Now I understand the reason for that IF the theme made use of that trigger. But if the theme does not perform any heartbeat specific functions it seems a waste of server CPU to re-load the active page theme resources on an unrelated AJAX call.
If not, here then is the code I have added to the theme’s functions.php to ignore the heartbeat:
if ( isset( $_REQUEST['_nonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_nonce'] ), 'heartbeat-nonce' ) ) { return; }
Is there something I am missing here?
Thanks in advance for your wisdom…much appreciated ??
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Can a theme ignore heartbeats in functions.php without side-effect?’ is closed to new replies.