PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.35
Code Manager v1.0.35
1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / freemius / includes / entities / class-fs-plugin-plan.php
code-manager / freemius / includes / entities Last commit date
class-fs-affiliate-terms.php 2 years ago class-fs-affiliate.php 2 years ago class-fs-billing.php 2 years ago class-fs-entity.php 2 years ago class-fs-payment.php 2 years ago class-fs-plugin-info.php 2 years ago class-fs-plugin-license.php 2 years ago class-fs-plugin-plan.php 2 years ago class-fs-plugin-tag.php 2 years ago class-fs-plugin.php 2 years ago class-fs-pricing.php 2 years ago class-fs-scope-entity.php 2 years ago class-fs-site.php 2 years ago class-fs-subscription.php 2 years ago class-fs-user.php 2 years ago index.php 2 years ago
class-fs-plugin-plan.php
149 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.0.5
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * Class FS_Plugin_Plan
15 *
16 * @property FS_Pricing[] $pricing
17 */
18 class FS_Plugin_Plan extends FS_Entity {
19
20 #region Properties
21
22 /**
23 * @var number
24 */
25 public $plugin_id;
26 /**
27 * @var string
28 */
29 public $name;
30 /**
31 * @var string
32 */
33 public $title;
34 /**
35 * @var string
36 */
37 public $description;
38 /**
39 * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license.
40 */
41 public $is_free_localhost;
42 /**
43 * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and
44 * support.
45 */
46 public $is_block_features;
47 /**
48 * @var int
49 */
50 public $license_type;
51 /**
52 * @var bool
53 */
54 public $is_https_support;
55 /**
56 * @var int Trial days.
57 */
58 public $trial_period;
59 /**
60 * @var string If true, require payment for trial.
61 */
62 public $is_require_subscription;
63 /**
64 * @var string Knowledge Base URL.
65 */
66 public $support_kb;
67 /**
68 * @var string Support Forum URL.
69 */
70 public $support_forum;
71 /**
72 * @var string Support email address.
73 */
74 public $support_email;
75 /**
76 * @var string Support phone.
77 */
78 public $support_phone;
79 /**
80 * @var string Support skype username.
81 */
82 public $support_skype;
83 /**
84 * @var bool Is personal success manager supported with the plan.
85 */
86 public $is_success_manager;
87 /**
88 * @var bool Is featured plan.
89 */
90 public $is_featured;
91 /**
92 * @var bool Is hidden plan.
93 */
94 public $is_hidden;
95
96 #endregion Properties
97
98 /**
99 * @param object|bool $plan
100 */
101 function __construct( $plan = false ) {
102 parent::__construct( $plan );
103
104 if ( is_object( $plan ) ) {
105 $this->name = strtolower( $plan->name );
106 }
107 }
108
109 static function get_type() {
110 return 'plan';
111 }
112
113 /**
114 * @author Vova Feldman (@svovaf)
115 * @since 1.0.9
116 *
117 * @return bool
118 */
119 function is_free() {
120 return ( 'free' === $this->name );
121 }
122
123 /**
124 * Checks if this plan supports "Technical Support".
125 *
126 * @author Leo Fajardo (leorw)
127 * @since 1.2.0
128 *
129 * @return bool
130 */
131 function has_technical_support() {
132 return ( ! empty( $this->support_email ) ||
133 ! empty( $this->support_skype ) ||
134 ! empty( $this->support_phone ) ||
135 ! empty( $this->is_success_manager )
136 );
137 }
138
139 /**
140 * @author Vova Feldman (@svovaf)
141 * @since 1.0.9
142 *
143 * @return bool
144 */
145 function has_trial() {
146 return ! $this->is_free() &&
147 is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );
148 }
149 }