• Resolved douglaskastle

    (@douglaskastle)


    I haven’t seen this covered in the support, so apologies if this has come up (many) times before.

    I would like to have a private hidden wordpress install where I configure a website and then have the static dump of that site be the only public facing site. It would be nice if the site generation could have by default, maybe if there is a change to the database, or even just once a day or an hour.

    Is is possible to kick off the static site generation from command line, or setup a crontab to do it? How about adding a cron feature into the plugin in itself?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter douglaskastle

    (@douglaskastle)

    Maybe some of the features would become available if wp-cli support was added, which is being requested over here:

    https://patrickposner.dev/feature-requests/wp-cli-support/

    However, being able to set it up through the plugin interface would be ideal

    You can trigger wp-cli cron job like this:

    wp cron event schedule simply_static_site_export_cron
    wp cron event run --due-now
    
    • This reply was modified 4 years, 11 months ago by cusmin.
    Thread Starter douglaskastle

    (@douglaskastle)

    @cusmin

    Interesting, that is very helpful!

    How does that work for multi-site? (Do you know?)

    Thread Starter douglaskastle

    (@douglaskastle)

    @cusmin

    I had a read about wp cron support for multi-site, this seems to work:

    wp cron event schedule simply_static_site_export_cron --url=example.com
    wp cron event run --due-now --url=example.com
    Thread Starter douglaskastle

    (@douglaskastle)

    OK that seemed to be the all i needed to solve my problem.

    There is a plugin called WP Control (there are other ones too but that is the one I used), it allowed me to set up the WP cron task from the dashboard. What I was missing was the “Hook Name”, which is what you gave me in your reply, simply_static_site_export_cron.

    This give me the cron like operation I was looking for.

    WP Control also provides the ability to define time and periodicity of the job.

    I recommend you add some of this detail, mainly the hook name, to some of the documentation for Simply Static.

    • This reply was modified 4 years, 11 months ago by douglaskastle.
    Plugin Author patrickposner

    (@patrickposner)

    Hey @douglaskastle,

    thanks for the suggestions!

    As I’m working on complete documentation of Simply Static, I add a note for this as well!

    Best regards,
    Patrick

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

The topic ‘Cron site generation’ is closed to new replies.