• Resolved th0masl

    (@th0masl)


    Hello,

    I’m planning to do a WP CLI scripted deployment of the settings of the gdpr-cookie-compliance plugin, but I’m running into a strange problem.

    I’m using a simple WP CLI command to export/import, that works with all the other plugins I’m using, but not with gdpr-cookie-compliance.

    Here is how to reproduce the problem :

    1) Install the plugin
    2) Use WP CLI to export the config as JSON, with WP CLI, example :
    wp option get moove_gdpr_plugin_settings –format=json > /tmp/gdpr.json

    3) Change something in the config (some text, it doesn’t matter), and save your changes :
    nano /tmp/gdpr.json (and change some text)

    4) Try to import the JSON file with WP CLI, example :
    wp option update moove_gdpr_plugin_settings –format=json < /tmp/gdpr.json

    Result :
    Error: Could not update option ‘moove_gdpr_plugin_settings’.

    But strangely enough, the option has been updated anyway.

    I’m using this same process for many other plugins, and I have this problem only with this plugin.

    Do you have any idea about what could be the problem ?

    I have the feeling that this is due to the encoding that is used when saving the values in the WP Options.

    According to the content of the JSON file, it looks like the gdpr-cookie-compliance plugin is converting the special charts to ASCII and escapes the ‘/’, even if it’s not really needed. Maybe that’s the reason of the problem ?

    Thanks

    Thomas

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Error while import settings as JSON from WP-CLI’ is closed to new replies.