FS_Plugin_Plan

Class FS_Plugin_Plan.

Defined (1)

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

/freemius/includes/entities/class-fs-plugin-plan.php  
  1. class FS_Plugin_Plan extends FS_Entity { 
  2.  
  3. #region Properties 
  4.  
  5. /** 
  6. * @var number 
  7. */ 
  8. public $plugin_id; 
  9. /** 
  10. * @var string 
  11. */ 
  12. public $name; 
  13. /** 
  14. * @var string 
  15. */ 
  16. public $title; 
  17. /** 
  18. * @var string 
  19. */ 
  20. public $description; 
  21. /** 
  22. * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license. 
  23. */ 
  24. public $is_free_localhost; 
  25. /** 
  26. * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and 
  27. * support. 
  28. */ 
  29. public $is_block_features; 
  30. /** 
  31. * @var int 
  32. */ 
  33. public $license_type; 
  34. /** 
  35. * @var bool 
  36. */ 
  37. public $is_https_support; 
  38. /** 
  39. * @var int Trial days. 
  40. */ 
  41. public $trial_period; 
  42. /** 
  43. * @var string If true, require payment for trial. 
  44. */ 
  45. public $is_require_subscription; 
  46. /** 
  47. * @var string Knowledge Base URL. 
  48. */ 
  49. public $support_kb; 
  50. /** 
  51. * @var string Support Forum URL. 
  52. */ 
  53. public $support_forum; 
  54. /** 
  55. * @var string Support email address. 
  56. */ 
  57. public $support_email; 
  58. /** 
  59. * @var string Support phone. 
  60. */ 
  61. public $support_phone; 
  62. /** 
  63. * @var string Support skype username. 
  64. */ 
  65. public $support_skype; 
  66. /** 
  67. * @var bool Is personal success manager supported with the plan. 
  68. */ 
  69. public $is_success_manager; 
  70. /** 
  71. * @var bool Is featured plan. 
  72. */ 
  73. public $is_featured; 
  74.  
  75. #endregion Properties 
  76.  
  77. /** 
  78. * @param object|bool $plan 
  79. */ 
  80. function __construct( $plan = false ) { 
  81. parent::__construct( $plan ); 
  82.  
  83. if ( is_object( $plan ) ) { 
  84. $this->name = strtolower( $plan->name ); 
  85.  
  86. static function get_type() { 
  87. return 'plan'; 
  88.  
  89. /** 
  90. * @author Vova Feldman (@svovaf) 
  91. * @since 1.0.9 
  92. * @return bool 
  93. */ 
  94. function is_free() { 
  95. return ( 'free' === $this->name ); 
  96.  
  97. /** 
  98. * Checks if this plan supports "Technical Support". 
  99. * @author Leo Fajardo (leorw) 
  100. * @since 1.2.0 
  101. * @return bool 
  102. */ 
  103. function has_technical_support() { 
  104. return ( ! empty( $this->support_email ) || 
  105. ! empty( $this->support_skype ) || 
  106. ! empty( $this->support_phone ) || 
  107. ! empty( $this->is_success_manager ) 
  108. ); 
  109.  
  110. /** 
  111. * @author Vova Feldman (@svovaf) 
  112. * @since 1.0.9 
  113. * @return bool 
  114. */ 
  115. function has_trial() { 
  116. return ! $this->is_free() && 
  117. is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );