Example #1
0
 public function get_udrpc($indicator_name = 'migrator.updraftplus.com')
 {
     if (!class_exists('UpdraftPlus_Remote_Communications')) {
         require_once UPDRAFTPLUS_DIR . '/includes/class-udrpc.php';
     }
     $ud_rpc = new UpdraftPlus_Remote_Communications($indicator_name);
     $ud_rpc->set_can_generate(true);
     return $ud_rpc;
 }
Example #2
0
 public function do_bootstrap($opts, $connect = true)
 {
     if (!class_exists('UpdraftPlus_Remote_Communications')) {
         require_once UPDRAFTPLUS_DIR . '/includes/class-udrpc.php';
     }
     $opts = $this->get_opts();
     try {
         $ud_rpc = new UpdraftPlus_Remote_Communications($opts['name_indicator']);
         $ud_rpc->set_key_local($opts['key']);
         $ud_rpc->set_destination_url($opts['url']);
         $ud_rpc->activate_replay_protection();
     } catch (Exception $e) {
         return new WP_Error('rpc_failure', "Commmunications failure: " . $e->getMessage() . ' (line: ' . $e->getLine() . ', file: ' . $e->getFile() . ')');
     }
     $this->storage = $ud_rpc;
     return $this->storage;
 }