godaddy-wordpress / wc-plugin-framework

The official SkyVerge WooCommerce plugin framework
Other
138 stars 42 forks source link

Long filenames can cause fatal errors in some Windows environments #294

Open tamarazuk opened 6 years ago

tamarazuk commented 6 years ago

Depending on the length of a site's root path, the framework's long filenames could result in fatal errors on Windows servers due to the maximum path length limitation.

I believe the longest file path in the framework is woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php which is why this is tagged with payment-gateway.

Other than renaming our files, is there any other way we can address this? Is there some way to increase that limitation at a server-level so we can add something to our documentation and support saved replies?

I recall I had a customer back in the day who downloaded the plugin and edited the file names with each update. This is definitely something I'd like to avoid recommending.

JulieSkyVerge commented 6 years ago

I've seen this issue most recently reported in HS convo 89114 by a Windows user developing locally, with regards to the Bambora integration, where this partial path takes up 182/260 characters all on its own:

woocommerce-gateway-beanstream/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php

ChaseWiseman commented 6 years ago

Looks like there are some config steps listed here: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation

I guess the limitation is lifted in Windows 10, but it's opt-in. Perhaps we can get one of these merchants to try that & cook up a support reply?

This won't be an issue down the line if we move to autoloading with proper PSR-4, but for now is just the nature of the WP naming standard.

madriverweb commented 5 years ago

Why are we having to deal with this problem? I submitted a ticket to SkyVerge through WooCommerce. The file is one letter too long. SkyVerge should fix this and be aware that it causes us this problem. I came here to see if other people were having the same problem and if the file might simply be available here.

madriverweb commented 5 years ago

And this has been a problem for over a year? The new plugin won't activate in our WP admin either, which is why I've attempted the download, unzip, and upload. You have gifted my client the plugin that replaces AIM, but they are paying me hundreds of dollars to try to install it. Can't you just make shorter filenames and upload a newer version of the plugin?

unfulvio commented 5 years ago

hey @madriverweb what's the email address you've used to contact SkyVerge?

Is your client using a Windows 10-based server or older? Apparently the issue may no longer exists in newer machines: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation

When the issue was originally reported here, we were still using non-namespaced class names in the framework (due to PHP 5.2 support requirement). We have since moved to namespace support in newer versions of the Framework and plugins as now the minimum required version is PHP 5.6 in WooCommerce. We didn't update the file names to match PSR standards as we're not fully leveraging class autoloading yet; shortening file names I suppose it's something we could look at again. Seems there weren't reports since the ones mentioned in OP probably due to recent Microsoft Servers improved filename handling and majority of servers running UNIX systems where the limitation never existed.

Please let me know the email address which you have used to contact SkyVerge, we can continue the conversation there, if you don't mind.

madriverweb commented 5 years ago

Hi Fulvio,

Thank you for your response. I received a response in parallel from SkyVerge via my client’s email address, copied above. I created an admin for that tech and he is going to try to resolve our problem.

I may not be able to follow up on this until next week because I’ll be out of town.

Thanks,

Darlene

From: Fulvio Notarstefano [mailto:notifications@github.com] Sent: Sunday, September 01, 2019 10:22 PM To: skyverge/wc-plugin-framework wc-plugin-framework@noreply.github.com Cc: madriverweb google@madriverweb.com; Mention mention@noreply.github.com Subject: Re: [skyverge/wc-plugin-framework] Long filenames can cause fatal errors in some Windows environments (#294)

hey @madriverweb https://github.com/madriverweb what's the email address you've used to contact SkyVerge?

Is your client using a Windows 10-based server or older? Apparently the issue may no longer exists in newer machines: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation

When the issue was originally reported here, we were still using non-namespaced class names in the framework (due to PHP 5.2 support requirement). We have since moved to namespace support in newer versions of the Framework and plugins as now the minimum required version is PHP 5.6 in WooCommerce. We didn't update the file names to match PSR standards as we're not fully leveraging class autoloading yet; shortening file names I suppose it's something we could look at again. Seems there weren't reports since the ones mentioned in OP probably due to recent Microsoft Servers improved filename handling and majority of servers running UNIX systems where the limitation never existed.

Please let me know the email address which you have used to contact SkyVerge, we can continue the conversation there, if you don't mind.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/skyverge/wc-plugin-framework/issues/294?email_source=notifications&email_token=AA7QSTCIQLIXAOA34235BFA5CNFSM4FB2CSM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHADS2ZLOORPWSZGOD5UREZQ#issuecomment-526979686 , or mute the thread https://github.com/notifications/unsubscribe-auth/AA7QSTHKVEJILAADS22GFANCNFSM4FB2CSMQ .

unfulvio commented 5 years ago

@madriverweb gotcha, thanks for the update, we are going to follow up through support by email (just saw the messages)