Forum Replies Created

Viewing 15 replies - 1 through 15 (of 56 total)
  • Thread Starter igianni84

    (@igianni84)

    Hi, I sent you emails two weeks ago, but I have not received a reply. (yet I have the PRO version)

    Thread Starter igianni84

    (@igianni84)

    Thanks for the reply Gabriel. I also asked in the community on facebook hoping to receive feedback. Hope to get it here too ??

    Thread Starter igianni84

    (@igianni84)

    Hi thanks for your support. I have send admin data via email.

    Thread Starter igianni84

    (@igianni84)

    UM 2.1.20
    No customization

    ??

    Thread Starter igianni84

    (@igianni84)

    Hi, I tried to update the user with the “[Rinnovato]Emilia Romagna” role again, but it doesn’t work. I also cleared the cache. I have disabled all plugins. But nothing to do …

    Yes, the users have all registered from the registration form ??

    Thread Starter igianni84

    (@igianni84)

    I solved it by changing plugin ?? Unfortunately I didn’t get any response …

    Thread Starter igianni84

    (@igianni84)

    Thanks! Now it’s ok!

    Thread Starter igianni84

    (@igianni84)

    Thanks for the super fast response. Would there be a way to see the queue?

    Because it seems strange to me that there is a 20 minute queue on a newly created site (on WordPress Multisite installation).

    Thread Starter igianni84

    (@igianni84)

    Thanks for the reply. I understand you … you cannot give assistance on custom codes. But I’m trying to use your own example code, but it doesn’t work.

    Obviously this file of mine is just an example that I will delete as soon as I can get it working.

    Thread Starter igianni84

    (@igianni84)

    Hi, unfortunately I can’t duplicate sites via api. My code is as follows:

    <?php
    /*
    Come categoria sito usare uno dei seguenti codici:
    9 => Sito abbigliamento
    2 => Sito casalinghi
    3 => Sito elettronica
    4 => Altro
    */
    require_once('wp-load.php');
    /*
    $nome_sito = $_POST['nome_sito'];
    $email_cliente = $_POST['email_cliente'];
    $categoria_sito = $_POST['categoria_sito']; //l'id del sito da copiare
    $descrizione_sito = $_POST['descrizione_sito']; //il title del sito
    */
    
    $request = array(
      'clone_mode'     => 'core',
      'source_id'      => 9,//$categoria_sito,
      'target_name'    => "ciao2",//$nome_sito,
      'target_title'   => "questa è una prova",//$descrizione_sito,
      'debug'          => 1 // optional: enables logs
    );
    
    // Register request with the cloner.
    foreach ( $request as $key => $value ) {
       ns_cloner_request()->set( $key, $value );
    }
    
    // Get the cloner process object.
    $cloner = ns_cloner()->process_manager;
    
    // Begin cloning.
    $cloner->init();
    
    // Check for errors (from invalid params, or already running process).
    $errors = $cloner->get_errors();
    if ( ! empty( $errors ) ) {
       // Handle error(s) and exit
    }
    
    // Last you'll need to poll for completion to run the cleanup process
    // when content is done cloning. Could be via AJAX to avoid timeout, or like:
    
    do {
       // Attempt to run finish, if content is complete.
       $cloner->maybe_finish();
       $progress = $cloner->get_progress();
       // Pause, so we're not constantly hammering the server with progress checks.
       sleep( 3 );
    } while ( 'reported' !== $progress['status'] );
    
    // Once you've verified that $progress['status'] is 'reported',
    // you can get access the array of report data (whether successful or failed) via:
    $reports = ns_cloner()->report->get_all_reports();
    
    print_r($reports);
    

    If I run this script (you can check by going to https://negozioperfetto.com/cloner.php), it times out after a few minutes.

    Why?

    Thread Starter igianni84

    (@igianni84)

    Okay, fine thanks. Could you just tell me how I can also associate a user in the site duplication API? What value should I add inside the request array?

    $request = array(
      'clone_mode'     => 'core',
      'source_id'      => $categoria_sito,
      'target_name'    => $nome_sito,
      'target_title'   => $descrizione_sito,
      'debug'          => 1 // optional: enables logs
    );
    Thread Starter igianni84

    (@igianni84)

    Thanks! I have another question: where is a complete documentation about API? I need to know how do I do assign an user to a website during the cloning… how do I delete a site, etc…

    P.S. I bought the PRO version ??

    Thanks

    Thread Starter igianni84

    (@igianni84)

    Hi, I’ve done some tests and it doesn’t seem to work. I used the following code, but it gives me a generic error (wordpress has stopped working). In the log file I read:

    [20-Oct-2020 08:02:26 UTC] PHP Fatal error:  Uncaught Exception: Access denied. in /var/www/vhosts/negozioperfetto.com/httpdocs/wp-content/plugins/elementor/core/settings/page/manager.php:105
    Stack trace:
    #0 /var/www/vhosts/negozioperfetto.com/httpdocs/wp-content/plugins/elementor/core/base/document.php(1214): Elementor\Core\Settings\Page\Manager->ajax_before_save_settings(Array, 2037)
    #1 /var/www/vhosts/negozioperfetto.com/httpdocs/wp-content/plugins/elementor/core/base/document.php(609): Elementor\Core\Base\Document->save_settings(Array)
    #2 /var/www/vhosts/negozioperfetto.com/httpdocs/wp-content/plugins/elementor/core/kits/manager.php(186): Elementor\Core\Base\Document->update_settings(Array)
    #3 /var/www/vhosts/negozioperfetto.com/httpdocs/wp-content/plugins/elementor/core/kits/manager.php(274): Elementor\Core\Kits\Manager->update_kit_settings_based_on_option('site_name', 'desc')
    #4 /var/www/vhosts/negozioperfetto.com/httpdocs/wp-includes/class-wp-hook.php(289): Elementor\Core\Kits\Manager->Elementor\Core\Kits\{closure}('Il mio negozio ...', 'desc')
    # in /var/www/vhosts/negozioperfetto.com/httpdocs/wp-content/plugins/elementor/core/settings/page/manager.php on line 105
    [20-Oct-2020 08:04:42 UTC] PHP Notice:  Undefined variable: pm in /var/www/vhosts/negozioperfetto.com/httpdocs/cloner.php on line 53
    [20-Oct-2020 08:04:42 UTC] PHP Fatal error:  Uncaught Error: Call to a member function maybe_finish() on null in /var/www/vhosts/negozioperfetto.com/httpdocs/cloner.php:53
    Stack trace:
    #0 {main}
      thrown in /var/www/vhosts/negozioperfetto.com/httpdocs/cloner.php on line 53
    <?php
    
    require_once('wp-load.php');
    
    $nome_sito = "nome1";
    $email_cliente = "[email protected]";
    $categoria_sito = 9; //l'id del sito da copiare
    $descrizione_sito = "desc"; //il title del sito
    
    $request = array(
      'clone_mode'     => 'core',
      'source_id'      => $categoria_sito,
      'target_name'    => $nome_sito,
      'target_title'   => $descrizione_sito,
      'debug'          => 1 // optional: enables logs
    );
    
    // Register request with the cloner.
    foreach ( $request as $key => $value ) {
       ns_cloner_request()->set( $key, $value );
    }
    
    // Get the cloner process object.
    $cloner = ns_cloner()->process_manager;
    
    // Begin cloning.
    $cloner->init();
    
    // Check for errors (from invalid params, or already running process).
    $errors = $cloner->get_errors();
    if ( ! empty( $errors ) ) {
       // Handle error(s) and exit
    }
    
    // Last you'll need to poll for completion to run the cleanup process
    // when content is done cloning. Could be via AJAX to avoid timeout, or like:
    
    do {
       // Attempt to run finish, if content is complete.
       $pm->maybe_finish();
       $progress = $pm->get_progress();
       // Pause, so we're not constantly hammering the server with progress checks.
       sleep( 5 );
    } while ( 'reported' !== $progress['status'] );
    
    // Once you've verified that $progress['status'] is 'reported',
    // you can get access the array of report data (whether successful or failed) via:
    $reports = ns_cloner()->report->get_all_reports();
    
    print_r($reports);

    Can you help me?

    Thread Starter igianni84

    (@igianni84)

    Thanks!

    Thread Starter igianni84

    (@igianni84)

    Hi, thanks, we’re almost there… It seems that some fields are still displayed incorrectly -> https://imgur.com/a/NmnWiLJ

Viewing 15 replies - 1 through 15 (of 56 total)