I've been taking a quick look at the code for one or two purposes of my own...
Would it not make more sense to change
PHP Code:
if ($_POST['txn_type'] == 'web_accept' AND $_POST['payment_status'] == 'Completed' OR $_POST['txn_type'] == 'subscr_payment' AND $_POST['payment_status'] == 'Completed')
to be:
PHP Code:
if (($_POST['txn_type'] == 'web_accept' OR $_POST['txn_type'] == 'subscr_payment') AND $_POST['payment_status'] == 'Completed')
I beleive this is functionally the same, but does one less comparison. Yes, I'm being picky here, sometimes things like this just irk me a bit.
A possible addition might be setting up the POST request to Paypal to automatically submit the correct URL for the notification. I beleive the parameter is called "notify_url". This should automatically enable IPN for the transaction posted, regardless of the settings in the account - As long as it's capable of IPN of course!