Skip to content

Commit

Permalink
update Readme and bump version to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kvibber committed Jun 24, 2022
1 parent 051cd1e commit 054fc09
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions linkchain.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
A chain of redirections starting with the source URL. Each line redirects to the previous one.

https://hyperborea.org/journal/2022/04/corrupted-gnome/
https://hyperborea.org/journal/?p=81451
https://wp.me/p4vcr-lbJ
Expand All @@ -7,3 +9,7 @@ http://ow.ly/Vcq050JGjmM
https://bit.ly/3xT4SwX
https://t.co/kTzFTX65HT

1. Following the t.co link should get you to the post permalink.
2. Unwrap-shortlinks should replace the t.co link with the blog ?p=xyz link.

TODO: Also check URLs ending in ?p=[0-9]+, follow them once and accept the result if the URLs match up to the previous /
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unwrap Shortlinks

Stable tag: 0.2.4
Stable tag: 0.3.0
Tags: urls, links, classicpress
Requires at least: 3.0
Tested up to: 6.0
Expand Down Expand Up @@ -41,7 +41,7 @@ Install the plugin and activate it. The next time you paste a supported short UR

### What if the destination redirects to another link?

At the moment it'll stop at the first one to avoid infinite redirect loops. But if the destination is another known shortener (say you had a t.co link that redirected to a bit.ly link), the next time you save the post, it will follow that one to its destination. TODO: I plan to make it follow a limited chain of known shorteners.
If the destination is another known URL shortener (ex. t.co pointing to bit.ly pointing to wp.me pointing to a blog post), it'll keep going up to 5 levels (to avoid infinite loops!) or until it gets a URL that isn't on the list.

### How do I add a shortener to the list?

Expand All @@ -65,6 +65,9 @@ It should work going back to the classic editor and forward to the block editor.

## Changelog

### [0.3.0] - 2022-06-23
* Follow link trails, add aka.ms.

### [0.2.4] - 2022-06-13
* Fix bugs with plaintext URLs at the end of a block.

Expand Down
12 changes: 10 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== Unwrap Shortlinks ===

Stable tag: 0.2.4
Stable tag: 0.3.0
Tags: urls, links, classicpress
Requires at least: 3.0
Tested up to: 6.0
Expand Down Expand Up @@ -31,6 +31,7 @@ Automatically expands URLs at the following known link shorteners when you save
* dlvr.it
* fb.me
* qr.ae
* aka.ms

== Installation ==

Expand All @@ -40,7 +41,7 @@ Install the plugin and activate it. The next time you paste a supported short UR

= What if the destination redirects to another link? =

At the moment it'll stop at the first one to avoid infinite redirect loops. But if the destination is another known shortener (say you had a t.co link that redirected to a bit.ly link), the next time you save the post, it will follow that one to its destination. TODO: I plan to make it follow a limited chain of known shorteners.
If the destination is another known URL shortener (ex. t.co pointing to bit.ly pointing to wp.me pointing to a blog post), it'll keep going up to 5 levels (to avoid infinite loops!) or until it gets a URL that isn't on the list.

= How do I add a shortener to the list? =

Expand All @@ -58,8 +59,15 @@ sudo setsebool -P httpd_can_network_connect true

Thanks to [igienger's post](https://wordpress.org/support/topic/error-curl-error-7-3/#post-12637512) on the WordPress support forums!

= What about compatibility? =

It should work going back to the classic editor and forward to the block editor. It even works on [ClassicPress](https://www.classicpress.net/).

== Changelog ==

= [0.3.0] - 2022-06-23 =
* Follow link trails, add aka.ms.

= [0.2.4] - 2022-06-13 =
* Fix bugs with plaintext URLs at the end of a block.

Expand Down
2 changes: 1 addition & 1 deletion unwrap-shortlinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Unwrap Shortlinks
Plugin URI: https://codeberg.org/kvibber/unwrap-shortlinks
Description: Follow shortened links (t.co, bit.ly, etc) and expand them so that your blog post will point directly to the destination.
Version: 0.2.4
Version: 0.3.0
Author: Kelson Vibber
Author URI: https://kvibber.com
License: GPLv2 or later
Expand Down

0 comments on commit 054fc09

Please sign in to comment.