PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.6
Code Manager v1.0.6
1.0.48 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.php
code-manager / freemius / includes / entities Last commit date
class-fs-affiliate-terms.php 5 years ago class-fs-affiliate.php 5 years ago class-fs-billing.php 5 years ago class-fs-entity.php 5 years ago class-fs-payment.php 5 years ago class-fs-plugin-info.php 5 years ago class-fs-plugin-license.php 5 years ago class-fs-plugin-plan.php 5 years ago class-fs-plugin-tag.php 5 years ago class-fs-plugin.php 5 years ago class-fs-pricing.php 5 years ago class-fs-scope-entity.php 5 years ago class-fs-site.php 5 years ago class-fs-subscription.php 5 years ago class-fs-user.php 5 years ago index.php 5 years ago
class-fs-plugin.php
159 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.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class FS_Plugin extends FS_Scope_Entity {
14 /**
15 * @since 1.0.6
16 * @var null|number
17 */
18 public $parent_plugin_id;
19 /**
20 * @var string
21 */
22 public $title;
23 /**
24 * @var string
25 */
26 public $slug;
27 /**
28 * @author Leo Fajardo (@leorw)
29 * @since 2.2.1
30 *
31 * @var string
32 */
33 public $premium_slug;
34 /**
35 * @since 1.2.2
36 *
37 * @var string 'plugin' or 'theme'
38 */
39 public $type;
40 /**
41 * @author Leo Fajardo (@leorw)
42 *
43 * @since 1.2.3
44 *
45 * @var string|false false if the module doesn't have an affiliate program or one of the following: 'selected', 'customers', or 'all'.
46 */
47 public $affiliate_moderation;
48 /**
49 * @var bool Set to true if the free version of the module is hosted on WordPress.org. Defaults to true.
50 */
51 public $is_wp_org_compliant = true;
52 /**
53 * @author Leo Fajardo (@leorw)
54 * @since 2.2.5
55 *
56 * @var int
57 */
58 public $premium_releases_count;
59
60 #region Install Specific Properties
61
62 /**
63 * @var string
64 */
65 public $file;
66 /**
67 * @var string
68 */
69 public $version;
70 /**
71 * @var bool
72 */
73 public $auto_update;
74 /**
75 * @var FS_Plugin_Info
76 */
77 public $info;
78 /**
79 * @since 1.0.9
80 *
81 * @var bool
82 */
83 public $is_premium;
84 /**
85 * @author Leo Fajardo (@leorw)
86 * @since 2.2.1
87 *
88 * @var string
89 */
90 public $premium_suffix;
91 /**
92 * @since 1.0.9
93 *
94 * @var bool
95 */
96 public $is_live;
97 /**
98 * @since 2.2.3
99 * @var null|number
100 */
101 public $bundle_id;
102 /**
103 * @since 2.3.1
104 * @var null|string
105 */
106 public $bundle_public_key;
107
108 const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
109
110 #endregion Install Specific Properties
111
112 /**
113 * @param stdClass|bool $plugin
114 */
115 function __construct( $plugin = false ) {
116 parent::__construct( $plugin );
117
118 $this->is_premium = false;
119 $this->is_live = true;
120
121 if ( empty( $this->premium_slug ) && ! empty( $plugin->slug ) ) {
122 $this->premium_slug = "{$this->slug}-premium";
123 }
124
125 if ( empty( $this->premium_suffix ) ) {
126 $this->premium_suffix = '(Premium)';
127 }
128
129 if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
130 $this->info = new FS_Plugin_Info( $plugin->info );
131 }
132 }
133
134 /**
135 * Check if plugin is an add-on (has parent).
136 *
137 * @author Vova Feldman (@svovaf)
138 * @since 1.0.6
139 *
140 * @return bool
141 */
142 function is_addon() {
143 return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
144 }
145
146 /**
147 * @author Leo Fajardo (@leorw)
148 * @since 1.2.3
149 *
150 * @return bool
151 */
152 function has_affiliate_program() {
153 return ( ! empty( $this->affiliate_moderation ) );
154 }
155
156 static function get_type() {
157 return 'plugin';
158 }
159 }