joshp23 / YOURLS-Expiry

YOURLS plugin to define conditions under which links will expire - time and click limited links
GNU General Public License v3.0
35 stars 13 forks source link

links not expiring on YOURLS 1.7.6 #20

Closed porlock closed 3 years ago

porlock commented 4 years ago

Links even when are maked green as expired still works

joshp23 commented 4 years ago

The plugin is working as expected while running the latest commit from YOURLS master. In other words, the links will show green in the admin area if that option is set on and the link is set to have some sort of expiration. After the link has expired it will remain listed until

  1. the link is clicked and then removed from the database or
  2. it is pruned via cron Again, it is working as expected in my environment. Please use the A.I.D. plugin, post the relevant data here, and maybe I can see if there is something in your environment that might be interfering with function.
porlock commented 4 years ago

Hey, this is A.I.D plugin output

I have a YOURLS installed in subdriectory,

Bug description

What is the current behavior?

1) I can't set up default expire behavior. 2) link does not expire when threshold is breathed. 3) I don't see any links in "Expiry list"

What is the expected or desired behavior?

1) default settings affect new created links 2) link expire when threshold is breathed 3) link appears in "Expiry list"

Reproducible bug summary steps

  1. Enable following plugins a) expiry/plugin.php b) random-shorturls/plugin.php
  2. Go to Manage Plugins/Expiry/Config
  3. Set a Default Expiry Type to "click counter" and Default Click Counter Value to "2"
  4. Go to "Admin interface" notice that "Short Link Expiration Type" is set to none
  5. Manually add a link for shortening, change Short Link Expiration Type to "click counter", Click Counter Value to "2" generate shot url.
  6. Go to Plugins/Expiry/Expiry list notice that list is empty
  7. Open short URL it in incognito windows 4 times, every time close browser window.
  8. Notice that link still works
joshp23 commented 4 years ago

Please set default expiry to none and attempt to test the plugin again.

joshp23 commented 4 years ago

I can verify that setting a default expiry condition does nothing. So there's a bug.

However, when I manually added expiry criteria to the link, it did set appropriately, and the link expired as expected. So, I cannot reproduce that bug.

porlock commented 4 years ago

Josh, it seams that it sometimes works and sometimes not, when you don't have any links in your database and add initial one it doesn't but when i tried before with some links existing it seams works.

joshp23 commented 4 years ago

Well, I cannot get default expiry data to set at all as is. With or without links in the database, after adding a link with expiry conditions, they expire as expected. You will have to help me with exact conditions for when they do not expire.

Note: I was careful to use different containers in Firefox every time I attempted a short URL. Or, a new private session every click.

joshp23 commented 4 years ago

Please see https://github.com/joshp23/YOURLS-Expiry/commit/744cbc4d537d81353a71f3da7dd88c4c8812c9fb as this should fix (at least a part) of your issue.

porlock commented 4 years ago

Hi Josh yes issue with default values looks solved, but for me whole plugin works pretty much randomly, and mostly does not at all :( please check this movie https://youtu.be/t2sYJu9zISw

joshp23 commented 4 years ago

I find that particularly odd. If it is truly random, then there is likely something in your environment that is causing the problem. Links not taking expiry data, or links not expiring when expected, I need to be able to reproduce the behavior in order to squash the bug. Try to isolate the behavior so that you can reliably predict when it will and won't work, then we can squash it.

porlock commented 4 years ago

It is probably not random, i just can find any pattern that cause that :( , but in my case it works wrongly in 80% of time. I will try to figure out it.

shrimpchip28 commented 4 years ago

I am having the same issues as @porlock I downgraded Yourls from 1.7.9 to 1.7.3 just to test. The video he provided is exactly what I am experiencing. Values are not inserted properly into the DB. I've tried on Firefox and Brave. My site is hosted on hostinger.

joshp23 commented 3 years ago

b4ca98b349a0c5c97f77c674023c770e0a2edefb which is in the latest release 2.2.0 should address this. Please review the README for a note on upgrading.

I am running 2.2.0 with YOURLS 1.7.10 https://github.com/YOURLS/YOURLS/commit/cab0c150a0ce2b0f8775a029c6b47fa98d69598b and everything is working fine.