• Hey there and before all thanks for your plugin !

    I got a multisite structure and I need to clone a site multiple times (it will be a base site for all the sites I will create).

    The plugin do it good but I want to automate the process through programation and I started create a simple python script to interact with your plugin using the 3rd party plugin https://github.com/panic175/ns-cloner-api . Its supposed to make me able to clone a given websites launching my python script.

    However I got a problem when i make the request (i found the error in my debug.log file):

    [02-Jun-2023 19:22:13 UTC] PHP Fatal error: Uncaught Error: Call to private NS_Cloner::__construct() from invalid context in /home/mnmnxen/www/wp-content/plugins/ns-cloner-api-master/ns-cloner-api.php:52
    
    Stack trace:
    
    #0 /home/mnmnxen/www/wp-includes/rest-api/class-wp-rest-server.php(1143): NS_Cloner_API\copy_site()
    
    #1 /home/mnmnxen/www/wp-includes/rest-api/class-wp-rest-server.php(990): WP_REST_Server->respond_to_request()
    
    #2 /home/mnmnxen/www/wp-includes/rest-api/class-wp-rest-server.php(414): WP_REST_Server->dispatch()
    
    #3 /home/mnmnxen/www/wp-includes/rest-api.php(394): WP_REST_Server->serve_request()
    
    #4 /home/mnmnxen/www/wp-includes/class-wp-hook.php(307): rest_api_loaded()
    
    #5 /home/mnmnxen/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    
    #6 /home/mnmnxen/www/wp-includes/plugin.php(524): WP_Hook->do_action()
    
    #7 /home/mnmnxen/www/wp-includes/class-wp.php(398): do_action_ref_array()
    
    #8 /home/mnmnxen/www/wp-includes/class-wp.php(770): WP->parse_request()
    
    #9 /home/mnmnxen/www/wp-includes/functions.php(1330): WP->main()
    
    #10 /home/mnmnxen/ in /home/mnmnxen/www/wp-content/plugins/ns-cloner-api-master/ns-cloner-api.php on line 52

    I know it is not directly the fault of your plugin but Im also sure there is someone there that make it possible to clone a website using this other plugin or a homemade solution and Im curious about it, if someone got any idea..!

    The 3rd party plugin is old and im sure it just doesnt work with the new ns-cloner-site plugin but maybe someone here can help me in my journey..

    Thanks !

  • The topic ‘Trying to clone a site via API call’ is closed to new replies.