Skip to content

TheCodeCompany/wp-force-lowercase-urls

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

=== WP Force Lowercase URLs ===
Contributors: joshbuchea
Donate link: https://paypal.me/joshbuchea
Tags: 301, redirect, lowercase, url, seo, canonical
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 3.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Perform a 301 redirect from an uppercase URL to the lowercase version for all non-admin URLs with improved security and performance.

== Description ==

WP Force Lowercase URLs automatically redirects uppercase URLs to their lowercase equivalents using 301 (permanent) redirects. This plugin is essential for SEO and maintaining consistent URL structures across your WordPress site.

**Key Features:**

* **SEO Optimized**: Uses 301 redirects to preserve search engine rankings
* **Security Enhanced**: Implements proper input sanitization and security headers
* **Performance Optimized**: Efficient URL processing with minimal overhead
* **File Extension Aware**: Automatically skips files with extensions (case-sensitive files)
* **Query String Preserved**: Maintains query parameters during redirects
* **Admin Safe**: Only affects frontend URLs, never interferes with admin functionality

**How It Works:**

The plugin checks each frontend request and automatically redirects URLs containing uppercase letters to their lowercase equivalents. For example:
- `/About-Us` → `/about-us`
- `/Products/Category` → `/products/category`
- `/page?param=Value` → `/page?param=Value` (query strings preserved)

**Security Features:**

* Input sanitization for all server variables
* Security headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection)
* Proper WordPress coding standards compliance
* Protection against direct file access

**Performance Benefits:**

* Early hook execution (priority 1 on 'init')
* Efficient regex patterns
* Minimal database queries
* Optimized for modern PHP versions

**Compatibility:**

* WordPress 5.0+
* PHP 7.4+
* Tested with WordPress 6.4
* Compatible with all major themes and plugins

Please help by reporting any bugs or feature requests at the link below.

**Bugs:**
* Report at: [Github Issue Tracker](https://github.com/joshbuchea/wp-force-lowercase-urls/issues)

**Questions/Comments:**
* http://joshbuchea.com/

== Installation ==

= Automatic Installation =
1. In your WordPress Dashboard go to "Plugins" → "Add Plugin"
2. Search for "WP Force Lowercase URLs"
3. Install the plugin by pressing the "Install" button
4. Activate the plugin by pressing the "Activate" button

= Manual Installation =
1. Upload the `/wp-force-lowercase-urls/` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress

= After Installation =
The plugin works automatically once activated. No configuration is required.

== Frequently Asked Questions ==

= Does this plugin affect admin URLs? =
No, the plugin only affects frontend URLs. Admin URLs are completely ignored.

= Will this break my existing links? =
No, the plugin uses 301 redirects which tell search engines that the old URL has permanently moved to the new lowercase URL. This preserves SEO value.

= Does it work with custom post types and taxonomies? =
Yes, the plugin works with all WordPress URL structures including custom post types, taxonomies, and custom endpoints.

= What about files with extensions? =
The plugin automatically skips URLs containing file extensions (like .php, .html, .css, .js, etc.) since these are case-sensitive.

= Is this plugin compatible with caching plugins? =
Yes, the plugin works well with all major caching plugins. The redirects happen early in the WordPress loading process.

= Does it work with multisite? =
Yes, the plugin is compatible with WordPress multisite installations.

== Screenshots ==

1. No configuration required - works automatically
2. SEO-friendly 301 redirects
3. Secure and performant

== Changelog ==

= 3.0.0 =
* Complete rewrite with modern WordPress coding standards
* Improved security with input sanitization and security headers
* Better performance with optimized URL processing
* Enhanced file extension detection
* Added proper activation/deactivation hooks
* Updated to require WordPress 5.0+ and PHP 7.4+
* Added comprehensive documentation
* Improved error handling and edge case management

= 2.1.0 =
* Bug fixes and minor improvements

= 2.0.0 =
* Ground up rewrite
* URLs with params are now converted & redirected to lowercase as expected

= 1.0.0 =
* Initial commit

== Upgrade Notice ==

= 3.0.0 =
This is a major update with significant improvements to security, performance, and compatibility. Please test on a staging site before updating production.

== Developer Notes ==

The plugin follows WordPress coding standards and best practices:

* Uses singleton pattern for main class
* Proper sanitization of all inputs
* Comprehensive error handling
* Well-documented code with PHPDoc blocks
* Activation/deactivation hooks
* Security headers implementation
* Efficient URL processing algorithms

For developers, the plugin provides:
* Clean, maintainable code structure
* Proper WordPress hooks and filters
* Security-first approach
* Performance optimizations

About

A WordPress Plugin to redirect uppercase URLs to lowercase.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%