Instant Redirect Pro
A premium WordPress plugin to set and manage URL redirections (301, 302, 307, 308, 410) dynamically via AJAX, structured in a clean MVC architecture.
by Aashish Kumar Jangid · github.com/a4ashishjangid/instant-redirect-pro
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/a4ashishjangid/instant-redirect-pro/archive/refs/heads/main.zipReadme
Instant Redirect Pro
Instant Redirect Pro is a robust, premium WordPress plugin designed to set, manage, and monitor custom URL redirections (301, 302, 307, 308, and 410) dynamically via a clean, modern AJAX-driven interface. Built on a strict MVC (Model-View-Controller) architecture, it offers performance-optimized redirection matching and comprehensive settings for full control.
🚀 Key Features
- AJAX-Driven Dashboard: Manage redirection rules seamlessly without page reloads.
- Support for Standard Redirection Types:
301 Moved Permanently(SEO friendly)302 Found(Temporary)307 Temporary Redirect308 Permanent Redirect410 Gone(Tells search engines the page is permanently deleted to speed up de-indexing)
- Live Analytics: Track hit counts dynamically for each redirection rule to monitor traffic redirection performance.
- Flexible Query Parameter Settings:
- Ignore query parameters (redirect regardless of query string)
- Strict matching (require exact query string match)
- Pass-through query parameters (forward parameters to target URL)
- Case-Insensitive Redirections: Optional toggle to match paths regardless of letter casing.
- CSV Import & Export:
- Batch import rules via CSV files with drag-and-drop support.
- Live CSV pre-validation and interactive preview table highlighting errors, warnings, and overwrite/skip statuses before applying changes.
- Export the active redirection database to a CSV file in one click.
- Modern Interface Styling: Features a clean, responsive layout using modern typography and smooth interactions.
🛠️ Installation & Setup
- Upload the Plugin:
- Upload the
instant-redirect-profolder to your WordPress site's/wp-content/plugins/directory.
- Upload the
- Activate the Plugin:
- Go to the Plugins menu in your WordPress Admin Dashboard.
- Locate Instant Redirect Pro and click Activate.
- Access the Dashboard:
- Navigate to Tools > Instant Redirect Pro in your WordPress Admin sidebar.
📂 Project Structure
The plugin is structured following WordPress best practices and clean Object-Oriented MVC principles:
instant-redirect-pro/
├── README.md # Plugin documentation and user guide
├── instant-redirect-pro.php # Main plugin entry point and initialization
├── includes/
│ ├── class-irp-model.php # Handles DB migration, CRUD operations & matching logic
│ ├── class-irp-view.php # Renders the admin panel UI markup and forms
│ └── class-irp-controller.php # Coordinates action hooks, enqueues assets, AJAX, and CSV logic
└── assets/
├── css/
│ └── admin.css # Dashboard responsive styling and animations
└── js/
└── admin.js # AJAX requests, CSV parsing, preview rendering & event handlers
💾 Database Schema
Upon activation, the plugin automatically creates a custom database table (prefixed with your WordPress database prefix, e.g., wp_custom_redirections) using the following schema:
| Column | Type | Description |
|---|---|---|
id |
BIGINT (Primary Key) |
Auto-incrementing unique identifier. |
url_from |
VARCHAR(255) |
The source path to match (e.g., /old-page). |
url_to |
VARCHAR(255) |
The target path/URL to redirect to. (Empty for 410). |
status_code |
VARCHAR(5) |
The HTTP status code (301, 302, 307, 308, 410). |
hits |
BIGINT |
Total redirection requests matched. Defaults to 0. |
created_at |
DATETIME |
Timestamp of when the redirection rule was added. |
📖 Usage Guide
Adding a Redirection Rule
- Open the dashboard under Tools > Instant Redirect Pro.
- In the Add New Redirection Rule form:
- Enter the Source URL/Path (e.g.,
/services/old-name). Relative paths will automatically prepend a slash if omitted. - Select the desired Status Code.
- If not using
410 Gone, enter the Target URL/Path (e.g.,/new-servicesorhttps://external-domain.com/page).
- Enter the Source URL/Path (e.g.,
- Click Add Redirection. The table will reload dynamically to show the new rule.
Import from CSV
- Navigate to the Import/Export tab.
- Drag and drop your
.csvfile into the upload zone, or click to choose a file.- Required columns: The CSV must contain at least
url_fromandstatus_codecolumns. An optionalurl_tois required unless the status code is410.
- Required columns: The CSV must contain at least
- An interactive validation preview table will appear showing:
- OK status for new valid rules.
- Overwrite / Skip badges for rules matching existing paths depending on the "Overwrite existing rules" setting.
- Error status for missing paths or invalid codes.
- Click Confirm Import to save the valid rules.
Export to CSV
- Navigate to the Import/Export tab.
- Click Download CSV. The system will generate and download a clean CSV file containing your active redirection database.
🔒 Security Measures
- Nonce Verification: Every AJAX request (fetching, saving, deleting, importing) is fully validated using WordPress secure nonces.
- Capabilities Checking: Operations are restricted to users with the
manage_optionscapability to ensure only administrators can manage redirections. - SQL Injection Prevention: All queries to the custom database table utilize standard WordPress
$wpdb->prepare()bindings. - Data Sanitization & Escaping: Source paths are standardized and stripped of absolute host prefixes where appropriate, and all output rendering is fully escaped.
📝 License
This project is licensed under the GPL2 License.