• Resolved xxxLesy

    (@xxxlesy)


    Testing the free version. Generally the plugin works, but requires quite a bit to figure it out.

    • Doesn’t work in Firefox (error “File format not allowed” when importing sample csv). Works in Chrome.
    • The sample .csv, provided in instructions, doesn’t work (error “Error: “sku” or “quantity” columns not found.”). It appears to be sensitive to files, created with Excel. I had to use Copilot to clean the file of BOM encoding, spaces and normilize line ends to LF.
    • After the file loads to 100 %, it would be nice, if it could reload the page, because you just get stuck on 100 % with no notification, that your cart was successfully imported. You just have to guess it’s done and reload the cart.

    The second issue is major a problem. Perhaps some error handling to ignore such invisible symbols could be added.

    • This topic was modified 1 month, 4 weeks ago by xxxLesy.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Atakan Au

    (@atakanau)

    Thank you for your detailed feedback and for testing the plugin. Iit’s really helpful!

    I’ve just released a development version (1.0.2) that directly addresses the issues you mentioned:

    • Improved CSV parsing to better handle UTF-8 BOM, line endings (CRLF/LF), invisible characters, and header detection—should resolve the “sku/quantity not found” errors and Excel-related problems.
    • Added a clear success message after import completes (no more guessing at 100%, and refresh the cart badge where possible).

    Regarding Firefox: The “File format not allowed” error might be related to a specific stable version or extension/security setting on your end (I tested successfully with the Developer Edition).

    You can download and install this dev version manually from the Advanced tab here.<br>

    Please give it a try and let me know how it works for you. I’ll release it as the official update based on your feedback.

    Thanks again!

    • This reply was modified 1 month, 3 weeks ago by Atakan Au.
    Thread Starter xxxLesy

    (@xxxlesy)

    Thanks for the fast fixes Atakan. Error handling works great now. No issues with imports.

    It doesn’t automatically reload after import, but I used Loco translate to translate the successfully imported message and just added a link to cart to it. (“Items were successfully imported. Please visit your Cart to see them.”). Perhaps you should add something similar to the english version.

    As for Firefox issue. I disabled Solid Security plugin and no change. I don’t see any Plesk security settings that would affect this. Copilot says different browsers report different mime types.

    Chrome: usually text/csv. [https://support.mozilla.org/en-US/questions/1401889], [https://stackoverflow.com/questions/78036002/differences-in-mime-type-between-firefox-and-chrome-when-uploading-csv]
    Firefox (especially Windows): often application/vnd.ms-excel or even text/plain for .csv files, especially those originating from Excel. [https://support.mozilla.org/en-US/questions/1401889], [https://github.com/filamentphp/filament/discussions/10556]

    MDN also emphasises that accept attribute on is just a hint and not a validation – server check is neccessary.

    Plugin Author Atakan Au

    (@atakanau)

    Thank you for the additional info. To help me pinpoint exactly what’s happening on your setup, could you please add a simple debug log line manually? It will record the detected MIME type when the error occurs.

    Here’s how:

    1. Go to Plugins > Plugin File Editor (or directly: your-site.com/wp-admin/plugin-editor.php).

    2. Select the plugin Automated Import Products to Cart from the dropdown and click Select.

    3. Edit the main plugin file: auto-import-products-cart-dragdropfile/auto-import-products-cart-dragdropfile.php.

    4. Find line 203 (the else block that sets the “File format not allowed” message).

    5. Replace this part:

    else{
    	$error_message = __('File format not allowed', 'auto-import-products-cart-dragdropfile');
    }

    with this:

    else{
    	$error_message = __('File format not allowed', 'auto-import-products-cart-dragdropfile');
    	// Log the detected file MIME-type for debugging:
    	$this->log( array( 'detected_mime_type' => $my_file['type'], 'file_tmp_name' => $my_file['tmp_name'] ), 'mime_type' );
    }

    6. Save the changes.

    After adding the code, try uploading the CSV again in Firefox. The error will still appear, but the MIME type will now be logged. The plugin will automatically save a log file directly in its own folder, for example:
    wp-content/plugins/auto-import-products-cart-dragdropfile/log-wcdf-2025-12-19.txt
    Open that file and let me know what MIME type is recorded there. This will make it much easier to fix the Firefox issue. Thanks!

    Thread Starter xxxLesy

    (@xxxlesy)

    — 10:00:34 —
    mime_type:: Array
    (
    [detected_mime_type] => application/vnd.ms-excel
    [file_tmp_name] => /tmp/phpe0cu2X
    )

    — 10:01:15 —
    mime_type:: Array
    (
    [detected_mime_type] => application/vnd.ms-excel
    [file_tmp_name] => /tmp/phpFOpeO0
    )

    Plugin Author Atakan Au

    (@atakanau)

    Version 1.0.2 updated. You can re download and install it.

    Line 169:

    $allowed_mime_types = array(
    	"text/csv",
    	"application/csv",
    	// Added for Firefox/Excel compatibility:
    	"application/vnd.ms-excel",
    	"text/plain"
    );

    Please test it and let me know if everything works smoothly now. Thank you!

    Thread Starter xxxLesy

    (@xxxlesy)

    Works 👍

    Thanks so much for your effort Atakan.

    Plugin Author Atakan Au

    (@atakanau)

    You’re very welcome! 😊
    I’ve just released version 1.0.2 as the official update.
    If anything else comes up, feel free to reopen or start a new thread. Take care!

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

You must be logged in to reply to this topic.