LPH
Well-known member
A WordPress widget is conflicting with numerous XenForo add-ons. Each stating a class cannot be redeclared. If the widget is removed then the WordPress page loads properly. There are about 5 different XF add-ons conflicting.
This is the main part of the widget code. Somewhere in the reasoning, there is a reattempt to redeclare classes from XF add-ons but I don't see it.
Is there anything obviously wrong with the above code?
This is the main part of the widget code. Somewhere in the reasoning, there is a reattempt to redeclare classes from XF add-ons but I don't see it.
PHP:
$dependencies = new XenForo_Dependencies_Public();
$dependencies->preLoadData();
/** @var $sessionModel XenForo_Model_Session */
$sessionModel = XenForo_Model::create( 'XenForo_Model_Session' )->getModelFromCache('XenForo_Model_Session');
$visitor = XenWord::getVisitor();
/** Pull onlineUsers */
$onlineUsers = $sessionModel->getSessionActivityQuickList(
$visitor->toArray(),
array( 'cutOff' => array( '>', $sessionModel->getOnlineStatusTimeout() ) ),
( $visitor['user_id'] ? $visitor->toArray() : null )
);
echo "<span class='xenword-onlineusers'>";
echo 'Total: ' . $onlineUsers['total'] . ' (members ' . $onlineUsers['members'] . ', guests: ' . $onlineUsers['guests'] . ', robots: ' . $onlineUsers['robots'] . ')';
echo "</span><br />";
Is there anything obviously wrong with the above code?