• Resolved scharfh

    (@scharfh)


    Dear developers,
    thank you for your perfect plugin, works as I have expected, truly its brilliant! But I have an issue, I was planning to implement results to WP-all import plugin (https://www.ads-software.com/plugins/wp-all-import/ – I use a PRO version), so I have added a download URL to WPallImport setting page: see image at: https://pasteboard.co/HrG1Y2r.jpg

    But I have received this message: There’s a problem with your import file
    Please verify that the URL returns a valid import file.

    If I download file from link, the file works as expected, or am I doing something wrong (am I missing some settings)?

    Thank you for your help

    • This topic was modified 6 years, 5 months ago by scharfh.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @scharfh, thanks for the compliment. I’m glad you like it.

    Off the bat I think it might have something to do with the extension. I think it’s supposed to be .xlsx. Could you maybe try to edit gf-entries-in-excel/src/Renderer/PHPExcelRenderer.php on line 56, and change .xls to .xlsx and try again?

    If that works, I will force the new extension in the next version. Maybe correct it with a toggle or something to switch between both. The file is actually rendered as an XLSX since we’ve updatet the plugin to use phpspeadsheet. But it can render both. Never had a problem with it, so I didn’t know that was wrong ??

    Please let me know if this helps. If not, I have another idea. But let’s try this first.

    Thread Starter scharfh

    (@scharfh)

    Whoa! That was an express reply. Well I did what you have written above, but unfortunately that did not work. I personally think there is no issue with excel extension(s), because if I download file(s) from that link and upload manually all of them work with no problems.

    Stefan

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @scharfh, So i figured it out. The problem is not on my side, Thankfully! The Wp-import-all plugin only tries to verify the excel output by extension, and because our url doesn’t have an extension, it can’t figure it out.

    But I can still fix it for you. I’m willing to make an adjustment to the plugin so you can use it by adding .xls or .xlsx to the end of the file.

    in src/GFExcel.php change this:

    
    private function getFormIdByHash($hash)
    {
        global $wpdb;
    
        //add the following line
        $hash = preg_replace("/\.xlsx?$/is", "", $hash);
    
        //.. rest of the file here 
    

    Then simply add .xls to the url you’ve entered. Should work like advertised. Let me know if this helps.

    Thread Starter scharfh

    (@scharfh)

    Unfortunately that also did not work. Maybe I have figured out why this does not work, I confirm – your plugin has no flaws – but I think that WPall Import need to read file before your URL executes. Eg.: If xls is stored at example.com/wp-content/uploads/2018/excel/gfexcel-file.xls it is loaded correctly…

    So, I have tried execute this PHP with cron, well I have not such PHP skills, but file was not saved to desired path:

      $source = "https://www.example.com/gf-entries-in-excel/4284abcc13dce9769d541c163078dfabf2940dfdf818482e22c2aad055491326";
     $destination = "/opt/bitnami/apps/wordpress/htdocs/wp-content/uploads/2018/export/";
    
     $data = file_get_contents($source);
     $file = fopen($destination, "w+");
     fputs($file, $data);
     fclose($file); 

    I assume that there is no option for your plugin to save file locally to path. Right?

    Stefan

    • This reply was modified 6 years, 5 months ago by scharfh.
    Plugin Author Doeke Norg

    (@doekenorg)

    Hi Stefan,

    Your script only doesn’t work, because the destination needs to be a filename. So it should end with something like file.xls. I’ve tried that, and I get the file contents perfectly like this.

    <?php
    
    $source = "https://url.test/gf-entries-in-excel/slug.xlsx";
    
     $data = file_get_contents($source);
     $file = fopen(__DIR__."/file.xls", "w+");
     fputs($file, $data);
     fclose($file);
    

    also, the wp-all-import plugin also downloads the file before processing. So if you can upload a file and it works, than the url should also work without problems, so I don’t think it’s a right problem.

    Can you confirm you can download the file now with the same url with .xls appended? so for example: https://www.example.com/gf-entries-in-excel/yourid.xls ? if that works, than that should be the url in wp-import-all. I’ve got that working on version 4.3.0 of that plugin. I don’t have a newer one, and can’t get one ??

    • This reply was modified 6 years, 5 months ago by Doeke Norg.
    Thread Starter scharfh

    (@scharfh)

    OH, I need to admit – I am dumb, DUMB as old oak!
    Everything works now – I have forgot to disable maintenance plugin, that was causing all that issue! It is working as a charm!

    Thank you so so much for your help, your plugin will truly help on site!

    Stefan

    Plugin Author Doeke Norg

    (@doekenorg)

    Nah, that’s not the first thing that would come to mind! I’ve recently ‘debugged’ something for more than an hour, which wasn’t even a bug. So, dumb is relative ??

    Not sure now if it was all of the problem, or part of the problem? But for sure the .xls was needed for version 4.3.0 ??

    Closing the issue now.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cooperation with WP-all import plugin’ is closed to new replies.