YOURLS / 404-if-not-found

Redirect with a 404 when short URL is not found
Do What The F*ck You Want To Public License
22 stars 8 forks source link

Unintended behaviour with other plugins... #6

Closed WPS12TA closed 8 months ago

WPS12TA commented 8 months ago

Code of Conduct

Submission validity

Self troubleshooting

Version

1.8

Description

I had installed this plugin and it was working very well. Thank you. However, I then went on to install the QR-code plugin that converts a shortened url.qr into a QR code. I wanted and expected that to work. I discovered this plugin 'jumps in first' and gives a Not Found message and will not let the QR code plugin work until this plugin is deactivated, then the QR plugin worked. I am sure you would prefer both the plugins to play better with each other rather than fight in an either or way. It seems the order of processing is not ideal. Apologies as I am very new to all this but this is such a great system and I hope the fix is easy or the documentation could be explicit for this behaviour.

Expectation

Both plugins to work when both activated.

Reproduction steps

Install this and QR-code plugin activate them both and try the .qr hack to make a QR code.

Context

I think I have explained the problem clearly.

WPS12TA commented 8 months ago

It looks as though they can play together, providing this 404 plugin is activated AFTER the QR code one is activated.

ozh commented 8 months ago

Which QR code plugin is it ?

WPS12TA commented 8 months ago

Plugin Name: QR Code Short URLS Plugin URI: https://yourls.org/ Description: Add .qr to shorturls to display QR Code Version: 1.1 Author: Ozh Author URI: https://ozh.org/

This one. I chose it as it looked simple to install and use. It works really well. I even adapted it to give me SVG graphics by calling a different service. It seems cheeky to publish it as a forked version!

I just changed

// header('Location: https://chart.apis.google.com/chart?chs=400x400&cht=qr&chld=M&chl='.YOURLS_SITE.'/'.$keyword );

header('Location: https://quickchart.io/qr?ecLevel=Q&format=svg&margin=2&light=f5fff5&size=200&text='.YOURLS_SITE.'/'.$keyword );

In the QR Code plugin.

If you are OZH, I am in awe of your abilities! Well done and thank you!

By deactivating the 404 and then activating the QR code plugin 1st then the 404 one they both seem to work together now. So perhaps just the documentation needs changing? I had installed the 404 one first and could not get the QR code one working till I stopped the 404 one by moving it away. I moved it back and reactivated it and it seems to work now.

Paul +44 07877 677285

On Fri, 15 Dec 2023, 20:27 ྅༻ Ǭɀħ ༄༆ཉ, @.***> wrote:

Which QR code plugin is it ?

— Reply to this email directly, view it on GitHub https://github.com/YOURLS/404-if-not-found/issues/6#issuecomment-1858431332, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCANRXEWEY7HDUS5UPLLN4TYJSVBJAVCNFSM6AAAAABAVPZQR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYGQZTCMZTGI . You are receiving this because you authored the thread.Message ID: @.***>

ozh commented 8 months ago

If you can re-create the original scenario where both plugins were conflicting, I'd be interested with your reporting about one change : in the QR code plugin, change yourls_add_action('redirect_keyword_not_found', 'ozh_yourls_qrcode'); with yourls_add_action('redirect_keyword_not_found', 'ozh_yourls_qrcode', 1); (line 12)

WPS12TA commented 8 months ago

Yes. I could reproduce it.

Yes. You have fixed it.

So simple. Thank You.

I guess it would help others too.

You are a Hyper-Star!

I am not very familiar with git etc. Can I leave the rest to you?

Paul

On Sat, 16 Dec 2023 at 17:35, ྅༻ Ǭɀħ ༄༆ཉ @.***> wrote:

If you can re-create the original scenario where both plugins were conflicting, I'd be interested with your reporting about one change : in the QR code plugin, change yourls_add_action('redirect_keyword_not_found', 'ozh_yourls_qrcode'); with yourls_add_action('redirect_keyword_not_found', 'ozh_yourls_qrcode', 1); (line 12)

— Reply to this email directly, view it on GitHub https://github.com/YOURLS/404-if-not-found/issues/6#issuecomment-1858878515, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCANRXDGDI7DRDIAKMPMU2DYJXLUTAVCNFSM6AAAAABAVPZQR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYHA3TQNJRGU . You are receiving this because you authored the thread.Message ID: @.***>

-- Paul Stross @.***

ozh commented 8 months ago

Both plugins updated -- thanks

WPS12TA commented 8 months ago

Thats is very impressive. You are so efficient and well motivated. Thanks!

Paul Stross. @.***

On Sat, 16 Dec 2023, 19:35 ྅༻ Ǭɀħ ༄༆ཉ, @.***> wrote:

Both plugins updated -- thanks

— Reply to this email directly, view it on GitHub https://github.com/YOURLS/404-if-not-found/issues/6#issuecomment-1858914053, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCANRXGKUZPKJGOISQMPIQTYJXZXDAVCNFSM6AAAAABAVPZQR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYHEYTIMBVGM . You are receiving this because you authored the thread.Message ID: @.***>

WPS12TA commented 8 months ago

This 404 plugin also seems to stop the preview-url plugin from working. The activation order does not seem to matter.

On Sat, 16 Dec 2023, 21:39 Paul Stross, @.***> wrote:

Thats is very impressive. You are so efficient and well motivated. Thanks!

Paul Stross. @.***

On Sat, 16 Dec 2023, 19:35 ྅༻ Ǭɀħ ༄༆ཉ, @.***> wrote:

Both plugins updated -- thanks

— Reply to this email directly, view it on GitHub https://github.com/YOURLS/404-if-not-found/issues/6#issuecomment-1858914053, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCANRXGKUZPKJGOISQMPIQTYJXZXDAVCNFSM6AAAAABAVPZQR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYHEYTIMBVGM . You are receiving this because you authored the thread.Message ID: @.***>

WPS12TA commented 8 months ago

Code of Conduct

Submission validity

  • [x] This is not a personal support request, that should be posted on discussions community.
  • [x] I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.8

Description

I had installed this plugin and it was working very well. Thank you. However, I then went on to install the QR-code plugin that converts a shortened url.qr into a QR code. I wanted and expected that to work. I discovered this plugin 'jumps in first' and gives a Not Found message and will not let the QR code plugin work until this plugin is deactivated, then the QR plugin worked. I am sure you would prefer both the plugins to play better with each other rather than fight in an either or way. It seems the order of processing is not ideal. Apologies as I am very new to all this but this is such a great system and I hope the fix is easy or the documentation could be explicit for this behaviour.

Expectation

Both plugins to work when both activated.

Reproduction steps

Install this and QR-code plugin activate them both and try the .qr hack to make a QR code.

Context

I think I have explained the problem clearly.