Title: Plugin not working
Last modified: May 26, 2023

---

# Plugin not working

 *  [controvi](https://wordpress.org/support/users/controvi/)
 * (@controvi)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/)
 * In the file lh-force-lowercase-urls.php, line 83.
 * There is an if statement there that makes the use of the plugin impossible.
   Correct
   me if I am wrong but the following are my observations.
 * The if statement will always fail as the $simple_path will always be different
   from the $parts[‘path’].
   When the url /blog/Fake-Blog-Article is visited the 
   $simple_path will be “/blog/” and the $parts[‘path’] will be “Fake-Blog-Article”
 * if you then choose to do this:
 *     ```wp-block-code
       $parts['path'] = strtolower($simple_path).$filename;
       ```
   
 * The url will never be turned to lowercase.
   A little later you us an if statement
   for the following:
 *     ```wp-block-code
       if ($maybe_new_url !== $current_url){
       ```
   
 * This will always be false as these are the values you get when I run the test:
 *     ```wp-block-code
       $maybe_new_url = "https://domain.com/blog/Fake-Blog-Article"
       $current_url = "https://domain.com/blog/Fake-Blog-Article"
       ```
   
 * I don’t really see a reason why you would separate part of the path and add the
   old page name to it without lowercasing it.
   If there is a reason for it I would
   love to learn of it. Mostly likely I don’t know what you already did in development
   so don’t take this all as criticism but as something I noticed and with changes
   fixed for my use case.If this was something you missed I hope it helps.Otherwise
   looking forward to hearing I am wrong haha.Regards
    -  This topic was modified 3 years ago by [controvi](https://wordpress.org/support/users/controvi/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16771423)
 * The plugin works, see example here:
 * [http://princesparktouch.com/ABOUT/](http://princesparktouch.com/ABOUT/)
 * redirects to
 * [https://princesparktouch.com/about/](https://princesparktouch.com/about/)
 * The reason for the logic is that filenames can exist with upper and lowercase,
   ie ABOUT.html can exist in the same directory as about.html
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16771426)
 * Note I’ve resolved the post but will still monitor the thread and re open if 
   appropriate
 *  Thread Starter [controvi](https://wordpress.org/support/users/controvi/)
 * (@controvi)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16772202)
 * Ah ok, good point. 
   I did not take into account that you were thinking of file
   names as well.
 * Then maybe you could testing for file extension in the url. Some regex to see
   if the url ends with “(dot)[something]” and if so don’t lowercase it.
   For normal
   WordPress pages there won’t be a file to browse to as it will always be loaded
   through the index.php.And as far as I know, WordPress doesn’t do extension at
   the end of url’s.But that is just a, from the top of my head, idea.thanks for
   the reply ^_^
 *  Thread Starter [controvi](https://wordpress.org/support/users/controvi/)
 * (@controvi)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16772207)
 * Ow and I just thought of something but haven’t checked so sorry if I am wrong.
   
   But the site you used as example has a trailing slash. Could be that that is 
   what is causing the issue.The site I work on doesn’t have that. Could be that
   that causes your check for the simple_url to fail for me.
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16772654)
 * Yes it could, WordPress natively adds trailing slashes to permalinks, but guess
   you have a reason why your not doing that. I’ll add the logic you outlined that
   looks at final part of the url to determine if has a file extension
 * Btw WordPress does natively serve the robots.txt and can use other extensions
   with plugins.
 * I have reopened the issue
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16772657)
 * Could be a few weeks until I’ve updated the plugin though
 *  Thread Starter [controvi](https://wordpress.org/support/users/controvi/)
 * (@controvi)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16772958)
 * That’s fine 🙂 
   I could make it work for my case with a small change so it is
   no problem.
 * Will update when I see it come in ^_^

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Plugin not working’ is closed to new replies.

 * ![](https://ps.w.org/lh-force-lowercase-urls/assets/icon-128x128.png?rev=2205670)
 * [LH Force Lowercase URLs](https://wordpress.org/plugins/lh-force-lowercase-urls/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lh-force-lowercase-urls/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lh-force-lowercase-urls/)
 * [Active Topics](https://wordpress.org/support/plugin/lh-force-lowercase-urls/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lh-force-lowercase-urls/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lh-force-lowercase-urls/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [controvi](https://wordpress.org/support/users/controvi/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/plugin-not-working-1198/#post-16772958)
 * Status: not resolved