WPIntell

Source evidence

Fatal error on multisite

AJAX Heartbeat Tool · support · 2014-10-14T09:25:00+00:00

mixedsentiment
highseverity
0.94relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 30 rows with source links

6.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
shoylman resolved
When 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.

Comments

3 shown
shoylman 2014-10-14T09:49:00+00:00

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

Mikel King 2014-11-26T17:11:00+00:00

Thanks Sholyman. I may include that as an optional if class does not exist alternative in the future.

Mikel King 2014-11-26T17:12:00+00:00

In light of the fact that this is a php version issue and not a WordPress specific one I’ll make this closed.