• Hi,
    with the last update Version 0.14.1 we have “Response was not JSON” on conversion method tests. And bulk convert doesn’t receiving list of files to convert …

    With the version 0.14 it works!?

    Thanks & Regards
    Dieter

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author rosell.dk

    (@roselldk)

    Can you open devtools on Chromium (right click somewhere on the page and select “Inspect”), go to the Network tab and see what was returned (click on “admin-ajax.php”, and click on “response”).

    In 0.14.1, I added nonces to all ajax requests. It has probably something to do with that.

    Thread Starter Dieter Schummer

    (@ds888)

    … on “response”

    {“success”:false,”data”:”Invalid security nonce (it has probably expired – try refreshing)”}

    Plugin Author rosell.dk

    (@roselldk)

    Can you check what was sent?
    In form-data, there should be a field called “nonce”.

    To check, instead of clicking on “Response”, click on “Headers”, and open “Form data”. It should look something like this (when testing a converter):

    
    action: convert_file
    nonce: 86285a0c9e
    
    • This reply was modified 5 years, 5 months ago by rosell.dk.
    Thread Starter Dieter Schummer

    (@ds888)

    … form data (bulk convert)
    action=list_unconverted_files

    … form data (test conversion)
    action=convert_file&filename=wordpress%2Fwp-content%2Fplugins%2Fwebp-express%2Ftest%2Ftest-pattern-tv.jpg&converter=imagemagick&config-overrides=%7B%22jpeg-encoding%22%3A%22auto%22%2C%22jpeg-enable-near-lossless%22%3Atrue%2C%22jpeg-near-lossless%22%3A60%2C%22quality-auto%22%3Atrue%2C%22max-quality%22%3A80%2C%22quality-specific%22%3A70%2C%22png-encoding%22%3A%22auto%22%2C%22png-enable-near-lossless%22%3Atrue%2C%22png-near-lossless%22%3A60%2C%22png-quality%22%3A85%2C%22alpha-quality%22%3A80%2C%22metadata%22%3A%22none%22%2C%22log-call-arguments%22%3Atrue%7D

    Plugin Author rosell.dk

    (@roselldk)

    I suspected it. The nonce is not set. It is probably because the old javascript is cached. This however ought not to be happening because I have remembered to increase the version where I register the scripts.

    Or the problem could be that the inline script with the nonces are not output.

    To determine which, can you please view the source code of the WebP Express options page (press Ctrl+U in Chrome). Next, search for the following text: “webpExpressAjaxConvertNonce” (press Ctrl+F to search in Chrome). Is it there?

    Also search for “test-convert.js”. It should be there, and it should have appended “?ver=0.14.1” after it

    Thread Starter Dieter Schummer

    (@ds888)

    Hi, after disable the WP Hide plugin, your webp plubin works.

    Now we must find “only” which settings in wp hide was the reason for these problems …

    Thanks & regards
    Dieter

    Thread Starter Dieter Schummer

    (@ds888)

    Hi,
    after disabled “Remove version number from enqueued script files.” in WP Hide the problems are gone …

    Thanks & Regards
    Dieter

    Thread Starter Dieter Schummer

    (@ds888)

    Plugin Author rosell.dk

    (@roselldk)

    ah, that explains it! I did not now of WP Hide, but it looks interesting. I shall have a look if it will help compatibility-wise if I use something else than the plugin version number as the “script version” for wp_register_script. I have created an issue for that here: https://github.com/rosell-dk/webp-express/issues/276

    Plugin Author rosell.dk

    (@roselldk)

    I tried out WP Hide. Had problems finding the setting, but finally found it in WP Hide > General / HTML > Scripts.

    Anyway, it turns out that the setting removes the version string, no matter what it is set to.

    To avoid caching, I would then have to rename the script files. But this would in effect kill the feature in WP Hide (for WebP Express). In the paranoid eyes of WP Hide, renaming script files would leak information about script version. So for the paranoid, who has activated “Remove Version”, it will be bad news if plugin authors starts circumventing the feature. So I guess I should not do that.

    I really wish that the setting in WP Hide came with a big warning, though!

    • This reply was modified 5 years, 5 months ago by rosell.dk.
    Plugin Author rosell.dk

    (@roselldk)

    Doing it anyway (renaming the script files). A guy called “Echo” claims that cache busting tokens does not work in all browsers here: https://stackoverflow.com/questions/32414/how-can-i-force-clients-to-refresh-javascript-files. I seriously doubt that claim though, but for the benefit of the doubt, I shall now change the name of the js folder for each release

    Plugin Author rosell.dk

    (@roselldk)

    This is part of 0.14.2 which has just been released

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Response was not JSON’ is closed to new replies.