@RisteD, I'd recommend you read
Resource standards and
Developer docs. This add-on violates at least the 11th, 19th, 23rd, and 25th clauses of the Resource Standards.
11th: there is no prefix in your database table that would make it clear that it refers to your add-on and your XenForo installation in general.
19th: I have nothing to say, just show:
/src/addons/whoviewtopic/Entity/User.php (which should be in /src/addons/whoviewtopic/XF/Entity/User.php):
PHP:
class User extends \XF\Entity\User
You must extend XFCP_User instead of XF\Entity\User.
/src/addons/whoviewtopic/XF/Pub/Controller/XFCP_Thread.php:
PHP:
class XFCP_Thread extends \XF\Pub\Controller\Thread
WTF?
23rd: you are extending the
XF:Thread controller that can return an instance of
XF\Mvc\Reply\Error or
XF\Mvc\Reply\Redirect, and these classes do not have a
setParam method, so it could be caused errors.
There are also "sins" in template modifications:
- You don't use phrases.
- You are not using the
xf:username tag and hardcoded HTML directly, which again causes incompatibility with other add-ons.
- You should
pluck the usernames from the array and use the join filter to list the usernames, or use the "listInline--comma" CSS class (example in the "widget_members_online" template), but definitely don't insert a comma inside xf:foreach.
I have many more comments on the code of this add-on, but, perhaps, I'll stop there.