Expiring User Upgrades

Expiring User Upgrades [Paid] 1.3.8

No permission to buy ($20.00)
  • Thread starter Thread starter Syndol
  • Start date Start date
This add-on would be 100% perfect if it were not for the complexity of manipulating the phrases, it's just been quite painful. I would love to see the options page contain fields for the message texts. I am also having difficulty manipulating the various messages as some of them bbcode or html works some of them not. I just wanted one consistent message with my own text and a few clickable links. I've gotten closer but my links are not clickable. I've now opted to sending out a conversation only. Any idea how to make clickable links for the conversation messages? Thanks!
Normal HTML should work;
Code:
<a href="link">test</a>
 
ok i've tried adding the link code in the phrase

Code:
<a href="link">test</a>

and I still see the code markers with no link working. it doesn't seem html works in phrases so not sure how else to accomplish this.
 
@sross I'll look into this soon to figure out why it isn't working.

and I still see the code markers with no link working. it doesn't seem html works in phrases so not sure how else to accomplish this.
Try replacing the word "link" in that html snippet with a real link.

thanks and do i update the Master language or EnglishUS?
EnglishUS, I don't recommend editing the Master Language as it can get lost. on the next add-on update.
 
@sross I'll look into this soon to figure out why it isn't working.


Try replacing the word "link" in that html snippet with a real link.


EnglishUS, I don't recommend editing the Master Language as it can get lost. on the next add-on update.
Sorry I should have been more clear, I did format the link correctly, was just reusing your example.

Ok, I've tried BBcode instead, i think that will work.
 
Last edited:
Ok, I've tried BBcode instead, i think that will work.
Looking at it; conversations need to use bbcode not html. I'll have to update what is required for what and figure out how to present a sane interface for this.
 
bbcode worked :)

One more thing. I have a dozen or so subscriptions on offer at different pricing. Some members renew early at a different pricing which then gives them 2 subscriptions for a short time. One of those expires and they start getting notices. Then they all contact me claiming they re-subscribed already and to check my records. I've tried updating the notice telling them to ignore the notice if they recently subscribed but they don't read through the notice. So, ideally the trigger mechanism might need to check if there is already another valid subscription and default to the most recent subscription before sending out a notice.

Great add-on though, it's definitely helping me get more subs.
 
@sross that is something on my todo list to improve. Part of the problem, is there really isn't enough information being used to determine if another upgrade has been applied yet. Another part of the problem is the paypal "instance notification" callback can take upto 3-4 hours to actually occur.

This means the user could have bought an upgrade but it takes hours to apply, and I don't have any record to say it is a pending subscription waiting finalisation.
 
@Xon
Sometimes when I manually upgrade user I get error.
Than I just manually upgrade user again and than is no error at all.
Could it be related to this addon?

