Support » Plugin: wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin » Nested JSON has a query parameters bug

  • Resolved vedante30


    First of all I want to say that this is a gret plugin!
    Thank you for creating it!
    I have found a small bug on the full version of the plugin.
    I have tried the free version and the “nested JSON” option was working perfectly,
    When i started to use the full version, “nested JSON” stop accepting query parameters in “Input JSON URL” field. I get “Error! Unable to retrieve results” when I click “Get JSON roots” or “Conflict Error” when I click Save changes.
    Example of JSON URL:
    When I delete the query parameter (&limit=1000) from the URL, it works fine.
    What i already tried:
    1) Different JSON API urls
    2) Different Server / localhost
    2) Disabling other plugins
    Please check why the query parameters are not accepted on the full version.
    Thanks in advance!

    • This topic was modified 1 year, 2 months ago by vedante30.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpDataTables


    Hello, @vedante30
    Since you’re using the Premium version of the plugin, please open a ticket in the “Pre-Purchase” section on our official support platform, and we’ll gladly help you there.

    Premium products are not supported in these forums, as per this comment by moderators.

    Thank you for understanding.

    Thread Starter vedante30


    I have found a ready to use solution for that issue (Till the PRO plugin will be fixed).
    Putting it here if anybody with same issue will need it.

    Add this code in your functions.php theme file:

    add_action( 'parse_request', 'simplify_nested_json', 0 );
    function simplify_nested_json( $wp ) {
        // Check if the request is /simplify-json
        if ( 'simplify-json' !== $wp->request ) {
    $url ='';
    $JSON = file_get_contents($url);
    // echo the JSON (you can echo this to JavaScript to use it there)
    // You can decode it to process it in PHP
    $data = json_decode($JSON);
        // Array version of the JSON data.
        // Send headers.
        status_header( 200 );
        header( 'Content-Type: application/pkcs7-mime' );
        // And serve the JSON data.
         echo wp_json_encode($data->result->records );

    This code turns the nested JSON to a flat one.
    * Change the $url with your required API URL.
    * Change this part $data->result->records with the rout to the requested part of the JSON
    * Add “Input JSON URL” field.

    • This reply was modified 1 year, 2 months ago by vedante30.
    • This reply was modified 1 year, 2 months ago by vedante30.
    Plugin Author wpDataTables


    Hi, vedante30
    Thank you for sharing your solution on the Forum for other users.
    We are aware of this, and our developers will fix this issue for the premium version in the next update.
    The Lite version does not have this issue.
    Thanks again for sharing your workaround with us.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Nested JSON has a query parameters bug’ is closed to new replies.