If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

I have tried that better whenever die is called it kills the whole forum instead of the plugin itself.

Which is normal. Die doesn't terminate an inclusion, it halts the processor.
If you want it to stop, you have one of two options. The first is to deal only within the branches which is what I'd recommend, and the other is to issue a return which halts the current script that was included and returns the control to the caller. Consider it as a recursive call to the main() method, where the return of the inclusion only terminates the inner main.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

It is, but you can also return from a logical main. A value is not required, but it is atypical to return void.
When you return in a script, you are returning control to the caller, halting this script termination (assuming you're running the script main), and return the result. So in php, it is perfectly valid to do this:

PHP Code:

<?php// 1

return 4;?><?php

$res = include '1.php';print("Include returned: %d" . PHP_EOL, $res);

It is just uncommon to do so (specifically because you require the return in the script main, which is not common and hence why I recommended the use of logical branches instead).

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)