FS_Site

The NextGEN Gallery FS Site class.

Defined (1)

The class is defined in the following location(s).

/freemius/includes/entities/class-fs-site.php  
  1. class FS_Site extends FS_Scope_Entity { 
  2. /** 
  3. * @var string 
  4. */ 
  5. public $slug; 
  6. /** 
  7. * @var number 
  8. */ 
  9. public $site_id; 
  10. /** 
  11. * @var number 
  12. */ 
  13. public $plugin_id; 
  14. /** 
  15. * @var number 
  16. */ 
  17. public $user_id; 
  18. /** 
  19. * @var string 
  20. */ 
  21. public $title; 
  22. /** 
  23. * @var string 
  24. */ 
  25. public $url; 
  26. /** 
  27. * @var string 
  28. */ 
  29. public $version; 
  30. /** 
  31. * @var string E.g. en-GB 
  32. */ 
  33. public $language; 
  34. /** 
  35. * @var string E.g. UTF-8 
  36. */ 
  37. public $charset; 
  38. /** 
  39. * @var string Platform version (e.g WordPress version). 
  40. */ 
  41. public $platform_version; 
  42. /** 
  43. * Freemius SDK version 
  44. * @author Leo Fajardo (@leorw) 
  45. * @since 1.2.2 
  46. * @var string SDK version (e.g.: 1.2.2) 
  47. */ 
  48. public $sdk_version; 
  49. /** 
  50. * @var string Programming language version (e.g PHP version). 
  51. */ 
  52. public $programming_language_version; 
  53. /** 
  54. * @var FS_Plugin_Plan $plan 
  55. */ 
  56. public $plan; 
  57. /** 
  58. * @var number|null 
  59. */ 
  60. public $license_id; 
  61. /** 
  62. * @var number|null 
  63. */ 
  64. public $trial_plan_id; 
  65. /** 
  66. * @var string|null 
  67. */ 
  68. public $trial_ends; 
  69. /** 
  70. * @since 1.0.9 
  71. * @var bool 
  72. */ 
  73. public $is_premium = false; 
  74. /** 
  75. * @author Leo Fajardo (@leorw) 
  76. * @since 1.2.1.5 
  77. * @var bool 
  78. */ 
  79. public $is_disconnected = false; 
  80.  
  81. /** 
  82. * @param stdClass|bool $site 
  83. */ 
  84. function __construct( $site = false ) { 
  85. $this->plan = new FS_Plugin_Plan(); 
  86.  
  87. parent::__construct( $site ); 
  88.  
  89. if ( is_object( $site ) ) { 
  90. $this->plan->id = $site->plan_id; 
  91.  
  92. if ( ! is_bool( $this->is_disconnected ) ) { 
  93. $this->is_disconnected = false; 
  94.  
  95. static function get_type() { 
  96. return 'install'; 
  97.  
  98. function is_localhost() { 
  99. // The server has no way to verify if localhost unless localhost appears in domain. 
  100. return WP_FS__IS_LOCALHOST_FOR_SERVER; 
  101. // return (substr($_SERVER['REMOTE_ADDR'], 0, 4) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1'); 
  102.  
  103. /** 
  104. * Check if site in trial. 
  105. * @author Vova Feldman (@svovaf) 
  106. * @since 1.0.9 
  107. * @return bool 
  108. */ 
  109. function is_trial() { 
  110. return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME ); 
  111.  
  112. /** 
  113. * Check if user already utilized the trial with the current install. 
  114. * @author Vova Feldman (@svovaf) 
  115. * @since 1.0.9 
  116. * @return bool 
  117. */ 
  118. function is_trial_utilized() { 
  119. return is_numeric( $this->trial_plan_id );