WPIntell

Source evidence

Plugin not working

LH Force Lowercase URLs · support · 2023-05-26T12:56:00+00:00

complaintsentiment
mediumseverity
0.86relevance
7replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 25 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
controvi unresolved
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: $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: if ($maybe_new_url !== $current_url){ This will always be false as these are the values you get when I run the test: $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, 1 month ago by controvi . The plugin works, see example here: http://princesparktouch.com/ABOUT/ redirects to 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 Note I’ve resolved the post but will still monitor the thread and re open if appropriate 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 ^_^ 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. 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 Could be a few weeks until I’ve updated the plugin though 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 ^_^

Comments

7 shown
shawfactor 2023-05-26T13:49:00+00:00

The plugin works, see example here: http://princesparktouch.com/ABOUT/ redirects to 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

shawfactor 2023-05-26T13:50:00+00:00

Note I’ve resolved the post but will still monitor the thread and re open if appropriate

controvi 2023-05-26T19:12:00+00:00

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 ^_^

controvi 2023-05-26T19:14:00+00:00

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.

shawfactor 2023-05-27T03:39:00+00:00

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

shawfactor 2023-05-27T03:40:00+00:00

Could be a few weeks until I’ve updated the plugin though

controvi 2023-05-27T09:20:00+00:00

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 ^_^