• Resolved Anita C

    (@mymothersdaughter)


    I have read this already, but have a question about it. I appreciate the work plugin developers do to provide free plugins for us. I work for several theme designers and have a lot of clients of my own. These clients are on SiteGround, Bluehost, WPEngine, Flywheel, Hostgator and a lot of other hosting providers. This plugin hasn’t worked to use the upload method in quite some time. We always need to use the copy/paste method, and to be honest, there are a lot of end users who are not tech savvy in this regard to open the file on desktop and then do a copy/paste. At one time this plugin worked brilliantly and over time the function to import the widgets the traditional way was broken and has remained broken. Will there be a real solution to this besides the “copy/paste” approach? Or should we really look for other options to make it easier for end user? Thanks in advance.

    • This topic was modified 1 year, 9 months ago by Anita C.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Steven Gliebe

    (@stevengliebe)

    There are no plans for a change so you may want to look for another solution. The One Click Demo import plugin is popular, though it is based on WIE’s code (for the widgets portion). I am not sure if they have made modifications to address this issue or if it can import widgets only.

    Plugin Contributor Torsten Landsiedel

    (@zodiac1978)

    Hi @mymothersdaughter and @stevengliebe

    the problem is coming from the hoster and the PHP version, which is doing the MIME check. You can check what your server/PHP is returning for the .wie file and set this up accordingly here:
    https://github.com/churchthemes/widget-importer-exporter/blob/1545f7cc57291e191c7f9086efb30645d74822c3/includes/mime-types.php#L24-L29

    I’ve wrote (in German) about this problem in my blog (Google Translate will help):
    https://torstenlandsiedel.de/2019/01/28/kaputten-import-bei-caldera-forms-reparieren/

    This is about Caldera Forms Import, but the underlying problem is the same. So yes, this is fixable.

    All the best
    Torsten

    Plugin Contributor Torsten Landsiedel

    (@zodiac1978)

    It looks like this more about the underlying server library (libmagic) which is used. But the solution stays the same. You can check what your server is responding as Mime Type and use this (either text/plain, application/json or application/octet-stream)

    Plugin Author Steven Gliebe

    (@stevengliebe)

    Thank you, Torsten. I will look this over. I appreciate the information.

    Plugin Contributor Torsten Landsiedel

    (@zodiac1978)

    Happy to help!

    I use this tools so much (Thank you!) and have no problem with copy&paste, but looking at the support threads it would prevent so many work for you if this would be solved in the plugin.

    I don’t know if I have the time to make a PR, but I’m happy to help testing in every case.

    Plugin Contributor Torsten Landsiedel

    (@zodiac1978)

    Hi @stevengliebe

    I’ve reported this problem in a Slack meeting from the #core-media team and after some discussion the feedback was very positive, so this maybe gets better support in the future (for example: adding an array of allowed mime-types).

    After some more searching, I found a ticket already exploring a solution (patch also available):
    https://core.trac.www.ads-software.com/ticket/40175

    And there is a plugin available:
    https://www.ads-software.com/plugins/blob-mimes/

    It adds a debugging tool under tools to examine which mime type is your server returning for a given file.

    But maybe you can borrow some code from it for fixing the problem in your plugin, as it tries to fix things for some known file extension with the same problem. Unfortunately already archived on GitHub: https://github.com/Blobfolio/blob-mimes (but still updated on www.ads-software.com).

    Thread Starter Anita C

    (@mymothersdaughter)

    @zodiac1978 I am experiencing this on about 6 different hosts. So does this mean it needs to be fixed on all 6 hosting providers? Thank you so much for posting here too!

    Plugin Contributor Torsten Landsiedel

    (@zodiac1978)

    @mymothersdaughter The problem is, that a .wie is using the JSON format and this could have 2 or 3 “correct” mime types – text/plain, application/json or application/octet-stream.

    But WordPress has only a one-to-one mapping. So an extension can only have one mime type.

    Different servers have different libraries installed (libmagic or fileinfo) which detect the mime type of a file. So the same file can have different returned mime types on different servers.

    There are (complicated) ways to check different mime types, this could be one way to solve this in a plugin.

    The ticket mentioned above could maybe fix this on the WP side (allowing to add a list of allowed mime types per extension).

    Another way could be to change the plugin code temporarily. Attention: Only do that if you know what you do! Things will get overwritten on next update!

    Maybe you also can change the server behavior in some way. At the moment the mime type needs to be text/plain if I remember correctly. So you can try to add AddType text/plain .wie to the .htaccess (if you are on an Apache server, and you are allowed to add things like this.) – this is untested and maybe does not work.

    Plugin Author Steven Gliebe

    (@stevengliebe)

    This issue has been fixed with the release of 1.6.1. Thank you @zodiac1978 for contributing the fix.

    Thread Starter Anita C

    (@mymothersdaughter)

    @stevengliebe this is awesome news! Thank you @zodiac1978 !

    Plugin Contributor Torsten Landsiedel

    (@zodiac1978)

    If someone still has issues, please ping me here in the forums or on GitHub with specific details from your server and I will do my best to further fix this.

    If you know how to get them, I would be interested in PHP version, libmagic/fileinfo version and Apache/Nginx version to better find the culprit – thanks in advance!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Error on the import of the .wie’ is closed to new replies.