• Resolved programmin

    (@programmin)


    I am trying setting a configuration .json file that I previously used with the wpcli command line to set Total Cache. I set this programmatically with:

    $w3 = new \W3TC\Config();
    $w3->import(json file path);

    The path exists, is_readable but after running this I still see the “Welcome to the W3 Total Cache Setup Guide!” going to any setting page. Why is it not setting this in the same way a “wp total-cache import (jsonfile) would?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @programmin

    Thank you for reaching out and I am happy to help!

    The Setup Guide is displayed if a certain WP Site Option is not set.  It’s not controlled by the config.

    WP Site Option w3tc_setupguide_completed is set to a Unix timestamp (int) when completed or skipped.

    If you skip the Setup Guide are are the settings matching imported Json file?

    Thanks!

    Thread Starter programmin

    (@programmin)

    Thanks, that does it.

    However it doesn’t seem it imported? Before wpcli command I see:

    Preview Mode disabled

    Page Cache disabled

    Minify disabled

    Opcode Cache disabled

    Database Cache disabled

    Object Cache disabled

    Browser Cache enabled

    CDN disabled

    Reverse Proxy disabled

    Statistics disabled

    Fragment Cache disabled

    Debug disabled

    After a successful “wp total-cache import w3-total-cache-settings.json” I saw expected settings, as if the wpcli command is calling differently?

    Preview Mode disabled

    Page Cache enabled

    Minify disabled

    Opcode Cache disabled

    Database Cache disabled

    Object Cache disabled

    Browser Cache enabled

    CDN disabled

    Reverse Proxy disabled

    Statistics disabled

    Fragment Cache disabled

    Debug
    Thread Starter programmin

    (@programmin)

    Looking at the differences from your Cli.php and trying to do the same from code to import it…

    I called ->import(filename), then ->save(), even after calling WP_Filesystem, require_once of /w3-total-cache/w3-total-cache-api.php, still not setting what I would expect and what would be set with wp cli.

    Thread Starter programmin

    (@programmin)

    I don’t know if it is a Total-cache bug, but when I run it on later request and not immediately after activate_plugin, it works…?

    I think this can be closed, thank you.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hey @programmin

    Thank youj for your feedback!

    Glad to know it works!

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.