• Hi,

    Great plugin, but have couple issues to report:

    1. “Purge All XXX Entries Now” button (wp-admin/options-general.php?page=wp-rest-api-log-settings) should not attempt to remove all rest api log entries at once, but rather execute small ajax request that would fire another ajax request upon completion until all records are removed. This is needed to avoid php timeouts (e.g. try removing 10,000 log entries)

    2. More serious issue is JSON storage as meta value. add_post_meta() will strip slashes and will corrupt JSON.

    E.g:

    original rest api request:

    {
      "some_key": "this is \"hello world\" message"
    }

    rest api request stored in meta by plugin:

    {
      "some_key": "this is "hello world" message"
    }

    Since quotes are no longer escaped, this corrupted JSON document can no longer be used to repeat JSON requests without manually reviewing the JSON document.

    Here is the patch that should resolve the issue:

    PATCH:
    https://gist.github.com/mch0lic/a8d52865ff04af5bdfb879e1d560921f

  • The topic ‘JSON request body issue’ is closed to new replies.