• doffine

    (@doffine)


    Hi,

    we recently came across a bug when using “WP Customer Area” in combination with the Plugin “Clean Image Filenames”.

    We use both “WP Customer Area” and “Clean Image Filenames” so an admin user can upload files for other users to download in their own specific user area. We obviously need “Clean Image Filenames” to keep the file names as clean as possible.

    BUT: In the last two weeks we encountered issues while uploading (any kind of) files!

    In the backend in “WP Customer Area“ we add a new post and upload a file. We select the file from our computer and it’s uploaded. You visually see that the file should now be uploaded and available on the server. But the file is nowhere to be found on the server and can’t be downloaded or viewed by any user (because it wasn’t really uploaded!). We checked everything via FTP. Once we deactivate “Clean Image Filenames” and upload the file again, the files appears on the server and can be viewed and downloaded.

    We are using WordPress 5.9 on PHP 7.4.

    Of course we already asked the plugin author of “Clean Image Filenames“ and they said this: “The plugin is working as expected with WordPress core. It is hooking into core actions that runs when files are uploaded, for example wp_handle_upload_prefilter and add_attachment. Perhaps the WP Customer Area plugin is also using these actions or doing something else when files are uploaded that is not compatible with the Clean Image Filenames plugin. I would suggest you look into the other plugin and investigate what is happening when files are uploaded and take it from there.“

    See support ticket here: https://www.ads-software.com/support/topic/incompatibility-with-other-plugin-wp-customer-area/

    Is this a compatibility issue and can this be fixed?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter doffine

    (@doffine)

    Hello @foobarstudio, @vprat, @tlartaud,

    since we didn’t receive any response in the last three weeks we kindly want to ask you again about the problem described above.

    There obviously is an incompatibility of your plugin with the plugin “Clean Image Filenames” that has 40,000+ active installations. Both of your plugins recently received updates so both plugins can be considered as “alive”. As we wrote above the other plugin’s author already answered (immediately) and gave some technical details which might help to understand where the problem is.

    Can you tell us anything about this?

    For us as end users it is not nice when there is an incompatibility between two plugins and both authors point at each other with us sitting in between and having the problem not solved.

    It is even worse when we try our best to describe the problem, clearly communicate all we have to the involved parties in a detailed way and one author points to the other but the other one not even reacts.

    Best would be that both of you would talk to each other and find a solution for the incompatibility without us “not-knowing end users” having to try to effect something in between.

    Please don’t get us wrong, we are so happy with your great plugin and are thankful for your work. But please also understand our unsatisfying situation.

    Greetings,
    -doffine

    Plugin Contributor Foobar Studio

    (@foobarstudio)

    Hi,

    I missed that thread, sorry.

    Indeed the plugin is alive.

    I cannot tell much about what is happening as I have never used the plugin you mention.

    From what I see in their replies, they are hooking into wp_handle_upload_prefilter which may be the reason why our plugin does not find its files afterwards.

    I currently cannot dedicate much time to supporting compatibility with that plugin, sorry. As WP Customer Area is open-source, we will however welcome any pull request on the repository (public, at gitlab.com).

    If you are in a hurry, and as I see that you are a professional selling websites, I can offer to help your developer to find his way into our code by pointing out the files and classes he may have a look at in the first place.

    Otherwise, we will have a look at that issue later on, but I cannot yet give any timeframe.

    Regards,

    Thread Starter doffine

    (@doffine)

    Hello @foobarstudio,

    thank you very much for coming back to us.

    Unfortunately we don’t have the skills and also no developer to patch your plugin on our own. If you don’t have the time to support compatibility with the other plugin, could you please consider the following?

    With your plugin end users are able to upload files. We all know if you let end users upload anything, they literally do upload anything. Uploading files with problematical characters in their file names can trigger all kinds of issues. This starts from upper and lower case characters in different file systems and goes to backup and restore processes or a change of the server (OS).

    So if you let end users upload files to WordPress it should be possible that these file’s names are automatically sanitized. Ideally all characters should be replaced that are no (lower case) letters, numbers, periods, hyphens and underscores.

    If it is too much work to support compatibility with the other plugin, it might be much easier for you to add a small function that can be switched on or off that simply sanitizes uploaded file names just within your plugin during the upload process. I think this would be an advancement for your plugin, too.

    Would that be possible?

    Thanks again so much, greetings,
    -doffine

    Plugin Contributor Foobar Studio

    (@foobarstudio)

    Hi,

    We already have hooks to handle file names

    Here is the file in our plugin managing the uploads: https://gitlab.com/wp-customerarea/plugins/customer-area/-/blob/master/src/php/core-addons/private-file/private-file-default-handlers.class.php

    Line 40 and 44 are the plugin hooks which are triggered when an upload is made.

    You will see that we internally us the wp_unique_filename function from WordPress core.

    That core function exposes a filter which you could use to sanitize even further your file names:

        
    return apply_filters( 'wp_unique_filename', $filename, $ext, $dir, $unique_filename_callback, $alt_filenames, $number );
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Incompatibility with other plugin “Clean Image Filenames”’ is closed to new replies.