How can we improve our products?

Create an add-on to allow running the Cloner from the command line

This would allow you to use the php command from scripts to run the cloner with passed in parameters necessary to control cloning.

29 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
AdminNever Settle (Technology Architecture, Never Settle) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

6 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...
An error occurred while saving the comment
  • jay commented  ·   ·  Flag as inappropriate

    I took a look, and while I'm no expert I believe the path to calling this plugin with your own script (which I am keen to do!) is to create a form submission page much like the plugin's native form submission page. I am working on some other aspects of my project before I'm ready for automated spinups, but I see the plugin's native form submits to https://example.com/wp-admin/network/admin.php?page=ns-cloner&action=process" So you should be able to go into ns-template-main.php and hardcode that destination to a page that just dumps the _post vars, so you can see what's getting passed. Then you can create your own form that passes those same variables. In my case it will be a "Welcome!" form where the customer chooses a subdomain name and maybe some other data - timezone, etc.

  • AdminNever Settle (Technology Architecture, Never Settle) commented  ·   ·  Flag as inappropriate

    Thanks for the input @Samuel! We don't have an official API baked into it, BUT - the Cloner is rich with hooks and we built it specifically around the idea of a cloning pipeline that can be wired into from other plugins. It is VERY easy to use the Cloner's engine from anywhere within WP (or even outside WP if you load / include the main WP load file). Our own add-ons (especially Registration Templates) use the same mechanisms that are available to all plugins to tap into it / extend it / leverage it.

  • Donald Overlander commented  ·   ·  Flag as inappropriate

    Yes please, I am already scripting to wp-cli for a competing plugin that supports it - but would MUCH rather use NS Cloner. This is SERIOUSLY the only thing keeping a "university" sized project away.

  • Barry commented  ·   ·  Flag as inappropriate

    We would also wish to use this cloner from our PHP applications. We do not want to use the admin interface we just wish to clone automatically.

Feedback and Knowledge Base