Giter VIP home page Giter VIP logo

kvibber / unwrap-shortlinks Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 38 KB

Plugin for WordPress and ClassicPress to follow shortened links (t.co, bit.ly, etc) and expand them so that your blog post will point directly to the destination.

License: GNU General Public License v2.0

Shell 17.65% PHP 82.35%
blogging classicpress classicpress-plugin url-unshortener wordpress wordpress-plugin

unwrap-shortlinks's Introduction

Unwrap Shortlinks

Stable tag: 0.3.3
Tags: urls, links, classicpress
Tested up to: 6.5
Contributors: Kelson
License: GPLv2 or later

Follows shortened links (t.co, bit.ly, etc) and expands them so that your blog post will point directly to the destination.

Description

Automatically expands URLs at the following known link shorteners when you save a post:

  • t.co
  • bit.ly
  • ow.ly
  • j.mp
  • is.gd
  • trib.al
  • buff.ly
  • wp.me
  • tmblr.co
  • goo.gl
  • dlvr.it
  • fb.me
  • qr.ae
  • aka.ms

NOTE: tinyurl.com has been removed from the list because they are blocking automated requests. (See changelog)

Installation

Install the plugin and activate it. The next time you paste a supported short URL into a post, it will be updated when the post is saved.

Frequently Asked Questions

What if the destination redirects to another link?

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?

It's not supported yet, but I plan on adding an options page for it.

I'm running on a local server and this doesn't do anything!

Most likely your system is configured to block your local webserver from making outgoing connections. This is a sensible default for security! Depending on your system, it may be blocked by a local or network firewall. If you're running Fedora Workstation with SELinux (like I am), this will enable it:

sudo setsebool -P httpd_can_network_connect true

Thanks to igienger's post 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.

Changelog

[0.3.3]

  • tinyurl.com is screening requests using Cloudflare, and a simple curl request is no longer allowed through. Removing it from the list.

[0.3.2] - 2022-10-29

  • Tested up through 6.1, clean up headers, no functional changes.

[0.3.1] - 2022-09-01

  • Update headers for new ClassicPress plugin directory. No changes affecting WordPress

[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.

[0.2.3] - 2022-06-10

  • Fix bugs with tinyurl.com and URLs inside HTML links. (Plaintext URLs were working fine.)

[0.2.2] - 2022-01-29

  • Initial release based on the code I've been running locally for years, plus changes requested by the WordPress plugin review team.

Source on Codeberg.
Mirror on GitHub.
Plugin page at WordPress.
Plugin page at ClassicPress.

(c) 2016-2024 Kelson Vibber

unwrap-shortlinks's People

Contributors

kvibber avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.