From 054fc090fce5c5b2fbc0f9ba2e706c617e332678 Mon Sep 17 00:00:00 2001 From: Kelson Vibber Date: Thu, 23 Jun 2022 22:12:01 -0700 Subject: [PATCH] update Readme and bump version to 0.3.0 --- linkchain.txt | 6 ++++++ readme.md | 7 +++++-- readme.txt | 12 ++++++++++-- unwrap-shortlinks.php | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/linkchain.txt b/linkchain.txt index a9ec1e3..434ddf5 100644 --- a/linkchain.txt +++ b/linkchain.txt @@ -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 @@ -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 / diff --git a/readme.md b/readme.md index c6215ba..02a48d3 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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? @@ -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. diff --git a/readme.txt b/readme.txt index 9f73838..d7cd422 100644 --- a/readme.txt +++ b/readme.txt @@ -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 @@ -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 == @@ -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? = @@ -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. diff --git a/unwrap-shortlinks.php b/unwrap-shortlinks.php index 8d6cfbb..4805a89 100644 --- a/unwrap-shortlinks.php +++ b/unwrap-shortlinks.php @@ -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