• I am trying to use this plugin to import posts but when I press “Import” on one of the entries, nothing happens. I opened up the developer console and found this error:

    Uncaught ReferenceError: importerAjaxObj is not defined
    at import_post (plugin.js?ver=1.1.0:6:18)
    at HTMLAnchorElement. (plugin.js?ver=1.1.0:26:9)
    at HTMLAnchorElement.dispatch (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.8.3:2:40035)
    at v.handle (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.8.3:2:38006)

    I am going to try and debug this issue and see if I can get the code working. In addition, I would like to see an “Import All” option that is idempotent, so I might work on that if I can get this bug resolved.

Viewing 1 replies (of 1 total)
  • Thread Starter keneucker

    (@keneucker)

    I fixed the javascript error. It was a naming error. The import_post function in plugin.js should read:

    function import_post(nonce, post_id) {

    $.ajax({

    url: restapipoImporterAjaxObj.ajaxurl,

    type: 'GET',

    data: {

    action: 'restapipo_importer_ajax_import_post',

    nonce: nonce,

    post_id: post_id

    },

    success: function(response) {

    // console.log(response);

    if (response.success == true) {

    window.open(response.data.url, '_blank');

    } else {

    alert(response.data.message);

    }

    }

    });

    }
Viewing 1 replies (of 1 total)

The topic ‘Plugin does not work when attempting to import posts’ is closed to new replies.