Support » Plugin: Code Snippets » An error occurred when processing the import file.

  • Resolved EricJohnsonGuru

    (@wormeyman)


    This started after the move to json.

    PHP:
    https://gist.github.com/octalmage/07f26e0d1f25cea9a8ca92ebc67a3a14

    <?php 
    /*
    Plugin Name: PHP Compatibility Custom Timeout
    */
    
    function custom_timeout( $timeout ) {
    	return 0;
    }
    
    add_filter( 'wpephpcompat_scan_timeout', 'custom_timeout', 10 );

    JSON:

    {
      "generator": "Code Snippets v2.10.0",
      "date_created": "2018-01-22 21:31",
      "snippets": [{
        "name": "PHP Compatibility Custom Timeout",
        "scope": "global",
        "code": " \r\n\/*\r\nPlugin Name: PHP Compatibility Custom Timeout\r\n*\/\r\n\r\nfunction custom_timeout( $timeout ) {\r\n\treturn 0;\r\n}\r\n\r\nadd_filter( 'wpephpcompat_scan_timeout', 'custom_timeout', 10 );"
      }]
    }
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Thanks for reporting this and providing the import files.

    I’ve tried both importing your provided JSON into my site, and exporting the provided code and re-importing it, and I am not receiving any errors.

    It’s a bit hard to know what to do from this point – I can’t really diagnose what’s going wrong if I can’t reproduce it.

    I have a similar issue, import from live to a new local site returns me this error:

    An error occurred when processing the import file.

    no other error message provided.

    Exported and downloaded the file, and tested all options under Duplicate Snippets when importing, still the same error all the time.

    24 snippets on the live site.

    Plugin Author Shea Bunge

    (@bungeshea)

    Hey Dennis,

    Just wondering, which PHP version are you running? And are you able to share the snippet code or export file with me so I can test it out myself?

    I’m having this issue as well. Version: 2.10.0 on both sites. Seem like Export defaults to .json, and import to .xml. If I try to list all files during import and choose the .json file, error is thrown.

    Json file below:

    {“generator”:”Code Snippets v2.10.0″,”date_created”:”2018-02-03 13:56″,”snippets”:[{“name”:”Divi – Adjust image size to 16×9 format and remove unused thumbnails”,”desc”:”Change the Settings > Media size to the following for minimal thumbnail files:\r\nMedium Size : 768 x 0\r\nLarge Size : 1280 x 0″,”scope”:”global”,”code”:”\/* Divi – Adjust image size to 16×9 format and remove unused thumbnails *\/\r\nfunction et_adjust_images() {\r\n\tadd_image_size(‘et-pb-post-main-image’, 768, 432, true);\r\n \tadd_image_size(‘et-pb-post-main-image-fullwidth’, 1280, 720, false);\r\n \tremove_image_size(‘et-pb-gallery-module-image-portrait’);\r\n\tremove_image_size(‘et-pb-portfolio-image’);\r\n\tremove_image_size(‘et-pb-portfolio-module-image’);\r\n\tremove_image_size(‘et-pb-portfolio-image-single’);\r\n}\r\n\r\nadd_action(‘init’, ‘et_adjust_images’, 11);”}]}

    @bungeshea

    php 7.2 on localhost

    I am going through the snippets as some are outdated and needs to be updated or replaced. I take one at a time on fresh local install but most still work on live site with php 7.1

    Plugin Author Shea Bunge

    (@bungeshea)

    Hey everyone,

    I have changed some things around with the import process in version 2.10.1, which should hopefully fix this issue.

    Unfortunately, I was not able to reproduce the same errors on my test site, so I can’t confirm whether these issues have actually been fixed, but I would really appreciate it if you could test it out and let me know.

    Thank you!

    Just exported on one site and imported on a different multisite using 2.10.1 – no issues…

    Thanks for providing this awesome plugin Shea 🙂
    – Bjarne

    Plugin Author Shea Bunge

    (@bungeshea)

    Excellent!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘An error occurred when processing the import file.’ is closed to new replies.