/**
  * Constructor for Licence Validator in each plugin
  *
  * @param string $file - full server path to the main plugin file
  * @param string $identifier - selling Shop Product ID
  * @param string $home_shop_url - selling Shop URL of this plugin (product)
  */
 public function __construct($file, $identifier, $home_shop_url)
 {
     $info = get_file_data($file, array('Title' => 'Plugin Name', 'Version' => 'Version', 'Url' => 'Plugin URI'), 'plugin');
     $this->identifier = $identifier;
     $this->file = $file;
     $this->path = plugin_dir_path($this->file);
     $this->plugin_slug = plugin_basename($this->file);
     list($a, $b) = explode('/', $this->plugin_slug);
     $this->file_slug = str_replace('.php', '', $b);
     $this->title = $info['Title'];
     $this->version = $info['Version'];
     $this->plugin_url = $info['Url'];
     $this->home_shop_url = $home_shop_url;
     $this->override_validation_url = get_option('jigoshop_license_override_validation_url', false);
     $this->custom_validation_url = get_option('jigoshop_license_custom_validation_url', '');
     if ($this->override_validation_url) {
         $this->home_shop_url = $this->custom_validation_url;
     }
     self::$plugins[$this->identifier] = array('version' => $this->version, 'plugin_slug' => $this->plugin_slug, 'file_slug' => $this->file_slug, 'path' => $this->path, 'title' => $this->title);
     if (!self::$instance) {
         self::$instance = true;
         add_action('admin_menu', array($this, 'register_nav_menu_link'));
         // Define the alternative response for information checking
         add_filter('plugins_api', array($this, 'get_update_info'), 20, 3);
     }
     // define the alternative API for updating checking
     add_filter('pre_set_site_transient_update_plugins', array($this, 'check_for_update'));
     add_action('in_plugin_update_message-' . $this->plugin_slug, array($this, 'in_plugin_update_message'), 10, 2);
 }