Conversation
supportWhen I try to network activate or single site activation, I get the following error: Fatal error: Call to undefined function get_called_class() in /wp-content/plugins/ajax-heartbeat-tool/plugin.php on line 76 https://wordpress.org/plugins/ajax-heartbeat-tool/
Multisite doesn’t appear to be the issue. My server is running PHP 5.2. 5.2 doesn’t support get_called _class. So If you have the same problem, you can do the following to get it to work: At the bottom of plugin.php you’ll see the following: $aht = Ajax_Heartbeat_Tool::get_instance(); Underneath that code, paste in the following: function get_called_class(){ $arr = array(); $arrTraces = debug_backtrace(); foreach ($arrTraces as $arrTrace){ if(!array_key_exists(“class”, $arrTrace)) continue; if(count($arr)==0) $arr[] = $arrTrace[‘class’]; else if(get_parent_class($arrTrace[‘class’])==end($arr)) $arr[] = $arrTrace[‘class’]; } return end($arr); } Save it and now it works with PHP 5.2
Thanks Sholyman. I may include that as an optional if class does not exist alternative in the future.
In light of the fact that this is a php version issue and not a WordPress specific one I’ll make this closed.
Multisite doesn’t appear to be the issue. My server is running PHP 5.2. 5.2 doesn’t support get_called _class. So If you have the same problem, you can do the following to get it to work: At the bottom of plugin.php you’ll see the following: $aht = Ajax_Heartbeat_Tool::get_instance(); Underneath that code, paste in the following: function get_called_class(){ $arr = array(); $arrTraces = debug_backtrace(); foreach ($arrTraces as $arrTrace){ if(!array_key_exists(“class”, $arrTrace)) continue; if(count($arr)==0) $arr[] = $arrTrace[‘class’]; else if(get_parent_class($arrTrace[‘class’])==end($arr)) $arr[] = $arrTrace[‘class’]; } return end($arr); } Save it and now it works with PHP 5.2
Thanks Sholyman. I may include that as an optional if class does not exist alternative in the future.
In light of the fact that this is a php version issue and not a WordPress specific one I’ll make this closed.