WP Manifestindependent plugin directory
manifest / utilities / shorten-url-wordpress-plugin

Shorten URL with Delayed Redirect

Create shortened URLs with customizable delayed redirects and countdown timers

by Sagor Chowdhuri · github.com/sagorpi/shorten-url-wordpress-plugin · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/sagorpi/shorten-url-wordpress-plugin/archive/refs/heads/main.zip

Shorten URL with Delayed Redirect - WordPress Plugin

A WordPress plugin that allows you to create shortened URLs with customizable delayed redirects and countdown timers.

Features

  • URL Shortening: Create shortened URLs that map to longer destination URLs
  • Delayed Redirect: Redirect visitors after a customizable delay (0-60 seconds)
  • Countdown Timer: Visual countdown timer showing remaining seconds
  • Customizable Content: Each shortened URL can have:
    • Custom page title
    • Meta description for SEO
    • Featured image
    • Static "Soon...." heading
  • Click Tracking: Track the number of clicks for each shortened URL
  • Easy Management: User-friendly admin interface to create and manage URLs

Installation

Method 1: Install from Git Repository (Recommended)

Using Git Updater Plugin:

  1. Install the Git Updater plugin
  2. Go to PluginsAdd NewGit Updater Install
  3. Enter repository URL: https://github.com/sagorpi/shorten-url-wordpress-plugin
  4. Click Install and Activate

Using WP-CLI:

wp plugin install https://github.com/sagorpi/shorten-url-wordpress-plugin/archive/refs/heads/main.zip --activate

Using Git Clone:

cd wp-content/plugins
git clone https://github.com/sagorpi/shorten-url-wordpress-plugin.git
wp plugin activate shorten-url-wordpress-plugin

Using Composer:

composer require sagorpi/shorten-url-redirect:dev-main

📖 For detailed Git installation instructions, see GIT-INSTALLATION.md

Method 2: Manual Installation

  1. Download or clone this repository
  2. Copy the entire shorten-url-wordpress-plugin folder to your WordPress plugins directory:
    /wp-content/plugins/
  3. Log in to your WordPress admin panel
  4. Navigate to PluginsInstalled Plugins
  5. Find "Shorten URL with Delayed Redirect" in the list
  6. Click Activate

Method 3: ZIP Upload

  1. Download ZIP: https://github.com/sagorpi/shorten-url-wordpress-plugin/archive/refs/heads/main.zip
  2. Log in to your WordPress admin panel
  3. Navigate to PluginsAdd New
  4. Click Upload Plugin
  5. Choose the ZIP file and click Install Now
  6. Click Activate Plugin

Usage

Creating a Shortened URL

  1. In WordPress admin, go to Short URLsAdd New
  2. Fill in the required fields:
    • Short Code: Unique identifier for your URL (e.g., "promo2024")
    • Destination URL: Where visitors will be redirected
    • Redirect Delay: Number of seconds to wait (0-60)
    • Page Title: Title for the redirect page
    • Meta Description: (Optional) SEO description
    • Featured Image: (Optional) Upload an image to display
  3. Click Create Shortened URL

Managing URLs

  • View all shortened URLs: Short URLs menu
  • Edit a URL: Click Edit next to any URL in the list
  • Delete a URL: Click Delete (with confirmation)
  • Track clicks: View the Clicks column in the URL list

Accessing Shortened URLs

Your shortened URLs will be in this format:

https://yoursite.com/go/your-short-code

For example, if your short code is "promo2024":

https://yoursite.com/go/promo2024

Testing the Plugin

Test 1: Create a Basic Shortened URL

  1. Go to Short URLsAdd New
  2. Enter the following:
    • Short Code: test
    • Destination URL: https://wordpress.org
    • Redirect Delay: 5
    • Page Title: Test Redirect
  3. Click Create Shortened URL
  4. Visit https://yoursite.com/go/test in your browser
  5. You should see a countdown from 5 seconds, then be redirected to WordPress.org

Test 2: Create URL with Image

  1. Create another shortened URL with an image
  2. Upload a featured image
  3. Visit the shortened URL
  4. Verify the image displays correctly on the redirect page

Test 3: Verify Click Tracking

  1. Visit a shortened URL multiple times
  2. Go to Short URLs in admin
  3. Check that the click count increases

File Structure

shorten-url-wordpress-plugin/
├── shorten-url-redirect.php          # Main plugin file
├── composer.json                     # Composer configuration
├── .gitignore                        # Git ignore rules
├── README.md                         # Main documentation
├── GIT-INSTALLATION.md               # Git installation guide
├── SETUP-GIT-REPOSITORY.md           # Repository setup guide
├── QUICK-INSTALL.md                  # Quick install reference
├── includes/
│   ├── class-sur-database.php        # Database operations
│   ├── class-sur-admin.php           # Admin interface
│   └── class-sur-redirect.php        # Redirect handler
├── templates/
│   ├── admin-list.php                # URL list page
│   ├── admin-add-edit.php            # Add/edit form
│   └── redirect-page.php             # Redirect countdown page
└── assets/
    ├── css/
    │   ├── admin.css                 # Admin styles
    │   └── frontend.css              # Redirect page styles
    └── js/
        ├── admin.js                  # Admin JavaScript
        └── frontend.js               # Frontend JavaScript

Requirements

  • WordPress 5.0 or higher
  • PHP 7.0 or higher
  • MySQL 5.6 or higher

Troubleshooting

Shortened URLs return 404 errors

  1. Go to SettingsPermalinks
  2. Click Save Changes (this flushes the rewrite rules)
  3. Try accessing your shortened URL again

Images not uploading

  • Check that your WordPress media upload directory has proper write permissions
  • Verify your PHP upload_max_filesize setting is adequate

Countdown not working

  • Check that JavaScript is enabled in your browser
  • Check browser console for any JavaScript errors

Security Features

  • Nonce verification for all form submissions
  • Capability checks (only administrators can manage URLs)
  • Input sanitization and validation
  • SQL injection prevention using prepared statements
  • XSS protection through proper escaping

Support

For issues, questions, or contributions, please contact the plugin author.

License

This plugin is licensed under the GPL v2 or later.

Changelog

Version 1.0.0

  • Initial release
  • URL shortening functionality
  • Delayed redirect with countdown timer
  • Customizable page content
  • Click tracking
  • Admin interface