Code:
Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '69' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Sunka, Tuesday at 20:50
Stack Trace
#0 /home/nginx/domains/pijanitvor.com/public/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/nginx/domains/pijanitvor.com/public/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/nginx/domains/pijanitvor.com/public/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Model/UserUpgrade.php(532): Zend_Db_Adapter_Abstract->insert('xf_user_upgrade...', Array)
#4 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php(235): XenForo_Model_UserUpgrade->upgradeUser(31707, Array, true, 1490565600)
#5 /home/nginx/domains/pijanitvor.com/public/library/XenForo/ControllerAdmin/UserUpgrade.php(311): SV_ExpiringUserUpgrades_XenForo_Model_UserUpgrade->upgradeUser(31707, Array, true, 1490565600)
#6 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/ControllerAdmin/UserUpgrade.php(36): XenForo_ControllerAdmin_UserUpgrade->actionManual()
#7 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(351): SV_ExpiringUserUpgrades_XenForo_ControllerAdmin_UserUpgrade->actionManual()
#8 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/nginx/domains/pijanitvor.com/public/admin.php(13): XenForo_FrontController->run()
#10 {main}
Request State
array(3) {
  ["url"] => string(83) "https://www.pijanitvor.com/admin.php?user-upgrades/donator-grupa-3-mjeseca.4/manual"
  ["_GET"] => array(1) {
    ["user-upgrades/donator-grupa-3-mjeseca_4/manual"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["username"] => string(8) "Amanitta"
    ["end_date"] => string(10) "2017-03-27"
    ["_xfToken"] => string(8) "********"
  }
}
 
@Sunka

The add-on code hasn't actually executed anything at that stage.

This is likely the result of double-tapping the submit button and causing a race as the two manual upgrades attempted to complete at once.
 
@sross that is something on my todo list to improve. Part of the problem, is there really isn't enough information being used to determine if another upgrade has been applied yet. Another part of the problem is the paypal "instance notification" callback can take upto 3-4 hours to actually occur.

This means the user could have bought an upgrade but it takes hours to apply, and I don't have any record to say it is a pending subscription waiting finalisation.
Having checked my occurrences of this it seems the additional upgrades were purchased 15-30 days, so my members are ending up with overlapping dual subscriptions for 15-30days. What if the notice regards all a users upgrades as one and runs based on the date finishing last. So if a user has 2 upgrades:

upgrade a expires Jan 25th 2017
upgrade b expires Jan 30th 2017

The system only sends out notice based on expiry date Jan 30th 2017. Not sure..
 
@sross thanks for that information. It makes putting together a test scenario doable, but the big issue is the user upgrades don't have enough information stored on them for this task.

I'll need to think about what can be done.
 
@sross thanks for that information. It makes putting together a test scenario doable, but the big issue is the user upgrades don't have enough information stored on them for this task.

I'll need to think about what can be done.
Still a pretty big problem for me. I get contacted daily by people saying "why did my subscription expire? I paid a few days ago!?". I'm tempted to uninstall the mod, but it does seem to prod users to subscribe, it's just unfortunate that it hassles the ones who did subscribe.
 
  • Like
Reactions: Xon
Feature Request: Expiring Upgrade eMail Option that sends a CC: eMail to the Board Admin eMail Address for the expiring upgrade and the actual downgrade... I find it very important that the board admin gets notified if a user does not renew his upgrade. I wonder why this is not core XF.
 
Phrase Bugs: Found some email and alert phrase issues where the "Upgrade URL" is not correctly used... and therefore will lead users to "page not found" errors.

https://www.mywebsite.com/%7Burl%7D

In some phrases you just have the {url} as the placeholder which then results in a path error.

Bildschirmfoto 2017-10-18 um 09.07.45.webp

Other phrases have what (I guess) is the correct placeholder:

Bildschirmfoto 2017-10-18 um 09.08.01.webp

Please check all phrases and fix this.
 
@Xon, when manually upgrading user on version 1.2.3 this is error (user is not upgraded)
Code:
Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '92' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Sunka, 9 minutes ago
Stack Trace
#0 /home/nginx/domains/pijanitvor.com/public/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/nginx/domains/pijanitvor.com/public/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/nginx/domains/pijanitvor.com/public/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /home/nginx/domains/pijanitvor.com/public/library/XenForo/Model/UserUpgrade.php(532): Zend_Db_Adapter_Abstract->insert('xf_user_upgrade...', Array)
#4 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php(235): XenForo_Model_UserUpgrade->upgradeUser(37095, Array, true, 1511046000)
#5 /home/nginx/domains/pijanitvor.com/public/library/XenForo/ControllerAdmin/UserUpgrade.php(311): SV_ExpiringUserUpgrades_XenForo_Model_UserUpgrade->upgradeUser(37095, Array, true, 1511046000)
#6 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/ControllerAdmin/UserUpgrade.php(36): XenForo_ControllerAdmin_UserUpgrade->actionManual()
#7 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(351): SV_ExpiringUserUpgrades_XenForo_ControllerAdmin_UserUpgrade->actionManual()
#8 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/nginx/domains/pijanitvor.com/public/admin.php(13): XenForo_FrontController->run()
#10 {main}
Request State
array(3) {
  ["url"] => string(82) "https://www.pijanitvor.com/admin.php?user-upgrades/premium-grupa-1-mjesec.3/manual"
  ["_GET"] => array(1) {
    ["user-upgrades/premium-grupa-1-mjesec_3/manual"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["username"] => string(6) "Darkoc"
    ["end_date"] => string(10) "2017-11-19"
    ["_xfToken"] => string(8) "********"
  }
}

I upgraded to newest version 1.3.0 and when tried to manually upgrade user this is show up (user is upgraded now)

Code:
Server Error Log
Error Info
TypeError: Argument 3 passed to XenForo_Mail::queue() must be of the type array, null given, called in /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php on line 140 - library/XenForo/Mail.php:200
Generated By: Sunka, 4 minutes ago
Stack Trace
#0 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php(140): XenForo_Mail->queue('cakardic.darko@...', 'Darkoc', NULL)
#1 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php(286): SV_ExpiringUserUpgrades_XenForo_Model_UserUpgrade->_notifyUser(Array, 'purchased_upgra...')
#2 /home/nginx/domains/pijanitvor.com/public/library/XenForo/ControllerAdmin/UserUpgrade.php(311): SV_ExpiringUserUpgrades_XenForo_Model_UserUpgrade->upgradeUser(37095, Array, true, 1511046000)
#3 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/ControllerAdmin/UserUpgrade.php(36): XenForo_ControllerAdmin_UserUpgrade->actionManual()
#4 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(351): SV_ExpiringUserUpgrades_XenForo_ControllerAdmin_UserUpgrade->actionManual()
#5 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/nginx/domains/pijanitvor.com/public/admin.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
  ["url"] => string(82) "https://www.pijanitvor.com/admin.php?user-upgrades/premium-grupa-1-mjesec.3/manual"
  ["_GET"] => array(1) {
    ["user-upgrades/premium-grupa-1-mjesec_3/manual"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["username"] => string(6) "Darkoc"
    ["end_date"] => string(10) "2017-11-19"
    ["_xfToken"] => string(8) "********"
  }
}

Code:
Server Error Log
Error Info
ErrorException: Undefined variable: headers - library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php:140
Generated By: Sunka, 5 minutes ago
Stack Trace
#0 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php(140): XenForo_Application::handlePhpError(8, 'Undefined varia...', '/home/nginx/dom...', 140, Array)
#1 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/Model/UserUpgrade.php(286): SV_ExpiringUserUpgrades_XenForo_Model_UserUpgrade->_notifyUser(Array, 'purchased_upgra...')
#2 /home/nginx/domains/pijanitvor.com/public/library/XenForo/ControllerAdmin/UserUpgrade.php(311): SV_ExpiringUserUpgrades_XenForo_Model_UserUpgrade->upgradeUser(37095, Array, true, 1511046000)
#3 /home/nginx/domains/pijanitvor.com/public/library/SV/ExpiringUserUpgrades/XenForo/ControllerAdmin/UserUpgrade.php(36): XenForo_ControllerAdmin_UserUpgrade->actionManual()
#4 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(351): SV_ExpiringUserUpgrades_XenForo_ControllerAdmin_UserUpgrade->actionManual()
#5 /home/nginx/domains/pijanitvor.com/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/nginx/domains/pijanitvor.com/public/admin.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
  ["url"] => string(82) "https://www.pijanitvor.com/admin.php?user-upgrades/premium-grupa-1-mjesec.3/manual"
  ["_GET"] => array(1) {
    ["user-upgrades/premium-grupa-1-mjesec_3/manual"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["username"] => string(6) "Darkoc"
    ["end_date"] => string(10) "2017-11-19"
    ["_xfToken"] => string(8) "********"
  }
}
 
Top Bottom