Plugin Directory

Changeset 2941971


Ignore:
Timestamp:
07/23/2023 04:57:24 AM (2 years ago)
Author:
Kelson
Message:

0.3.3 remove TinyURL and confirm works with WP 6.3

Location:
unwrap-shortlinks/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • unwrap-shortlinks/trunk/readme.md

    r2877631 r2941971  
    11# Unwrap Shortlinks
    22
    3 Stable tag: 0.3.2 
     3Stable tag: 0.3.3 
    44Tags: urls, links, classicpress 
    5 Tested up to: 6.2 
     5Tested up to: 6.3 
    66Contributors: Kelson 
    77License: GPLv2 or later
     
    2121* wp.me
    2222* tmblr.co
    23 * tinyurl.com
    2423* goo.gl
    2524* dlvr.it
     
    2726* qr.ae
    2827* aka.ms
     28
     29NOTE: tinyurl.com has been removed from the list because they are blocking automated requests. (See changelog)
    2930
    3031## Installation
     
    6061## Changelog
    6162
     63### [0.3.3]
     64* tinyurl.com is screening requests using Cloudflare, and a simple curl request is no longer allowed through. Removing it from the list.
     65
    6266### [0.3.2] - 2022-10-29
    6367* Tested up through 6.1, clean up headers, no functional changes.
  • unwrap-shortlinks/trunk/unwrap-shortlinks.php

    r2807062 r2941971  
    44 Plugin URI: https://codeberg.org/kvibber/unwrap-shortlinks
    55 Description: Follow shortened links (t.co, bit.ly, etc) and expand them so that your blog post will point directly to the destination.
    6  Version: 0.3.2
     6 Version: 0.3.3
    77 Requires at least: 3.0
    88 Requires CP: 1.0
     
    1717
    1818function ktv_unwrap_shortlinks($content) {
    19     preg_match_all('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me|tinyurl\.com|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $content, $matches, PREG_PATTERN_ORDER);
     19    preg_match_all('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $content, $matches, PREG_PATTERN_ORDER);
    2020    foreach ($matches[1] as $link) {
    2121        $getlink = ktv_unwrap_shortlinks_replace($link, 5);
     
    3838        // TODO Is it also a redirector? Do we have iterations left?
    3939        // If so, try to follow that one!
    40         if( $countdown > 0 && preg_match('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me|tinyurl\.com|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $finalURL) ) {
     40        if( $countdown > 0 && preg_match('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $finalURL) ) {
    4141            return ktv_unwrap_shortlinks_replace($finalURL, $countdown - 1);
    4242        } else {
Note: See TracChangeset for help on using the changeset viewer.