Exemplo n.º 1
0
 public function __construct($type = 'update_check', VD_Product $product = null, $args = array())
 {
     if ($product) {
         $this->product = $product;
         $this->args = array('product_id' => $product->id, 'product_file' => $product->file, 'product_type' => $product->is_theme() ? 'theme' : 'plugin', 'key' => $product->is_registered() ? $product->get_key() : false);
     }
     $this->args['home_url'] = esc_url(home_url('/'));
     if (!in_array($type, array('update_check', 'update', 'ping', 'register', 'unregister', 'expiration_check', 'license_check', 'generator_version_check', 'generator_check', 'generator_result_check'))) {
         return new WP_Error(__('Request method not supported', 'vendidero'));
     }
     $this->args = array_merge($this->args, $args);
     $this->args['request'] = $type;
     $this->response = new stdClass();
     $this->init();
 }
Exemplo n.º 2
0
 public function __construct($file, $product_id, $is_free = false)
 {
     parent::__construct($file, $product_id, $is_free = false);
     $this->theme = true;
 }
Exemplo n.º 3
0
 public function generator_result_check(VD_Product $product, $generator, $data = array(), $settings = array())
 {
     $request = new VD_Request('generator_result_check', $product, array('key' => $product->get_key(), 'generator' => sanitize_title($generator), 'data' => $data, 'settings' => $settings));
     return !$request->is_error() ? $request->get_response() : false;
 }