Hello World plugin not working

rony53

Verified User
Joined
Jun 5, 2022
Messages
29
I am trying to create a new plugin using this doc.
But the problem is. The example plugin not working properly. There is confusion. As an admin, it must show php info. But it's showing the loading icon nothing else. check the attachment. Anyone here can help me to fix it?
 

Attachments

  • Screenshot 2023-03-26 030416.png
    Screenshot 2023-03-26 030416.png
    13.2 KB · Views: 5
I am trying to create a new plugin using this doc.

Writing a plugin | Directadmin Docs

DirectAdmin Knowledge Base
docs.directadmin.com
But the problem is. The example plugin not working properly. There is confusion. As an admin, it must show php info. But it's showing the loading icon nothing else. check the attachment. Anyone here can help me to fix it?
 

Attachments

  • Screenshot 2023-03-26 030416.png
    Screenshot 2023-03-26 030416.png
    13.2 KB · Views: 2
It's not showing the Details page , once i click the hello world plugin then it's showing loading .. nothing else.. why ?
 
If a plugin does not load, then it might an issue with permissions or a PHP error. Did you complete an installation step for the plugin?
 
@rony53 Please standby -- this looks strange, so we did some testing and were able to reproduce the error on this end. We'll follow up here once we get to the bottom of this.

Thanks for popping in to assist @zEitEr
 
@rony53, thanks for reporting the issue. We have updated the demo plugin to version 1.5 and fixed the issue, please try downloading the latest version and see if it works.
 
Thanks but what is the issue? why its happened? i am planing to create a plugin for my self. So it will help me to solve the issue if happend in future
 
The problem was in the plugin integration part with Evolution via Vue JS framework. Due to recent changes in Evolution JS level integration no longer works. The updated hello world plugin not use JS integration. As long as you will not try injecting any JS code into Evolution (or rely on Evolution JS code) plugin will work fine.

JS integration is very fragile because it depends on Evolution using particular JS libraries and frameworks. Every time Evolution has some internal changes JS level integration needs to be updated to reflect that. We are planing on completely discontinuing the JS level integration.

It does not mean you can not use JS in your plugins. You are free to use it but you should not try to integrating with Evolution by trying to access or manipulate internal Evolution data.
 
The last thing, if I want to run a script named example.sh that is located in the scripts folder in the plugin >> user index.html how i will call it?
like
exec('../script/example.sh');
or something else?
 
Working directory for DirectAdmin is /usr/local/directadmin. So your example exec('../script/example.sh'); would be trying to execute script in /usr/local/directadmin + ../script/example.sh = /usr/local/script/example.sh.

If you want to get path relative to the currently running script you can use PHP magic constant __DIR__. For example exec(__DIR__'/../script/example.sh') would try executing script from /usr/local/directadmin/plugins/{plugin_name}/script/example.sh.
 
Working directory for DirectAdmin is /usr/local/directadmin. So your example exec('../script/example.sh'); would be trying to execute script in /usr/local/directadmin + ../script/example.sh = /usr/local/script/example.sh.

If you want to get path relative to the currently running script you can use PHP magic constant __DIR__. For example exec(__DIR__'/../script/example.sh') would try executing script from /usr/local/directadmin/plugins/{plugin_name}/script/example.sh.
Thank you fln... The Plugin doc is limited.
 
Back
Top